public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { HTTPContext httpContext = null; if(archive instanceof UndertowWebArchive) { httpContext = registerDeploymentInfo(archive); } else{ if(archive instanceof UndertowHttpHandlerArchive) { httpContext = registerHandler(archive); } } return new ProtocolMetaData().addContext(httpContext); }
@Override public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException { try { installBundle(archive, false); } catch (Exception e) { throw new DeploymentException("Can't deploy archive", e); } return new ProtocolMetaData().addContext(new JMXContext(mbeanServer)); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String uniqueName = deployer.deploy(archive, serverGroup.getName()); ProtocolMetaData metaData = new ProtocolMetaData(); for (Server server : domain.getServersInGroup(serverGroup)) { metaData.addContext(new LazyHttpContext(server, uniqueName, client)); } return metaData; }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { String uniqueName = deployer.deploy(archive, serverGroup.getName()); ProtocolMetaData metaData = new ProtocolMetaData(); for (Server server : domain.getServersInGroup(serverGroup)) { metaData.addContext(new LazyHttpContext(server, uniqueName, client)); } return metaData; }
private static ProtocolMetaData newHttpProtocolMetaData(final ServerService ss, final String contextRoot) { final HTTPContext httpContext = new HTTPContext(ss.getIP(), ss.getPort()); httpContext.add(new Servlet("ArquillianServletRunner", contextRoot)); return new ProtocolMetaData().addContext(httpContext); } }
public static ProtocolMetaData parse(String archiveName, ProfileService profile) throws Exception { ProtocolMetaData metaData = new ProtocolMetaData(); ManagementView management = profile.getViewManager(); management.load(); // extract server info HTTPContext httpContext = extractHTTPContext(management); if (httpContext != null) { metaData.addContext(httpContext); } // extract deployment content scanDeployment(management, httpContext, management.getDeployment(archiveName)); return metaData; }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { try { Manifest manifest = new Manifest(archive.get("/META-INF/MANIFEST.MF").getAsset().openStream()); OSGiMetaData metadata = OSGiMetaDataBuilder.load(manifest); BundleHandle handle = installBundle(archive); deployedBundles.put(metadata.getBundleSymbolicName(), handle); } catch (RuntimeException rte) { throw rte; } catch (Exception ex) { throw new DeploymentException("Cannot deploy: " + archive.getName(), ex); } MBeanServerConnection mbeanServer = mbeanServerInstance.get(); return new ProtocolMetaData().addContext(new JMXContext(mbeanServer)); }
public static ProtocolMetaData parse(String archiveName, ProfileService profile) throws Exception { ProtocolMetaData metaData = new ProtocolMetaData(); ManagementView management = profile.getViewManager(); management.load(); // extract server info HTTPContext httpContext = extractHTTPContext(management); if (httpContext != null) { metaData.addContext(httpContext); } // extract deployment content scanDeployment(management, httpContext, management.getDeployment(archiveName)); return metaData; }
@Test public void shouldBeAbleToInjectBaseContextURLQualified() throws Exception { URLBaseContextClassQualified test = execute( URLBaseContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080)), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080))); Assert.assertEquals("http://TEST-X:8080", test.url.toExternalForm()); }
@Test public void shouldBeAbleToInjectBaseContextURLQualified() throws Exception { URLBaseContextClassQualified test = execute( URLBaseContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080)), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080))); Assert.assertEquals("http://TEST-X:8080", test.url.toExternalForm()); }
@Test public void shouldBeAbleToInjectBaseContextURL() throws Exception { URLBaseContextClass test = execute( URLBaseContextClass.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST", 8080))); Assert.assertEquals("http://TEST:8080", test.url.toExternalForm()); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnUnKnownTargetInDeployment() throws Exception { execute( URLBaseContextClassQualifiedTargetedMissing.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X")))); }
@Test public void shouldBeAbleToInjectBaseContextURL() throws Exception { URLBaseContextClass test = execute( URLBaseContextClass.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST", 8080))); Assert.assertEquals("http://TEST:8080", test.url.toExternalForm()); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnUnKnownTargetInDeployment() throws Exception { execute( URLBaseContextClassQualifiedTargetedMissing.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X")))); }
@Test public void shouldBeAbleToInjectServletContextURLQualified() throws Exception { URLServletContextClassQualified test = execute( URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X")))); Assert.assertEquals("http://TEST-X:8080/test-X/", test.url.toExternalForm()); }
@Test public void shouldBeAbleToInjectServletContextURLQualified() throws Exception { URLServletContextClassQualified test = execute( URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST-Y", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-Y"))), new ProtocolMetaData() .addContext(new HTTPContext("TEST-X", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test-X")))); Assert.assertEquals("http://TEST-X:8080/test-X/", test.url.toExternalForm()); }
@Test public void shouldBeAbleToInjectServletContextURL() throws Exception { URLServletContextClass test = execute( URLServletContextClass.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test")))); Assert.assertEquals("http://TEST:8080/test/", test.url.toExternalForm()); }
@Test public void shouldBeAbleToInjectServletContextURL() throws Exception { URLServletContextClass test = execute( URLServletContextClass.class, ProtocolMetaData.class, new ProtocolMetaData() .addContext(new HTTPContext("TEST", 8080) .add(new Servlet(URLServletContextClass.class.getSimpleName(), "/test")))); Assert.assertEquals("http://TEST:8080/test/", test.url.toExternalForm()); }
@Override public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException { final File dump = toArchiveDump(archive); archive.as(ZipExporter.class).exportTo(dump, true); final String context = sanitizeName(archive); container.deployWebapp(context, dump); final int port = configuration.isSkipHttp() ? configuration.getHttpsPort() : configuration.getHttpPort(); return new ProtocolMetaData() .addContext(new HTTPContext(configuration.getHost(), port) .add(new Servlet("arquillian", context))); }
@Override public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentException { final File dump = toArchiveDump(archive); archive.as(ZipExporter.class).exportTo(dump, true); final String context = sanitizeName(archive); container.deployWebapp(context, dump); final int port = configuration.isSkipHttp() ? configuration.getHttpsPort() : configuration.getHttpPort(); return new ProtocolMetaData() .addContext(new HTTPContext(configuration.getHost(), port) .add(new Servlet("arquillian", context))); }