@AfterClass public static void after() throws Exception { CLITestSuite.stopSupport(); cliTestApp1War.delete(); cliTestApp2War.delete(); cliTestAnotherWar.delete(); cliTestAppEar.delete(); }
@BeforeClass public static void before() throws Exception { CLITestSuite.createSupport(UndeployWildcardDomainTestCase.class.getSimpleName()); String tempDir = System.getProperty("java.io.tmpdir"); // deployment1 WebArchive war = ShrinkWrap.create(WebArchive.class, "cli-test-app1.war"); war.addAsWebResource(new StringAsset("Version0"), "page.html"); cliTestApp1War = new File(tempDir + File.separator + war.getName()); new ZipExporterImpl(war).exportTo(cliTestApp1War, true); // deployment2 war = ShrinkWrap.create(WebArchive.class, "cli-test-app2.war"); war.addAsWebResource(new StringAsset("Version1"), "page.html"); cliTestApp2War = new File(tempDir + File.separator + war.getName()); new ZipExporterImpl(war).exportTo(cliTestApp2War, true); // deployment3 war = ShrinkWrap.create(WebArchive.class, "cli-test-another.war"); war.addAsWebResource(new StringAsset("Version2"), "page.html"); cliTestAnotherWar = new File(tempDir + File.separator + war.getName()); new ZipExporterImpl(war).exportTo(cliTestAnotherWar, true); // deployment4 war = ShrinkWrap.create(WebArchive.class, "cli-test-app3.war"); war.addAsWebResource(new StringAsset("Version3"), "page.html"); final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "cli-test-app.ear"); ear.add(war, new BasicPath("/"), ZipExporter.class); cliTestAppEar = new File(tempDir + File.separator + ear.getName()); new ZipExporterImpl(ear).exportTo(cliTestAppEar, true); final Iterator<String> sgI = CLITestSuite.serverGroups.keySet().iterator(); if (!sgI.hasNext()) { fail("Server groups aren't available."); } sgOne = sgI.next(); if (!sgI.hasNext()) { fail("Second server groups isn't available."); } sgTwo = sgI.next(); }