• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ZipExporterImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl的典型用法代码示例。如果您正苦于以下问题:Java ZipExporterImpl类的具体用法?Java ZipExporterImpl怎么用?Java ZipExporterImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ZipExporterImpl类属于org.jboss.shrinkwrap.impl.base.exporter.zip包,在下文中一共展示了ZipExporterImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createShrinkWrapDomain

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
private void createShrinkWrapDomain() {
    ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
    try {
        if (isFatJar()) {
            Module appModule = Module.getBootModuleLoader().loadModule(APPLICATION_MODULE_NAME);
            Thread.currentThread().setContextClassLoader(appModule.getClassLoader());
        }
        Domain domain = ShrinkWrap.getDefaultDomain();
        domain.getConfiguration().getExtensionLoader().addOverride(ZipExporter.class, ZipExporterImpl.class);
        domain.getConfiguration().getExtensionLoader().addOverride(ZipImporter.class, ZipImporterImpl.class);
        domain.getConfiguration().getExtensionLoader().addOverride(ExplodedExporter.class, ExplodedExporterImpl.class);
        domain.getConfiguration().getExtensionLoader().addOverride(ExplodedImporter.class, ExplodedImporterImpl.class);
        domain.getConfiguration().getExtensionLoader().addOverride(JavaArchive.class, JavaArchiveImpl.class);
        domain.getConfiguration().getExtensionLoader().addOverride(WebArchive.class, WebArchiveImpl.class);
    } catch (Exception e) {
        SwarmMessages.MESSAGES.shrinkwrapDomainSetupFailed(e);
    } finally {
        Thread.currentThread().setContextClassLoader(originalCl);
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:21,代码来源:Swarm.java


示例2: createDeployment

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    File[] libs = Maven.configureResolver().fromFile(shrinkwrapMavenSettings).loadPomFromFile("pom.xml")
            .resolve("org.hawkular.commons:hawkular-rest-status", "com.squareup.okhttp3:okhttp")
            .withTransitivity().asFile();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, StatusEndpointITest.class.getSimpleName() + ".war")
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/jboss-web.xml"),
                    "jboss-web.xml")
            .addAsWebInfResource(
                    StatusEndpointITest.class.getResource("/rest-status/web.xml"),
                    "web.xml")
            .addAsManifestResource(
                    StatusEndpointITest.class.getResource("/rest-status/MANIFEST.MF"),
                    "MANIFEST.MF")
            .addPackage(StatusEndpointITest.class.getPackage())
            .addAsLibraries(libs);
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", StatusEndpointITest.class.getSimpleName() + ".war"));
    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:26,代码来源:StatusEndpointITest.java


示例3: createShrinkWrapDomain

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
private void createShrinkWrapDomain() throws ModuleLoadException {
    ClassLoader originalCl = Thread.currentThread().getContextClassLoader();
    try {
        if (isFatJar()) {
            Thread.currentThread().setContextClassLoader(Container.class.getClassLoader());
            Module appModule = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("swarm.application"));
            Thread.currentThread().setContextClassLoader(appModule.getClassLoader());
        }
        this.domain = ShrinkWrap.getDefaultDomain();
        this.domain.getConfiguration().getExtensionLoader().addOverride(ZipExporter.class, ZipExporterImpl.class);
        this.domain.getConfiguration().getExtensionLoader().addOverride(JavaArchive.class, JavaArchiveImpl.class);
        this.domain.getConfiguration().getExtensionLoader().addOverride(WebArchive.class, WebArchiveImpl.class);
    } catch (IOException e) {
        e.printStackTrace();
    } finally {
        Thread.currentThread().setContextClassLoader(originalCl);
    }
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:19,代码来源:Container.java


示例4: beforeClass

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "Dummy.jar");
    jar.addClass(ModuleTestCase.class);
    jarFile = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "Dummy.jar");
    jarFile2 = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "Dummy2.jar");
    new ZipExporterImpl(jar).exportTo(jarFile, true);
    new ZipExporterImpl(jar).exportTo(jarFile2, true);

    // Create an empty directory
    customModulesDirectory = new File(TestSuiteEnvironment.getTmpDir(),
            System.currentTimeMillis() + "-mymodules");
    customModulesDirectory.mkdir();

    AbstractCliTestBase.initCLI();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:ModuleTestCase.java


