@Deployment(testable = false) public static WebArchive createTestArchive() { return new WebArchiveBuilder().withTestClassPackage(RequestContextTest.class) .withExcludedClass(TranslatorService.class.getName()) //TODO - keeping servlet definition in web.xml due to GLASSFISH-21303 .withWebXml( Descriptors.create(WebAppDescriptor.class).createServlet().servletName("Translator") .servletClass("org.jboss.cdi.tck.tests.context.request.ws.TranslatorEndpoint").loadOnStartup(1) .up().createServletMapping().servletName("Translator").urlPattern("/translator").up()).build(); }
.up() .getOrCreateServlet() .servletName(FacesServlet.class.getSimpleName()) .servletClass(FacesServlet.class.getName()) .loadOnStartup(1)
private void addPortletFragment(WebFragmentDescriptor webFragmentXml, String portlet) { webFragmentXml.createServlet() .servletName(portlet) .servletClass("org.apache.pluto.container.driver.PortletServlet") .createInitParam() .paramName("portlet-name") .paramValue(portlet) .up() .loadOnStartup(1) .up() .createServletMapping() .servletName(portlet) .urlPattern("/PlutoInvoker/" + portlet) .up(); }
private static void initialize( DeploymentContext context, Map<String,List<ProviderDeploymentContributor>> providers, Map<String,List<ServiceDeploymentContributor>> services, Map.Entry<String,ServiceDeploymentContributor> applications ) { WebAppDescriptor wad = context.getWebAppDescriptor(); String topoName = context.getTopology().getName(); if( applications == null ) { String servletName = topoName + SERVLET_NAME_SUFFIX; wad.createServlet().servletName( servletName ).servletClass( GatewayServlet.class.getName() ); wad.createServletMapping().servletName( servletName ).urlPattern( "/*" ); } else { String filterName = topoName + FILTER_NAME_SUFFIX; wad.createFilter().filterName( filterName ).filterClass( GatewayServlet.class.getName() ); wad.createFilterMapping().filterName( filterName ).urlPattern( "/*" ); } if (gatewayServices != null) { gatewayServices.initializeContribution(context); } else { log.gatewayServicesNotInitialized(); } initializeProviders( context, providers ); initializeServices( context, services ); initializeApplications( context, applications ); }
private static void initialize( DeploymentContext context, Map<String,List<ProviderDeploymentContributor>> providers, Map<String,List<ServiceDeploymentContributor>> services, Map.Entry<String,ServiceDeploymentContributor> applications ) { WebAppDescriptor wad = context.getWebAppDescriptor(); String topoName = context.getTopology().getName(); if( applications == null ) { String servletName = topoName + SERVLET_NAME_SUFFIX; wad.createServlet().servletName( servletName ).servletClass( GatewayServlet.class.getName() ); wad.createServletMapping().servletName( servletName ).urlPattern( "/*" ); } else { String filterName = topoName + FILTER_NAME_SUFFIX; wad.createFilter().filterName( filterName ).filterClass( GatewayServlet.class.getName() ); wad.createFilterMapping().filterName( filterName ).urlPattern( "/*" ); } if (gatewayServices != null) { gatewayServices.initializeContribution(context); } else { log.gatewayServicesNotInitialized(); } initializeProviders( context, providers ); initializeServices( context, services ); initializeApplications( context, applications ); }
@Deployment(testable = false) public static WebArchive createTestArchive() { return new WebArchiveBuilder().withTestClassPackage(WrappedInjectionTargetTest.class) .withExtension(ProcessInjectionTargetObserver.class) .withExcludedClass(ContainerEventTest.class.getName()) .withWebResource("TestLibrary.tld", LIBRARY_TLD_PATH) .withWebResource("index.jsp", "index.jsp") .withWebXml( Descriptors.create(WebAppDescriptor.class) .createJspConfig().createTaglib() .taglibUri(TEST_URI) .taglibLocation(LIBRARY_TLD_PATH).up().up() .createServlet().servletName("Cowboy") .servletClass(CowboyEndpoint.class.getName()).loadOnStartup(1) .up().createServletMapping().servletName("Cowboy").urlPattern("/cowboy").up()).build(); }