diff --git a/.gitignore b/.gitignore index 88edf3a..34876ea 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,6 @@ test-output atest/results *.pyc *.class -.pydevproject \ No newline at end of file +.pydevproject +/.idea/ +/target/ diff --git a/pom.xml b/pom.xml index 78606a1..d11df30 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - com.github.ombre42 + com.github.aenniw jrobotremoteserver - 3.1-SNAPSHOT - jar + 3.2-SNAPSHOT + bundle jrobotremoteserver - https://github.com/ombre42/jrobotremoteserver + https://github.com/aenniw/jrobotremoteserver Apache 2 @@ -22,6 +22,10 @@ David Luu mangaroo@gmail.com + + Martin Mihálek + aenniw@gmail.com + org.sonatype.oss @@ -37,15 +41,25 @@ xmlrpc-server 3.1.3 + + org.robotframework + javalib-core + 1.2.1 + + + org.apache.ws.commons.util + ws-commons-util + 1.0.2 + org.eclipse.jetty jetty-servlet - 7.6.3.v20120416 + 8.0.4.v20111024 - commons-lang - commons-lang - 2.4 + org.apache.commons + commons-lang3 + 3.4 log4j @@ -53,14 +67,9 @@ 1.2.16 - org.robotframework - javalib-core - 1.1 - - - xmlrpc + org.apache.xmlrpc xmlrpc-client - 3.0 + 3.1.3 test @@ -69,11 +78,6 @@ 6.3.1 test - - commons-logging - commons-logging - 1.1.1 - org.jboss.resteasy tjws @@ -84,54 +88,38 @@ - maven-assembly-plugin - 2.2-beta-5 + org.apache.felix + maven-bundle-plugin + true - - jar-with-dependencies - + + ${project.groupId}.${project.artifactId} + + !org.apache.commons.lang3.*, + !org.apache.ws.commons.*, + !org.robotframework.*, + !org.apache.xmlrpc.*, + * + + + org.apache.commons.lang3.*, + org.apache.ws.commons.*, + org.robotframework.*, + org.apache.xmlrpc.* + + - org.apache.maven.plugins - maven-source-plugin - 2.1.2 - - - attach-sources - - jar - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - - - jar - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.6 - 1.6 - + org.codehaus.mojo + build-helper-maven-plugin Serves remote test libraries for Robot Framework that are implemented in Java. - scm:git:git@github.com:ombre42/jrobotremoteserver.git - scm:git:git@github.com:ombre42/jrobotremoteserver.git - git@github.com:ombre42/jrobotremoteserver.git + scm:git:git@github.com:aenniw/jrobotremoteserver.git + scm:git:git@github.com:aenniw/jrobotremoteserver.git + git@github.com:aenniw/jrobotremoteserver.git diff --git a/src/main/java/org/robotframework/remoteserver/RemoteServer.java b/src/main/java/org/robotframework/remoteserver/RemoteServer.java index 6ed0e8b..513c4a9 100644 --- a/src/main/java/org/robotframework/remoteserver/RemoteServer.java +++ b/src/main/java/org/robotframework/remoteserver/RemoteServer.java @@ -15,7 +15,6 @@ package org.robotframework.remoteserver; import java.util.Map; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.log4j.BasicConfigurator; @@ -126,9 +125,9 @@ public void setHost(String hostName) { /** * Main method for command line usage. - * + * * @param args - * @throws Exception + * @throws Exception If server cannot be started */ public static void main(String[] args) throws Exception { configureLogging(); @@ -271,6 +270,7 @@ public void addLibrary(Class clazz, int port) { * @param timeoutMS * the milliseconds to wait for existing request to complete * before stopping the server + * @throws Exception If server cannot be stopped */ public void stop(int timeoutMS) throws Exception { log.info("Robot Framework remote server stopping"); @@ -294,8 +294,8 @@ public void run() { /** * Stops the remote server immediately. - * - * @throws Exception + * + * @throws Exception If server cannot be stopped */ public void stop() throws Exception { stop(0); @@ -303,8 +303,8 @@ public void stop() throws Exception { /** * Starts the remote server. Add test libraries first before calling this. - * - * @throws Exception + * + * @throws Exception If server cannot be started */ public void start() throws Exception { log.info("Robot Framework remote server starting"); diff --git a/src/main/java/org/robotframework/remoteserver/servlet/RemoteServerServlet.java b/src/main/java/org/robotframework/remoteserver/servlet/RemoteServerServlet.java index 48d5cf4..a8ea1ba 100644 --- a/src/main/java/org/robotframework/remoteserver/servlet/RemoteServerServlet.java +++ b/src/main/java/org/robotframework/remoteserver/servlet/RemoteServerServlet.java @@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.server.XmlRpcHandlerMapping; import org.apache.xmlrpc.webserver.XmlRpcServlet; @@ -51,7 +51,6 @@ public class RemoteServerServlet extends XmlRpcServlet implements RemoteServerCo private Map libraryMap = new ConcurrentHashMap(); private boolean allowStop = true; - @Override public RemoteLibrary putLibrary(String path, Object library) { checkPath(path); RemoteLibraryFactory libraryFactory = createLibraryFactory(); @@ -59,22 +58,18 @@ public RemoteLibrary putLibrary(String path, Object library) { return libraryMap.put(path, remoteLibrary); } - @Override public RemoteLibrary removeLibrary(String path) { return libraryMap.remove(path); } - @Override public Map getLibraryMap() { return new HashMap(libraryMap); } - @Override public boolean getAllowStop() { return allowStop; } - @Override public void setAllowStop(boolean allowed) { allowStop = allowed; } @@ -134,7 +129,6 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se out.print(body); } - @Override public HttpServletRequest getRequest() { return request.get(); } @@ -152,7 +146,7 @@ private String getPage() { sb.append(""); sb.append(path.toString()); sb.append(""); - sb.append(StringEscapeUtils.escapeHtml(map.get(path).getName())); + sb.append(StringEscapeUtils.escapeHtml4(map.get(path).getName())); sb.append(""); } } diff --git a/src/main/java/org/robotframework/remoteserver/servlet/ServerMethods.java b/src/main/java/org/robotframework/remoteserver/servlet/ServerMethods.java index cc29c56..7f3f877 100644 --- a/src/main/java/org/robotframework/remoteserver/servlet/ServerMethods.java +++ b/src/main/java/org/robotframework/remoteserver/servlet/ServerMethods.java @@ -19,8 +19,8 @@ import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.exception.ExceptionUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.robotframework.javalib.util.StdStreamRedirecter; diff --git a/src/main/java/org/robotframework/remoteserver/xmlrpc/ReflectiveHandlerMapping.java b/src/main/java/org/robotframework/remoteserver/xmlrpc/ReflectiveHandlerMapping.java index 60276d8..446ee6a 100644 --- a/src/main/java/org/robotframework/remoteserver/xmlrpc/ReflectiveHandlerMapping.java +++ b/src/main/java/org/robotframework/remoteserver/xmlrpc/ReflectiveHandlerMapping.java @@ -18,7 +18,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; - import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping; @@ -26,7 +25,7 @@ public class ReflectiveHandlerMapping extends AbstractReflectiveHandlerMapping { /** * Removes the prefixes from all keys in this handler mapping assuming a String was used as the key and period was - * used as a separator. Example: AccountsReceivable.Billing.getInvoice -> getInvoice + * used as a separator. Example: AccountsReceivable.Billing.getInvoice getInvoice */ @SuppressWarnings("unchecked") public void removePrefixes() { @@ -44,16 +43,15 @@ public void removePrefixes() { this.handlerMap = newHandlerMap; } - /** - * Adds handlers for the given object to the mapping. The handlers are build by invoking - * {@link #registerPublicMethods(String, Class)}. - * - * @param pKey - * The class key, which is passed to {@link #registerPublicMethods(String, Class)}. - * @param pClass - * Class, which is responsible for handling the request. - */ - public void addHandler(String pKey, Class pClass) throws XmlRpcException { + /** + * Adds handlers for the given object to the mapping. The handlers are build by invoking + * {@link #registerPublicMethods(String, Class)}. + * + * @param pKey The class key, which is passed to {@link #registerPublicMethods(String, Class)}. + * @param pClass Class, which is responsible for handling the request. + * @throws XmlRpcException If error occurs + */ + public void addHandler(String pKey, Class pClass) throws XmlRpcException { registerPublicMethods(pKey, pClass); } } diff --git a/src/main/java/org/robotframework/remoteserver/xmlrpc/TypeFactory.java b/src/main/java/org/robotframework/remoteserver/xmlrpc/TypeFactory.java index 44bc1a2..d05a8fb 100644 --- a/src/main/java/org/robotframework/remoteserver/xmlrpc/TypeFactory.java +++ b/src/main/java/org/robotframework/remoteserver/xmlrpc/TypeFactory.java @@ -17,7 +17,7 @@ import java.util.List; import java.util.Map; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.ws.commons.util.NamespaceContextImpl; import org.apache.xmlrpc.common.TypeFactoryImpl; import org.apache.xmlrpc.common.XmlRpcController;