示例5: redeploy

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
private void redeploy(String cmd, boolean enabled) throws Exception {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "cli-test-app1-deploy.war");
    war.addAsWebResource(new StringAsset("Version0.1"), "page.html");
    cliTestApp1War.delete();
    new ZipExporterImpl(war).exportTo(cliTestApp1War, true);
    {
        ctx.handle(cmd + " " + cliTestApp1War.getAbsolutePath());
        checkDeployment(cliTestApp1War.getName(), enabled);
    }
    String op;
    if(enabled) {
        op = "undeploy";
    } else {
        op = "deploy";
    }
    ctx.handle("/deployment=" + cliTestApp1War.getName() + ':'+op+"()");
    assertEquals(!enabled, readDeploymentStatus(cliTestApp1War.getName()));
    war = ShrinkWrap.create(WebArchive.class, "cli-test-app1-deploy.war");
    war.addAsWebResource(new StringAsset("Version0.2"), "page.html");
    cliTestApp1War.delete();
    new ZipExporterImpl(war).exportTo(cliTestApp1War, true);
    {
        ctx.handle(cmd + " " + cliTestApp1War.getAbsolutePath());
        checkDeployment(cliTestApp1War.getName(), !enabled);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:DeployTestCase.java


示例6: beforeClass

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() throws Exception {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "a.jar");
    jar.addClass(A.class);
    jarA = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "a.jar");
    new ZipExporterImpl(jar).exportTo(jarA, true);
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    IoUtils.copyStreamAndClose(new FileInputStream(jarA), bytes);
    jarABytes = bytes.toByteArray();

    jar = ShrinkWrap.create(JavaArchive.class, "b.jar");
    jar.addClass(B.class);
    jarB = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "b.jar");
    new ZipExporterImpl(jar).exportTo(jarB, true);
    bytes = new ByteArrayOutputStream();
    IoUtils.copyStreamAndClose(new FileInputStream(jarB), bytes);
    jarBBytes = bytes.toByteArray();

    jar = ShrinkWrap.create(JavaArchive.class, "c.jar");
    jar.addClass(C.class);
    jarC = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "c.jar");
    new ZipExporterImpl(jar).exportTo(jarC, true);
    bytes = new ByteArrayOutputStream();
    IoUtils.copyStreamAndClose(new FileInputStream(jarC), bytes);
    jarCBytes = bytes.toByteArray();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:CPRollingbackOneOffTestCase.java


