return new ProtocolMetaData();
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { androidDeploy.fire(new AndroidDeploy(archive)); return new ProtocolMetaData(); }
@Override public ProtocolMetaData deploy(Archive<?> archive) throws DeploymentException { deployArchiveEvent.fire(new AndroidDeploy(archive)); return new ProtocolMetaData(); }
@Test(expected = IllegalStateException.class) public void shouldThrowExceptionOnMissingDeploymentScenario() throws Exception { execute( true, false, URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@Test(expected = IllegalStateException.class) public void shouldThrowExceptionOnMissingContainerRegistry() throws Exception { execute( false, true, URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnUnKnownDeployment() throws Exception { execute( URLBaseContextClassQualifiedMissing.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@Test(expected = IllegalStateException.class) public void shouldThrowExceptionOnMissingContainerRegistry() throws Exception { execute( false, true, URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionOnUnKnownDeployment() throws Exception { execute( URLBaseContextClassQualifiedMissing.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@Test(expected = IllegalStateException.class) public void shouldThrowExceptionOnMissingDeploymentScenario() throws Exception { execute( true, false, URLServletContextClassQualified.class, ProtocolMetaData.class, new ProtocolMetaData(), new ProtocolMetaData()); }
@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; }
@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(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 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 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))); }