use of io.undertow.servlet.test.util.TestResourceLoader in project undertow by undertow-io.
the class RealPathTestCase method setup.
@BeforeClass
public static void setup() throws ServletException {
final PathHandler root = new PathHandler();
final ServletContainer container = ServletContainer.Factory.newInstance();
ServletInfo realPathServlet = new ServletInfo("real path servlet", RealPathServlet.class).addMapping("/path/*");
DeploymentInfo builder = new DeploymentInfo().setClassIntrospecter(TestClassIntrospector.INSTANCE).setClassLoader(RealPathTestCase.class.getClassLoader()).setContextPath("/servletContext").setDeploymentName("servletContext.war").setResourceManager(new TestResourceLoader(RealPathTestCase.class)).addServlets(realPathServlet);
DeploymentManager manager = container.addDeployment(builder);
manager.deploy();
root.addPrefixPath(builder.getContextPath(), manager.start());
DefaultServer.setRootHandler(root);
}
use of io.undertow.servlet.test.util.TestResourceLoader in project undertow by undertow-io.
the class ContentTypeFilesTestCase method setup.
@BeforeClass
public static void setup() throws ServletException {
final PathHandler root = new PathHandler();
final ServletContainer container = ServletContainer.Factory.newInstance();
DeploymentInfo builder = new DeploymentInfo().setClassIntrospecter(TestClassIntrospector.INSTANCE).setClassLoader(ContentTypeFilesTestCase.class.getClassLoader()).setContextPath("/app").setDeploymentName("servletContext.war").setResourceManager(new TestResourceLoader(ContentTypeServlet.class)).setDefaultServletConfig(new DefaultServletConfig(true)).addMimeMapping(new MimeMapping("jnlp", "application/x-java-jnlp-file"));
DeploymentManager manager = container.addDeployment(builder);
manager.deploy();
root.addPrefixPath(builder.getContextPath(), manager.start());
DefaultServer.setRootHandler(root);
}
Aggregations