示例7: before

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void before() throws Exception {

    testSupport = CLITestSuite.createSupport(UndeployTestCase.class.getSimpleName());

    String tempDir = System.getProperty("java.io.tmpdir");

    // deployment1
    WebArchive war = ShrinkWrap.create(WebArchive.class, "cli-undeploy-test-app1.war");
    war.addAsWebResource(new StringAsset("Version0"), "page.html");
    cliTestApp1War = new File(tempDir + File.separator + war.getName());
    new ZipExporterImpl(war).exportTo(cliTestApp1War, 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();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:UndeployTestCase.java


示例8: assembleDeployAndStartServer

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
    public static void assembleDeployAndStartServer() throws Exception {
        webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
                .addClasses(RestfulBookAsyncService.class,
                        AddExtraUserAgentFilter.class  )
                .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
//                .addAsResource(
//                    new File("src/main/resources/META-INF/services/javax.validation.spi.ValidationProvider"),
//                    "META-INF/services/javax.validation.spi.ValidationProvider" )
                .addAsWebInfResource(
                        EmptyAsset.INSTANCE, "beans.xml");

        System.out.println(webArchive.toString(true));

        File warFile = new File(webArchive.getName());
        new ZipExporterImpl(webArchive).exportTo(warFile, true);
        runner = SimpleEmbeddedRunner.launchDeployWarFile(
                    warFile, "mywebapp", 8080);
    }
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:20,代码来源:RestfulBookAsyncServiceClientTest.java


示例9: assembleDeployAndStartServer

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
    public static void assembleDeployAndStartServer() throws Exception {
        webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
            .addClasses(RestfulBookServiceWithHypermedia.class,
                    SimpleServlet.class)
            .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
            .addAsWebInfResource(
                    EmptyAsset.INSTANCE, "beans.xml");

//        System.out.println(webArchive.toString(true));

        File warFile = new File(webArchive.getName());
        new ZipExporterImpl(webArchive).exportTo(warFile, true);
        runner = SimpleEmbeddedRunner.launchDeployWarFile(
                warFile, "mywebapp", 8080);
    }
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:17,代码来源:RestfulBookServiceWithHypermediaTest.java


示例10: beforeAllTests

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void beforeAllTests() throws Exception {
    WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "testusers.war")
        .addClasses(RegisteredUserResource.class, User.class,
            UserRegistry.class )
        .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
        .addAsWebInfResource(
           EmptyAsset.INSTANCE, "beans.xml");

    System.out.println(webArchive.toString(true));

    File warFile = new File(webArchive.getName());
    new ZipExporterImpl(webArchive).exportTo(warFile, true);
    runner = SimpleEmbeddedRunner.launchDeployWarFile(
        warFile, "mywebapp", 8080);
}
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:17,代码来源:RegisteredUserResourceTest.java


示例11: createDeployment

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(BusTest.class.getResource("/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addPackage(BusTest.class.getPackage());
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", "test-archive.war"));

    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-bus,代码行数:13,代码来源:BusTest.java


示例12: createDeployment

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@Deployment
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(BusITest.class.getResource("/bus/jboss-deployment-structure.xml"),
                    "jboss-deployment-structure.xml")
            .addPackage(BusITest.class.getPackage());
    ZipExporter exporter = new ZipExporterImpl(archive);
    exporter.exportTo(new File("target", "test-archive.war"));

    return archive;
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:13,代码来源:BusITest.java


示例13: before

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void before() throws Exception {
    cleanUp();
    cli = new CLIWrapper(true, null, System.in);

    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "Dummy.jar");
    jar.addClass(ModuleTestCase.class);
    jarFile = new File(TestSuiteEnvironment.getTmpDir() + File.separator + "Dummy.jar");
    new ZipExporterImpl(jar).exportTo(jarFile, true);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:11,代码来源:ModuleOpsCompletionTestCase.java


示例14: before

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void before() throws Exception {
    CommandContextConfiguration.Builder configBuilder = new CommandContextConfiguration.Builder();
    configBuilder.setInitConsole(true).setConsoleInput(System.in).setConsoleOutput(System.out).
            setController("remote+http://" + TestSuiteEnvironment.getServerAddress()
                    + ":" + TestSuiteEnvironment.getServerPort());
    ctx = CommandContextFactory.getInstance().newCommandContext(configBuilder.build());
    ctx.connectController();

    String tempDir = System.getProperty("java.io.tmpdir");

    // deployment1
    WebArchive war = ShrinkWrap.create(WebArchive.class, "cli-test-app1-deploy.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-deploy.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-deploy.war");
    war.addAsWebResource(new StringAsset("Version2"), "page.html");
    cliTestAnotherWar = new File(tempDir + File.separator + war.getName());
    new ZipExporterImpl(war).exportTo(cliTestAnotherWar, true);

    ctx.handle("deploy --disabled " + cliTestApp1War.getAbsolutePath());
    ctx.handle("deploy --disabled " + cliTestAnotherWar.getAbsolutePath());
    ctx.handle("deploy --disabled " + cliTestApp2War.getAbsolutePath());

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:35,代码来源:DeployTestCase.java


示例15: testSingleClassFromJar

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@Test
public void testSingleClassFromJar() throws Exception {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "single-class-from-jar-test.jar")
            .addClasses(SingleChildFirst1.class, SingleChildFirst2.class, SingleParentFirst.class);
    String tempDir = System.getProperty("java.io.tmpdir");

    File file = new File(tempDir + File.separator + jar.getName());
    try {
        new ZipExporterImpl(jar).exportTo(file, true);
        URLClassLoader tmp = new ChildFirstClassLoaderBuilder(false)
                .addURL(file.toURI().toURL())
                .build();
        Class<?> scf1 = tmp.loadClass(SingleChildFirst1.class.getName());
        Assert.assertSame(tmp, scf1.getClassLoader());
        Class<?> scf2 = tmp.loadClass(SingleChildFirst2.class.getName());
        Assert.assertSame(tmp, scf2.getClassLoader());

        URLClassLoader loader = new ChildFirstClassLoaderBuilder(false)
                .addSingleChildFirstClass(scf1, scf2)
                .build();
        Assert.assertSame(loader, loader.loadClass(SingleChildFirst1.class.getName()).getClassLoader());
        Assert.assertSame(loader, loader.loadClass(SingleChildFirst2.class.getName()).getClassLoader());
        Assert.assertNotSame(loader, loader.loadClass(SingleParentFirst.class.getName()).getClassLoader());
        loader.close();
    } finally {
        file.delete();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:29,代码来源:ChildFirstClassLoadingTest.java


示例16: shouldAssembleAndRetrieveBookList

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@Test
public void shouldAssembleAndRetrieveBookList() throws Exception {
    WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
            .addClasses(RestfulBookService.class, SimpleServlet.class)
            .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
            .addAsWebInfResource(
                EmptyAsset.INSTANCE, "beans.xml");

    System.out.println(webArchive.toString(true));

    File warFile = new File(webArchive.getName());
    new ZipExporterImpl(webArchive).exportTo(warFile, true);
    SimpleEmbeddedRunner runner =
        SimpleEmbeddedRunner.launchDeployWarFile(
                warFile, "mywebapp", 8080);
    try {
        URL url = new URL(
            "http://localhost:8080/mywebapp/rest/books");
        InputStream inputStream = url.openStream();
        BufferedReader reader = new BufferedReader(
            new InputStreamReader(inputStream));
        List<String> lines = new ArrayList<>();
        String text = null;
        int count=0;
        while ( ( text = reader.readLine()) != null ) {
            lines.add(text);
            ++count;
            System.out.printf("**** OUTPUT **** text[%d] = %s\n", count, text );
        }
        assertFalse( lines.isEmpty() );
        assertEquals("Sherlock Holmes and the Hounds of the Baskerville", lines.get(0));
        assertEquals("Da Vinci Code", lines.get(1));
        assertEquals("Great Expectations", lines.get(2));
        assertEquals( "Treasure Island", lines.get(3) );
    }
    finally {
        runner.stop();
    }
}
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:40,代码来源:RestfulBookServiceTest.java


示例17: assembleDeployAndStartServer

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void assembleDeployAndStartServer() throws Exception {
    webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
            .addClasses(RestfulBookService.class)
            .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
            .addAsWebInfResource(
                    EmptyAsset.INSTANCE, "beans.xml");

    File warFile = new File(webArchive.getName());
    new ZipExporterImpl(webArchive).exportTo(warFile, true);
    runner = SimpleEmbeddedRunner.launchDeployWarFile(
                warFile, "mywebapp", 8080);
}
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:14,代码来源:RestfulBookServiceAsyncClientTest.java


示例18: assembleDeployAndStartServer

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void assembleDeployAndStartServer() throws Exception {
    webArchive = ShrinkWrap.create(WebArchive.class, "asyncjms.war")
            .addClasses(PayloadCheck.class)
            .addAsResource(
                    new File("src/test/resources-glassfish-managed/glassfish-resources.xml"),
                    "glassfish-resources.xml")
            .addAsWebInfResource(
                    "test-persistence.xml",
                    "classes/META-INF/persistence.xml")
            // .setWebXML(new File("src/main/webapp/WEB-INF/web.xml"))
            .addAsWebInfResource(
                    new File("src/test/resources-glassfish-managed/glassfish-resources.xml"),
                    "glassfish-resources.xml")
            .addAsWebInfResource(
                    EmptyAsset.INSTANCE, "beans.xml");

    // Other notes on JMS 2.0
    // http://stackoverflow.com/questions/8412513/how-to-create-a-jms-topic-and-topicconnectionfactory-programatically

    // Where `glassfish-resources.xml' supposed to be installed?
    // https://blogs.oracle.com/JagadishPrasath/entry/application_scoped_resources_in_glassfish
    System.out.println(webArchive.toString(true));

    File warFile = new File(webArchive.getName());
    new ZipExporterImpl(webArchive).exportTo(warFile, true);
    runner = SimpleEmbeddedRunner.launchDeployWarFile(
            warFile, "mywebapp", 8080);
}
 
开发者ID:peterpilgrim,项目名称:javaee7-developer-handbook,代码行数:30,代码来源:AsynchronousJMSMessageTest.java


示例19: build

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
public void build() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "zstack.war");
    war.setWebXML(new File("src/test/resources/webapp/WEB-INF/web.xml"));
    war.addAsWebInfResource(new File("src/test/resources/webapp/WEB-INF/zstack-servlet-context.xml"), "classes/zstack-servlet-context.xml");
    new ZipExporterImpl(war).exportTo(new File(Utils.getPathUtil().join(warExportedToPath, war.getName())), true);
}
 
开发者ID:zstackio,项目名称:zstack,代码行数:7,代码来源:WarBuilder.java


示例20: before

import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl; //导入依赖的package包/类
@BeforeClass
public static void before() throws Exception {

    testSupport = 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();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:44,代码来源:UndeployWildcardDomainTestCase.java



注:本文中的org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Treebank类代码示例发布时间:2022-05-23
下一篇:
Java PathBuilder类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap