@Override protected void doSetUp() throws Exception { httpServer = new Server(SERVER_PORT); Context c = new Context(httpServer, "/", Context.SESSIONS); c.addServlet(new ServletHolder(new MuleAjaxServlet()), "/ajax/*"); c.addEventListener( new ServletContextListener() { public void contextInitialized(ServletContextEvent sce) { sce.getServletContext().setAttribute(MuleProperties.MULE_CONTEXT_PROPERTY, muleContext); } public void contextDestroyed(ServletContextEvent sce) {} }); httpServer.start(); super.doSetUp(); }
@Override protected void doTearDown() throws Exception { super.doTearDown(); if (httpServer != null) httpServer.stop(); }