use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project camel by apache.
the class JarExporter method exportJar.
@Test
public void exportJar() throws Exception {
Archive<?> archive = ArquillianPackager.springBootPackage(new ITestConfigBuilder().module("camel-cache").resource("components/cache-ehcache.xml", "ehcache.xml").build());
new ZipExporterImpl(archive).exportTo(new File("target/export.zip"), true);
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.
the class ModelPersistenceTestCase method getBrokenWar.
private static File getBrokenWar() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "malformedDeployment.war");
war.addClass(SimpleServlet.class);
war.addAsWebInfResource(new StringAsset("Malformed"), "web.xml");
File brokenWar = new File(System.getProperty("java.io.tmpdir") + File.separator + "malformedDeployment.war");
brokenWar.deleteOnExit();
new ZipExporterImpl(war).exportTo(brokenWar, true);
return brokenWar;
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.
the class DeployAllServerGroupsTestCase method testRedeploy.
public void testRedeploy() throws Exception {
// check we have original deployment
checkURL("/SimpleServlet/page.html", "Version1");
// 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 all servers
assertFalse(cli.sendLine("deploy --all-server-groups " + warFile.getAbsolutePath(), true));
// force redeploy
cli.sendLine("deploy " + warFile.getAbsolutePath() + " --force");
// check that new version is running
checkURL("/SimpleServlet/page.html", "Version2");
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.
the class DomainDeployWithRuntimeNameTestCase method createWarFile.
private File createWarFile(String content) throws IOException {
WebArchive war = ShrinkWrap.create(WebArchive.class, "HelloServlet.war");
war.addClass(SimpleHelloWorldServlet.class);
war.addAsWebInfResource(SimpleHelloWorldServlet.class.getPackage(), "web.xml", "web.xml");
war.addAsWebResource(new StringAsset(content), "page.html");
File tempFile = new File(System.getProperty("java.io.tmpdir"), "HelloServlet.war");
new ZipExporterImpl(war).exportTo(tempFile, true);
return tempFile;
}
use of org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl in project wildfly by wildfly.
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());
}
Aggregations