@BeforeClass public static void startServer() throws Exception { // start a simple front service JaxWsServiceFactoryBean svrFBean = new JaxWsServiceFactoryBean(); svrFBean.setServiceClass(EchoService.class); JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean(svrFBean); svrBean.setAddress(SIMPLE_SERVER_ADDRESS); svrBean.setServiceClass(EchoService.class); svrBean.setServiceBean(new EchoServiceSessionImpl()); // make the Jetty server support sessions Bus bus = BusFactory.newInstance().createBus(); JettyHTTPServerEngineFactory jettyFactory = bus.getExtension(JettyHTTPServerEngineFactory.class); jettyFactory.createJettyHTTPServerEngine(PORT, "http").setSessionSupport(true); svrBean.setBus(bus); svrBean.create(); }
@AfterClass public static void destroyServer() { // If we don't destroy this the session support will spill over to other // tests and they will fail JettyHTTPServerEngineFactory.destroyForPort(PORT); }