Skip to content

Commit 28d2e9e

Browse files
committed
fix: Annotation library example to work with current version
1 parent c7362f3 commit 28d2e9e

File tree

6 files changed

+32
-17
lines changed

6 files changed

+32
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ atest/results
1212
*.iml
1313
/.apt_generated/
1414
/.apt_generated_tests/
15+
__pycache__

examples/AnnotationLibrary/pom.xml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.example</groupId>
55
<artifactId>MyRemoteLibrary</artifactId>
@@ -15,42 +15,55 @@
1515
<dependency>
1616
<groupId>org.robotframework</groupId>
1717
<artifactId>javalib-core</artifactId>
18-
<version>0.9.1</version>
18+
<version>2.0.3</version>
1919
</dependency>
2020

2121
<!-- serve the library remotely -->
2222
<dependency>
23-
<groupId>com.github.ombre42</groupId>
23+
<groupId>org.robotframework</groupId>
2424
<artifactId>jrobotremoteserver</artifactId>
25-
<version>2.0-BETA</version>
25+
<version>4.1.0</version>
2626
</dependency>
2727

2828
<!-- escape text for HTML and copy IO streams -->
29+
<dependency>
30+
<groupId>org.apache.commons</groupId>
31+
<artifactId>commons-lang3</artifactId>
32+
<version>3.12.0</version>
33+
</dependency>
2934
<dependency>
3035
<groupId>commons-io</groupId>
3136
<artifactId>commons-io</artifactId>
32-
<version>2.3</version>
37+
<version>2.11.0</version>
3338
</dependency>
3439

3540
<!-- used to generate the library documentation -->
3641
<dependency>
3742
<groupId>org.robotframework</groupId>
3843
<artifactId>robotframework</artifactId>
39-
<version>2.7.0</version>
44+
<version>4.1.2</version>
4045
<scope>test</scope>
4146
</dependency>
4247

4348
<!-- unit testing framework used to generate the library documentation -->
4449
<dependency>
4550
<groupId>org.testng</groupId>
4651
<artifactId>testng</artifactId>
47-
<version>6.3.1</version>
52+
<version>7.5</version>
4853
<scope>test</scope>
4954
</dependency>
5055
</dependencies>
5156
<build>
5257
<plugins>
53-
58+
<plugin>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-compiler-plugin</artifactId>
61+
<version>3.8.1</version>
62+
<configuration>
63+
<source>1.8</source>
64+
<target>1.8</target>
65+
</configuration>
66+
</plugin>
5467
<!-- create a jar with all dependencies i.e. a standalone jar -->
5568
<plugin>
5669
<artifactId>maven-assembly-plugin</artifactId>
@@ -81,9 +94,9 @@
8194

8295
<!-- execute Robot Framework tests during the build -->
8396
<plugin>
84-
<groupId>com.googlecode.robotframework-maven-plugin</groupId>
97+
<groupId>org.robotframework</groupId>
8598
<artifactId>robotframework-maven-plugin</artifactId>
86-
<version>1.1.1</version>
99+
<version>2.1.0</version>
87100
<executions>
88101
<execution>
89102
<phase>test</phase>
@@ -93,7 +106,8 @@
93106
</execution>
94107
</executions>
95108
<configuration>
96-
109+
<logLevel>TRACE:INFO</logLevel>
110+
<testCasesDirectory>src/test/resources/robotframework/tests</testCasesDirectory>
97111
<!-- communicate to the acceptance tests that the library is being built -->
98112
<variables>
99113
<variable>BUILDING:True</variable>

examples/AnnotationLibrary/src/main/java/com/example/MyRemoteLibrary.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.nio.charset.Charset;
66

77
import org.apache.commons.io.IOUtils;
8+
89
import org.robotframework.javalib.library.AnnotationLibrary;
910
import org.robotframework.remoteserver.RemoteServer;
1011

@@ -26,8 +27,8 @@ public String getKeywordDocumentation(String keywordName) {
2627
*/
2728
public static void main(String[] args) throws Exception {
2829
RemoteServer.configureLogging();
29-
RemoteServer server = new RemoteServer();
30-
server.addLibrary(MyRemoteLibrary.class, 8270);
30+
RemoteServer server = new RemoteServer(8270);
31+
server.putLibrary("/", new MyRemoteLibrary());
3132
server.start();
3233
}
3334

examples/AnnotationLibrary/src/main/java/com/example/keywords/QueueManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.example.keywords;
22

3-
import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
3+
import static org.apache.commons.lang3.StringEscapeUtils.*;
44

55
import java.util.Iterator;
66
import java.util.Queue;
@@ -47,7 +47,7 @@ public void logQueue() {
4747
Iterator<Object> iter = queue.iterator();
4848
while (iter.hasNext()) {
4949
Object element = iter.next();
50-
String value = escapeHtml(element.toString());
50+
String value = escapeHtml4(element.toString());
5151
sb.append("<tr>");
5252
sb.append("<td>" + value + "</td>");
5353
sb.append("<td>" + element.getClass().getName() + "</td>");

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ public List<String> get_keyword_types(String keyword) {
201201

202202
public Map<String, Object> get_library_information() {
203203
return get_keyword_names().stream()
204-
.filter(k->!"stop_remote_server".equals(k))
205204
.map(k->new AbstractMap.SimpleEntry<>(k, getLibraryInformation(k)))
206205
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
207206
}

0 commit comments

Comments
 (0)