Skip to content

Commit

Permalink
Updated dependencies to newew version, changed to bundle pacakging.
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Mihalek <[email protected]>
  • Loading branch information
Martin Mihalek committed Aug 10, 2016
1 parent 688ab33 commit 7d7c9d3
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 91 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ test-output
atest/results
*.pyc
*.class
.pydevproject
.pydevproject
/.idea/
/target/
108 changes: 48 additions & 60 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.ombre42</groupId>
<groupId>com.github.aenniw</groupId>
<artifactId>jrobotremoteserver</artifactId>
<version>3.1-SNAPSHOT</version>
<packaging>jar</packaging>
<version>3.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>jrobotremoteserver</name>
<url>https://github.com/ombre42/jrobotremoteserver</url>
<url>https://github.com/aenniw/jrobotremoteserver</url>
<licenses>
<license>
<name>Apache 2</name>
Expand All @@ -22,6 +22,10 @@
<name>David Luu</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Martin Mihálek</name>
<email>[email protected]</email>
</developer>
</developers>
<parent>
<groupId>org.sonatype.oss</groupId>
Expand All @@ -37,30 +41,35 @@
<artifactId>xmlrpc-server</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>javalib-core</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.util</groupId>
<artifactId>ws-commons-util</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>7.6.3.v20120416</version>
<version>8.0.4.v20111024</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.robotframework</groupId>
<artifactId>javalib-core</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>xmlrpc</groupId>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-client</artifactId>
<version>3.0</version>
<version>3.1.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -69,11 +78,6 @@
<version>6.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>tjws</artifactId>
Expand All @@ -84,54 +88,38 @@
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<instructions>
<Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
<Import-Package>
!org.apache.commons.lang3.*,
!org.apache.ws.commons.*,
!org.robotframework.*,
!org.apache.xmlrpc.*,
*
</Import-Package>
<Export-Package>
org.apache.commons.lang3.*,
org.apache.ws.commons.*,
org.robotframework.*,
org.apache.xmlrpc.*
</Export-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<description>Serves remote test libraries for Robot Framework that are implemented in Java.</description>
<scm>
<connection>scm:git:[email protected]:ombre42/jrobotremoteserver.git</connection>
<developerConnection>scm:git:[email protected]:ombre42/jrobotremoteserver.git</developerConnection>
<url>[email protected]:ombre42/jrobotremoteserver.git</url>
<connection>scm:git:[email protected]:aenniw/jrobotremoteserver.git</connection>
<developerConnection>scm:git:[email protected]:aenniw/jrobotremoteserver.git</developerConnection>
<url>[email protected]:aenniw/jrobotremoteserver.git</url>
</scm>
</project>
14 changes: 7 additions & 7 deletions src/main/java/org/robotframework/remoteserver/RemoteServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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");
Expand All @@ -294,17 +294,17 @@ public void run() {

/**
* Stops the remote server immediately.
*
* @throws Exception
*
* @throws Exception If server cannot be stopped
*/
public void stop() throws Exception {
stop(0);
}

/**
* 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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -51,30 +51,25 @@ public class RemoteServerServlet extends XmlRpcServlet implements RemoteServerCo
private Map<String, RemoteLibrary> libraryMap = new ConcurrentHashMap<String, RemoteLibrary>();
private boolean allowStop = true;

@Override
public RemoteLibrary putLibrary(String path, Object library) {
checkPath(path);
RemoteLibraryFactory libraryFactory = createLibraryFactory();
RemoteLibrary remoteLibrary = libraryFactory.createRemoteLibrary(library);
return libraryMap.put(path, remoteLibrary);
}

@Override
public RemoteLibrary removeLibrary(String path) {
return libraryMap.remove(path);
}

@Override
public Map<String, RemoteLibrary> getLibraryMap() {
return new HashMap<String, RemoteLibrary>(libraryMap);
}

@Override
public boolean getAllowStop() {
return allowStop;
}

@Override
public void setAllowStop(boolean allowed) {
allowStop = allowed;
}
Expand Down Expand Up @@ -134,7 +129,6 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws Se
out.print(body);
}

@Override
public HttpServletRequest getRequest() {
return request.get();
}
Expand All @@ -152,7 +146,7 @@ private String getPage() {
sb.append("<TR><TD>");
sb.append(path.toString());
sb.append("</TD><TD>");
sb.append(StringEscapeUtils.escapeHtml(map.get(path).getName()));
sb.append(StringEscapeUtils.escapeHtml4(map.get(path).getName()));
sb.append("</TD></TR>");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping;

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() {
Expand All @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7d7c9d3

Please sign in to comment.