How to load spring HTTPInvoker to jetty in test?

I have googled this one but no luck. I just want to see the example of how to load all the services I need in embedded-jetty to be able to test in JUnit. So, my goal would be something like this.

private String url = "SERVICE_URL";

public void before() {
   // start jetty with all the services I need

public void shouldDoSthIWant() {
   // invoke SERVICE_URL and test.


The sample app found here shows how to run HttpInvoker using embedded jetty in a simple java app. You should be able adapt that code to make it work in a junit.

Reproducing relevant sections of the code / configuration from that pare down here

Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();

Context context = new Context(server, "/", Context.SESSIONS);

DispatcherServlet dispatcherServlet = new DispatcherServlet();

ServletHolder servletHolder = new ServletHolder(dispatcherServlet);
context.addServlet(servletHolder, "/*")


<!-- This default handler takes care of each of the services enumerated below -->
<bean id="defaultHandlerMapping"
    class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />

<bean id="helloService" class="com.mycompany.service.impl.HelloServiceImpl"/>

<!-- SpringHTTP Service Exposure -->

<bean name="/HelloService"
    <property name="service" ref="helloService" />
    <property name="serviceInterface"
            value="com.mycompany.service.iface.HelloService" />

Need Your Help

How do I debug an AngularJS app in Visual Studio 2013 using Grunt?

node.js angularjs visual-studio-2013 gruntjs

I am currently trying to debug an AngularJS app I'm writing using Visual Studio 2013.

Selecting default values when specific values don't exist in where clause

sql sql-server-2008 stored-procedures

I am having difficulty finding a good way to selecting a column by a default value, when a specific value doesn't exist.