@Test public void testWebXmlApplicationServletMappingAbsent() throws Exception { JAXRSArchive archive = ShrinkWrap.create(JAXRSArchive.class); archive.addClass(MyResource.class); archive.setWebXML(new StringAsset("<web-app><display-name>Foo</display-name></web-app>")); DefaultApplicationDeploymentProcessor processor = new DefaultApplicationDeploymentProcessor(archive); processor.applicationPath.set("/api-test"); processor.process(); Node generated = archive.get(PATH); assertThat(generated).isNotNull(); }
@Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); @Override void process(); }
DefaultApplicationDeploymentProcessor implements DeploymentProcessor { @Override public void process() throws Exception { if (this.deploymentContext != null && this.deploymentContext.isImplicit()) { return; } if (!archive.getName().endsWith(".war")) { return; } if (hasApplicationPathOrServletMapping(archive)) { return; } if (applicationPath.isExplicit()) { addGeneratedApplication(archive.as(JAXRSArchive.class)); } } @Inject  DefaultApplicationDeploymentProcessor(Archive archive); @Override void process();  }