Skip to content

Commit 82f904d

Browse files
authored
Merge pull request #64 from robotframework/fix/rf_remote_api_requirements
Fix/rf remote api requirements
2 parents 1f881eb + e5df3dc commit 82f904d

File tree

10 files changed

+72
-36
lines changed

10 files changed

+72
-36
lines changed

.github/workflows/maven.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ jobs:
1212
java: [ 8 ]
1313
name: Test with Java ${{ matrix.java }}
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Set up JDK ${{ matrix.java }}
17-
uses: actions/setup-java@v1.2.0
17+
uses: actions/setup-java@v2
1818
with:
19+
distribution: 'zulu'
1920
java-version: ${{ matrix.java }}
21+
cache: 'maven'
2022
- name: Build with Maven
2123
run: mvn -B verify --file pom.xml
2224
release:
@@ -25,13 +27,15 @@ jobs:
2527
runs-on: ubuntu-latest
2628
name: Release package
2729
steps:
28-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
2931
- name: Set up JDK
30-
uses: actions/setup-java@v1.2.0
32+
uses: actions/setup-java@v2
3133
with:
32-
java-version: 8
34+
distribution: 'zulu'
35+
java-version: '8'
36+
cache: 'maven'
3337
- name: Release Maven package
34-
uses: samuelmeuli/action-maven-publish@1221d1fa792cab948a772c5e7c1f3abe84aec3bf
38+
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # tag=v1.4.0
3539
with:
3640
gpg_private_key: ${{ secrets.gpg_private_key }}
3741
gpg_passphrase: ${{ secrets.gpg_passphrase }}

.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__

README.rest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ New version:
1818
<dependency>
1919
<groupId>org.robotframework</groupId>
2020
<artifactId>jrobotremoteserver</artifactId>
21-
<version>4.0.1</version>
21+
<version>4.1.0</version>
2222
</dependency>
2323
2424
Old version

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>");

pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.robotframework</groupId>
55
<artifactId>jrobotremoteserver</artifactId>
6-
<version>4.0.2-SNAPSHOT</version>
6+
<version>4.1.1-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<name>jrobotremoteserver</name>
99
<description>Serves remote test libraries for Robot Framework that are implemented in Java.</description>
@@ -55,12 +55,12 @@
5555
<dependency>
5656
<groupId>org.eclipse.jetty</groupId>
5757
<artifactId>jetty-servlet</artifactId>
58-
<version>9.4.31.v20200723</version>
58+
<version>9.4.45.v20220203</version>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.apache.commons</groupId>
6262
<artifactId>commons-lang3</artifactId>
63-
<version>3.11</version>
63+
<version>3.12.0</version>
6464
</dependency>
6565
<dependency>
6666
<groupId>org.apache.commons</groupId>
@@ -70,12 +70,12 @@
7070
<dependency>
7171
<groupId>org.apache.logging.log4j</groupId>
7272
<artifactId>log4j-core</artifactId>
73-
<version>2.13.3</version>
73+
<version>2.17.2</version>
7474
</dependency>
7575
<dependency>
7676
<groupId>org.apache.logging.log4j</groupId>
7777
<artifactId>log4j-jcl</artifactId>
78-
<version>2.13.3</version>
78+
<version>2.17.2</version>
7979
</dependency>
8080
<dependency>
8181
<groupId>org.robotframework</groupId>
@@ -91,7 +91,7 @@
9191
<dependency>
9292
<groupId>org.testng</groupId>
9393
<artifactId>testng</artifactId>
94-
<version>7.3.0</version>
94+
<version>7.5</version>
9595
<scope>test</scope>
9696
</dependency>
9797
<dependency>
@@ -102,7 +102,7 @@
102102
<dependency>
103103
<groupId>org.jboss.resteasy</groupId>
104104
<artifactId>tjws</artifactId>
105-
<version>3.9.3.Final</version>
105+
<version>3.15.3.Final</version>
106106
<scope>test</scope>
107107
</dependency>
108108
</dependencies>
@@ -138,7 +138,7 @@
138138
</goals>
139139
</execution>
140140
</executions>
141-
<version>3.2.0</version>
141+
<version>3.3.0</version>
142142
<configuration>
143143
<descriptorRefs>
144144
<descriptorRef>jar-with-dependencies</descriptorRef>
@@ -161,7 +161,7 @@
161161
<plugin>
162162
<groupId>org.apache.maven.plugins</groupId>
163163
<artifactId>maven-javadoc-plugin</artifactId>
164-
<version>3.1.1</version>
164+
<version>3.2.0</version>
165165
<executions>
166166
<execution>
167167
<goals>
@@ -182,7 +182,7 @@
182182
<plugin>
183183
<groupId>org.apache.maven.plugins</groupId>
184184
<artifactId>maven-antrun-plugin</artifactId>
185-
<version>1.8</version>
185+
<version>3.0.0</version>
186186
<executions>
187187
<execution>
188188
<id>define-classpath</id>
@@ -203,7 +203,7 @@
203203
<plugin>
204204
<groupId>org.robotframework</groupId>
205205
<artifactId>robotframework-maven-plugin</artifactId>
206-
<version>1.7.2</version>
206+
<version>2.1.0</version>
207207
<executions>
208208
<execution>
209209
<id>FullDynamic</id>
@@ -381,7 +381,7 @@
381381
<plugin>
382382
<groupId>org.sonatype.plugins</groupId>
383383
<artifactId>nexus-staging-maven-plugin</artifactId>
384-
<version>1.6.7</version>
384+
<version>1.6.8</version>
385385
<extensions>true</extensions>
386386
<configuration>
387387
<serverId>ossrh</serverId>

src/main/java/org/robotframework/remoteserver/RemoteServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void start() throws Exception {
235235
}
236236

237237
/**
238-
* Configures logging systems used by <tt>RemoteServer</tt> and its
238+
* Configures logging systems used by <i>RemoteServer</i> and its
239239
* dependencies. Specifically,
240240
* <ul>
241241
* <li>Configure Log4J to log to the console</li>

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

Lines changed: 16 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,21 @@ 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+
.map(k->new AbstractMap.SimpleEntry<>(k, getLibraryInformation(k)))
205+
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
206+
}
207+
208+
private Object getLibraryInformation(String keyword) {
209+
Map<String, Object> info = new HashMap<>();
210+
info.put("args", get_keyword_arguments(keyword));
211+
info.put("types", get_keyword_types(keyword));
212+
info.put("tags", get_keyword_tags(keyword));
213+
info.put("doc", get_keyword_documentation(keyword));
214+
return info;
215+
}
216+
201217
/**
202218
* Stops the remote server if it is configured to allow that.
203219
*

0 commit comments

Comments
 (0)