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);
}
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]);
}
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)");
cli.sendLine("/server-group=test-server-group/jvm=default:add");
// 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 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);
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project eap-additional-testsuite by jboss-set.
the class DeploymentScannerTestCase method addDeploymentScanner.
private void addDeploymentScanner() throws Exception {
WebArchive war = ShrinkWrap.create(WebArchive.class, "SimpleServlet.war");
war.addClass(SimpleServlet.class);
warFile = new File(deployDir.getAbsolutePath() + File.separator + "SimpleServlet.war");
new ZipExporterImpl(war).exportTo(warFile, true);
// add deployment scanner
String path = deployDir.getAbsolutePath();
path = path.replaceAll("\\\\", "/");
cli.sendLine("/subsystem=deployment-scanner/scanner=testScanner:add(scan-interval=1000,path=\"" + path + "\")");
// wait for deployment
Thread.sleep(2000);
// check that the app has been deployed
File marker = new File(deployDir.getAbsolutePath() + File.separator + "SimpleServlet.war.deployed");
assertTrue(marker.exists());
String response = HttpRequest.get(getBaseURL(url) + "SimpleServlet/SimpleServlet", 10, TimeUnit.SECONDS);
assertTrue("Invalid response: " + response, response.indexOf("SimpleServlet") >= 0);
}
Aggregations