use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
the class ArchiveDefaultScriptNamesTestCase method before.
@BeforeClass
public static void before() throws Exception {
String tempDir = TestSuiteEnvironment.getTmpDir();
WebArchive[] wars = new WebArchive[3];
// deployment1
wars[0] = ShrinkWrap.create(WebArchive.class, "deployment0.war");
wars[0].addClass(SimpleServlet.class);
wars[0].addAsWebResource(new StringAsset("Version0"), "page.html");
// deployment2
wars[1] = ShrinkWrap.create(WebArchive.class, "deployment1.war");
wars[1].addClass(SimpleServlet.class);
wars[1].addAsWebResource(new StringAsset("Version1"), "page.html");
// deployment3 is included but not deployed
wars[2] = ShrinkWrap.create(WebArchive.class, "deployment2.war");
wars[2].addClass(SimpleServlet.class);
wars[2].addAsWebResource(new StringAsset("Version2"), "page.html");
// build cli archive
EnterpriseArchive cliArchive = ShrinkWrap.create(EnterpriseArchive.class, "archive.cli");
String deploy = "deploy deployment0.war\ndeploy deployment1.war";
String undeploy = "undeploy deployment0.war\nundeploy deployment1.war";
cliArchive.add(new StringAsset(deploy), new BasicPath("/", "deploy.scr"));
cliArchive.add(new StringAsset(undeploy), new BasicPath("/", "undeploy.scr"));
for (WebArchive war : wars) {
cliArchive.add(war, new BasicPath("/"), ZipExporter.class);
}
cliArchiveFile = new File(tempDir + File.separator + "archive.cli");
new ZipExporterImpl(cliArchive).exportTo(cliArchiveFile, true);
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
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);
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
the class RolloutPlanTestCase method before.
@BeforeClass
public static void before() throws Exception {
CLITestSuite.initSuite();
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");
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
the class DomainDeploymentOverlayTestCase method before.
@BeforeClass
public static void before() throws Exception {
String tempDir = System.getProperty("java.io.tmpdir");
WebArchive war;
// deployment1
war = ShrinkWrap.create(WebArchive.class, "deployment0.war");
war.addClass(SimpleServlet.class);
war.addAsWebInfResource("cli/deployment-overlay/web.xml", "web.xml");
war1 = new File(tempDir + File.separator + war.getName());
new ZipExporterImpl(war).exportTo(war1, true);
war = ShrinkWrap.create(WebArchive.class, "deployment1.war");
war.addClass(SimpleServlet.class);
war.addAsWebInfResource("cli/deployment-overlay/web.xml", "web.xml");
war2 = new File(tempDir + File.separator + war.getName());
new ZipExporterImpl(war).exportTo(war2, true);
war = ShrinkWrap.create(WebArchive.class, "another.war");
war.addClass(SimpleServlet.class);
war.addAsWebInfResource("cli/deployment-overlay/web.xml", "web.xml");
war3 = new File(tempDir + File.separator + war.getName());
new ZipExporterImpl(war).exportTo(war3, true);
final URL overrideXmlUrl = DomainDeploymentOverlayTestCase.class.getClassLoader().getResource("cli/deployment-overlay/override.xml");
if (overrideXmlUrl == null) {
Assert.fail("Failed to locate cli/deployment-overlay/override.xml");
}
overrideXml = new File(overrideXmlUrl.toURI());
if (!overrideXml.exists()) {
Assert.fail("Failed to locate cli/deployment-overlay/override.xml");
}
final URL webXmlUrl = DomainDeploymentOverlayTestCase.class.getClassLoader().getResource("cli/deployment-overlay/web.xml");
if (webXmlUrl == null) {
Assert.fail("Failed to locate cli/deployment-overlay/web.xml");
}
webXml = new File(webXmlUrl.toURI());
if (!webXml.exists()) {
Assert.fail("Failed to locate cli/deployment-overlay/web.xml");
}
// Launch the domain
testSupport = CLITestSuite.createSupport(DomainDeploymentOverlayTestCase.class.getSimpleName());
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
the class DeploySingleServerGroupTestCase method before.
@BeforeClass
public static void before() throws Exception {
CLITestSuite.initSuite();
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);
}
Aggregations