Skip to content

Commit c7362f3

Browse files
HannuLahtinenHi-Fi
authored andcommitted
Fix for issue #58:
get_library_information is not implemented Fixed by adding generic implementation for get_library_information() method to ServerMethods class. Exclude stop_remote_server from get_library_information keywords.
1 parent 5d3ad01 commit c7362f3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/main/java/org/robotframework/remoteserver/servlet/ServerMethods.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package org.robotframework.remoteserver.servlet;
1616

1717
import java.util.*;
18+
import java.util.stream.Collectors;
1819

1920
import org.apache.commons.lang3.StringUtils;
2021
import org.apache.commons.lang3.exception.ExceptionUtils;
@@ -198,6 +199,22 @@ public List<String> get_keyword_types(String keyword) {
198199
return types == null ? new ArrayList<String>() : types;
199200
}
200201

202+
public Map<String, Object> get_library_information() {
203+
return get_keyword_names().stream()
204+
.filter(k->!"stop_remote_server".equals(k))
205+
.map(k->new AbstractMap.SimpleEntry<>(k, getLibraryInformation(k)))
206+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
207+
}
208+
209+
private Object getLibraryInformation(String keyword) {
210+
Map<String, Object> info = new HashMap<>();
211+
info.put("args", get_keyword_arguments(keyword));
212+
info.put("types", get_keyword_types(keyword));
213+
info.put("tags", get_keyword_tags(keyword));
214+
info.put("doc", get_keyword_documentation(keyword));
215+
return info;
216+
}
217+
201218
/**
202219
* Stops the remote server if it is configured to allow that.
203220
*

0 commit comments

Comments
 (0)