use of io.undertow.servlet.test.util.MessageServlet in project undertow by undertow-io.
the class RequestListenerAsyncRequestTestCase method setup.
@BeforeClass
public static void setup() throws ServletException {
final PathHandler root = new PathHandler();
final ServletContainer container = ServletContainer.Factory.newInstance();
ServletInfo m = new ServletInfo("messageServlet", MessageServlet.class).addInitParam(MessageServlet.MESSAGE, HELLO_WORLD).setAsyncSupported(true).addMapping("/message");
ServletInfo a = new ServletInfo("asyncServlet", AsyncServlet.class).addInitParam(MessageServlet.MESSAGE, HELLO_WORLD).setAsyncSupported(true).addMapping("/async");
ServletInfo a2 = new ServletInfo("asyncServlet2", AnotherAsyncServlet.class).setAsyncSupported(true).addMapping("/async2");
DeploymentInfo builder = new DeploymentInfo().setClassLoader(SimpleServletTestCase.class.getClassLoader()).setContextPath("/servletContext").setClassIntrospecter(TestClassIntrospector.INSTANCE).setDeploymentName("servletContext.war").addServlets(m, a, a2).addListener(new ListenerInfo(TestListener.class));
DeploymentManager manager = container.addDeployment(builder);
manager.deploy();
root.addPrefixPath(builder.getContextPath(), manager.start());
DefaultServer.setRootHandler(root);
}
Aggregations