Search in sources :

Example 11 with ZipExporterImpl

use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.

the class DataSourceTestCase method createDriverJarFile.

private File createDriverJarFile() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "foodriver.jar");
    jar.addClass(FooDriver.class);
    jar.addAsResource(FooDriver.class.getPackage(), "java.sql.Driver", "META-INF/services/java.sql.Driver");
    File tempFile = new File(System.getProperty("java.io.tmpdir"), "foodriver.jar");
    new ZipExporterImpl(jar).exportTo(tempFile, true);
    return tempFile;
}
Also used : FooDriver(org.jboss.as.test.integration.domain.driver.FooDriver) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ZipExporterImpl(org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)

Example 12 with ZipExporterImpl

use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.

the class DeployAllServerGroupsTestCase method before.

@BeforeClass
public static void before() throws Exception {
    CLITestSuite.createSupport(DeployAllServerGroupsTestCase.class.getSimpleName());
    war = ShrinkWrap.create(WebArchive.class, "SimpleServlet.war");
    war.addClass(SimpleServlet.class);
    war.addAsWebResource(new StringAsset("Version1"), "page.html");
    String tempDir = System.getProperty("java.io.tmpdir");
    warFile = new File(tempDir, "SimpleServlet.war");
    new ZipExporterImpl(war).exportTo(warFile, true);
    AbstractCliTestBase.initCLI(DomainTestSupport.masterAddress);
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) File(java.io.File) ZipExporterImpl(org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl) BeforeClass(org.junit.BeforeClass)

Example 13 with ZipExporterImpl

use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.

the class DeploySingleServerGroupTestCase method before.

@BeforeClass
public static void before() throws Exception {
    CLITestSuite.createSupport(DeploySingleServerGroupTestCase.class.getSimpleName());
    war = ShrinkWrap.create(WebArchive.class, "SimpleServlet.war");
    war.addClass(SimpleServlet.class);
    war.addAsWebResource(new StringAsset("Version1"), "page.html");
    String tempDir = System.getProperty("java.io.tmpdir");
    warFile = new File(tempDir + File.separator + "SimpleServlet.war");
    new ZipExporterImpl(war).exportTo(warFile, true);
    serverGroups = CLITestSuite.serverGroups.keySet().toArray(new String[CLITestSuite.serverGroups.size()]);
    AbstractCliTestBase.initCLI(DomainTestSupport.masterAddress);
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) File(java.io.File) ZipExporterImpl(org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl) BeforeClass(org.junit.BeforeClass)

Example 14 with ZipExporterImpl

use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.

the class DeploySingleServerGroupTestCase method testRedeploy.

public void testRedeploy() throws Exception {
    // check we have original deployment
    checkURL("/SimpleServlet/page.html", "Version1", serverGroups[0]);
    // update the deployment - replace page.html
    war = ShrinkWrap.create(WebArchive.class, "SimpleServlet.war");
    war.addClass(SimpleServlet.class);
    war.addAsWebResource(new StringAsset("Version2"), "page.html");
    new ZipExporterImpl(war).exportTo(warFile, true);
    // redeploy to group servers
    assertFalse(cli.sendLine("deploy --server-groups=" + serverGroups[0] + " " + warFile.getAbsolutePath(), true));
    // force redeploy
    cli.sendLine("deploy " + warFile.getAbsolutePath() + " --force");
    // check that new version is running
    checkURL("/SimpleServlet/page.html", "Version2", serverGroups[0]);
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ZipExporterImpl(org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)

Example 15 with ZipExporterImpl

use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.

the class RolloutPlanTestCase method before.

@BeforeClass
public static void before() throws Exception {
    CLITestSuite.createSupport(RolloutPlanTestCase.class.getSimpleName());
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "RolloutPlanTestCase.war");
    war.addClass(RolloutPlanTestServlet.class);
    war.addAsManifestResource(createPermissionsXmlAsset(// main-one
    new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(CLITestSuite.hostAddresses.get("master")) + ":" + TEST_PORT, "listen,resolve"), // main-three
    new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(CLITestSuite.hostAddresses.get("master")) + ":" + (TEST_PORT + 350), "listen,resolve")), "permissions.xml");
    String tempDir = System.getProperty("java.io.tmpdir");
    warFile = new File(tempDir + File.separator + "RolloutPlanTestCase.war");
    new ZipExporterImpl(war).exportTo(warFile, true);
    AbstractCliTestBase.initCLI(DomainTestSupport.masterAddress);
    // add another server group to default profile
    cli.sendLine("/server-group=test-server-group:add(profile=default,socket-binding-group=standard-sockets)");
    // add a server to the group
    cli.sendLine("/host=master/server-config=test-one:add(group=test-server-group,socket-binding-port-offset=700");
    cli.sendLine("/host=master/server-config=test-one/interface=public:add(inet-address=" + CLITestSuite.hostAddresses.get("master") + ")");
    CLITestSuite.addServer("test-one", "master", "test-server-group", "default", 700, true);
    // start main-two
    cli.sendLine("/host=master/server-config=main-two:start(blocking=true)");
    CLIOpResult res = cli.readAllAsOpResult();
    Assert.assertTrue(res.isIsOutcomeSuccess());
    waitUntilState("main-two", "STARTED");
    // start test-one
    cli.sendLine("/host=master/server-config=test-one:start(blocking=true)");
    res = cli.readAllAsOpResult();
    Assert.assertTrue(res.isIsOutcomeSuccess());
    waitUntilState("test-one", "STARTED");
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) CLIOpResult(org.jboss.as.test.integration.management.util.CLIOpResult) File(java.io.File) ZipExporterImpl(org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl) BeforeClass(org.junit.BeforeClass)

Aggregations

ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)20 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)18 File (java.io.File)16 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)15 BeforeClass (org.junit.BeforeClass)10 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)4 BasicPath (org.jboss.shrinkwrap.impl.base.path.BasicPath)3 URL (java.net.URL)2 SimpleHelloWorldServlet (org.jboss.as.test.integration.management.util.SimpleHelloWorldServlet)2 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)2 SocketPermission (java.net.SocketPermission)1 ITestConfigBuilder (org.apache.camel.itest.springboot.ITestConfigBuilder)1 FooDriver (org.jboss.as.test.integration.domain.driver.FooDriver)1 CLIOpResult (org.jboss.as.test.integration.management.util.CLIOpResult)1 ExplodedExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.ExplodedExporterImpl)1 Test (org.junit.Test)1