Simplest remoting server using Spring HttpInvoker

1.1k Views Asked by At

For (JUnit) testing purposes I'd like to make a simple application that would be the server to be invoked using Spring HttpInvoker. I don't want to make a real webapp to be deployed in any servlet container, only something standalone.

Do you have any ideas how to make it as simply as possible? (Solutions without embedded Tomcat or stuff are preferred..)

2

There are 2 best solutions below

0
On BEST ANSWER

This will work out well for you - http://docs.codehaus.org/display/JETTY/ServletTester

    @BeforeClass
public static void initServletContainer() throws Exception {
    tester = new ServletTester();
    tester.setContextPath("/");
    tester.addServlet(DummyServlet.class, "/dummy");
    baseUrl = tester.createSocketConnector(true);
    tester.start();
    System.out.println(baseUrl);
}

You can start up the server in your @BeforeClass method, record the baseUrl where the server starts up and use this url to test your client.

0
On