DeploymentInfo builder = new DeploymentInfo()
.setClassIntrospecter(TestClassIntrospector.INSTANCE)
.setClassLoader(ServletPathMappingTestCase.class.getClassLoader())
.setContextPath("/servletContext")
.setDeploymentName("servletContext.war")
.setResourceManager(new TestResourceLoader(WelcomeFileTestCase.class))
.addWelcomePages("doesnotexist.html", "index.html", "default", "servletPath/servletFile.xhtml")
.addServlet(new ServletInfo("DefaultTestServlet", PathTestServlet.class)
.addMapping("/path/default"))
.addServlet(new ServletInfo("ServletPath", PathTestServlet.class)
.addMapping("/foo/servletPath/*"))
.addFilter(new FilterInfo("Filter", NoOpFilter.class))
.addFilterUrlMapping("Filter", "/*", DispatcherType.REQUEST)
.addFilterUrlMapping("Filter", "/", DispatcherType.REQUEST);
DeploymentManager manager = container.addDeployment(builder);
manager.deploy();
root.addPrefixPath(builder.getContextPath(), manager.start());
builder = new DeploymentInfo()
.setClassIntrospecter(TestClassIntrospector.INSTANCE)
.setClassLoader(ServletPathMappingTestCase.class.getClassLoader())
.setContextPath("/servletContext2")
.setDeploymentName("servletContext2.war")
.setResourceManager(new TestResourceLoader(WelcomeFileTestCase.class))
.addWelcomePages("doesnotexist.html", "index.do")
.addServlet(new ServletInfo("*.do", PathTestServlet.class)
.addMapping("*.do"));
manager = container.addDeployment(builder);