Skip to content

Commit

Permalink
Update for Java 11 + Jetty 11 (javax -> jakarta)+ minor bug fixes (#68)
Browse files Browse the repository at this point in the history
* Updated Jetty version 11.0.3 with support for Jakarta EE 5+
* Java CI update for Java 11
* Make sure that we don't add more than once the stop_remote_server
  • Loading branch information
vhup committed Dec 7, 2022
1 parent 82f904d commit cb0de38
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
# test against LTS java versions:
java: [ 8 ]
java: [ 11 ]
name: Test with Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v3
Expand All @@ -32,7 +32,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '8'
java-version: '11'
cache: 'maven'
- name: Release Maven package
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709 # tag=v1.4.0
Expand Down
15 changes: 10 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@
</properties>
<dependencies>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>com.evolvedbinary.thirdparty.org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-server</artifactId>
<version>3.1.3</version>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.4.45.v20220203</version>
<version>11.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -175,8 +180,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>11</release>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import org.robotframework.remoteserver.servlet.IllegalPathException;
import org.robotframework.remoteserver.servlet.RemoteServerServlet;

//import org.eclipse.jetty.servlet.ServletHandler;

/**
* Remote server for Robot Framework implemented in Java. Takes one or more test
* libraries and exposes their methods via XML-RPC using an embedded web server.
Expand Down Expand Up @@ -231,7 +233,7 @@ public void stop() throws Exception {
public void start() throws Exception {
log.info("Robot Framework remote server starting");
server.start();
log.info(String.format("Robot Framework remote server started on port %d.", serverPort));
log.info(String.format("Robot Framework remote server started on port %d.", getLocalPort()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.robotframework.remoteserver.library.RemoteLibrary;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;


import org.apache.commons.text.StringEscapeUtils;
import org.apache.xmlrpc.XmlRpcException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public List<String> get_keyword_names() {
List<String> names = servlet.getLibrary().getKeywordNames();
if (names == null || names.size() == 0)
throw new RuntimeException("No keywords found in the test library");
names.add("stop_remote_server");
if (!names.contains("stop_remote_server")) names.add("stop_remote_server");
return names;
} catch (Throwable e) {
log.warn("", e);
Expand Down Expand Up @@ -200,9 +200,15 @@ public List<String> get_keyword_types(String keyword) {
}

public Map<String, Object> get_library_information() {
return get_keyword_names().stream()
Map<String, Object> result=new HashMap<String, Object>();
List<String> keywords=get_keyword_names();
for (String k: keywords) {
result.put(k,getLibraryInformation(k));
}
return result;
/* return get_keyword_names().stream()
.map(k->new AbstractMap.SimpleEntry<>(k, getLibraryInformation(k)))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));*/
}

private Object getLibraryInformation(String keyword) {
Expand Down

This file was deleted.

0 comments on commit cb0de38

Please sign in to comment.