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

Java JARArchive类代码示例

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

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



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

示例1: doAdvertise

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
protected TopologyArchive doAdvertise() {
    if (!as(ServiceActivatorArchive.class).containsServiceActivator(SERVICE_ACTIVATOR_CLASS_NAME)) {
        as(ServiceActivatorArchive.class).addServiceActivator(SERVICE_ACTIVATOR_CLASS_NAME);
        as(JARArchive.class).addModule("org.wildfly.swarm.topology", "runtime");
    }

    StringBuffer buf = new StringBuffer();

    List<String> names = getServiceNames();
    for (String name : names) {
        buf.append(name).append("\n");
    }

    as(JARArchive.class).add(new StringAsset(buf.toString()), REGISTRATION_CONF);
    return this;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-topology,代码行数:17,代码来源:TopologyArchiveImpl.java


示例2: testDeploymentFailure

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testDeploymentFailure() throws Exception {
    Swarm swarm = new Swarm();
    swarm.start();
    JARArchive a = ShrinkWrap.create(JARArchive.class, "bad-deployment.jar");
    a.addModule("com.i.do.no.exist");
    try {
        swarm.deploy(a);
        fail("should have throw a DeploymentException");
    } catch (DeploymentException e) {
        // expected and correct
        assertThat(e.getArchive()).isSameAs(a);
        assertThat(e.getMessage()).contains("org.jboss.modules.ModuleNotFoundException: com.i.do.no.exist");
    } finally {
        swarm.stop();
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:18,代码来源:DeploymentFailureTest.java


示例3: testFractionMatching

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatching() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addClass(MyTopicMDB.class);
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);

    analyzer.source(out);
    assertThat(analyzer.detectNeededFractions()
                       .stream()
                       .filter(fd -> fd.getArtifactId().equals("messaging"))
                       .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:MessagingTest.java


示例4: testFractionMatchingWebXML

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatchingWebXML() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("WEB-INF/web.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("security"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:SecurityTest.java


示例5: testFractionMatchingAnnotation

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatchingAnnotation() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addClass(SecurityEndpoint.class);
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("security"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:SecurityTest.java


示例6: testFractionMatching

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatching() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("META-INF/persistence.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);

    analyzer.source(out);
    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("jpa"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:JPATest.java


示例7: testFractionMatching

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatching() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("WEB-INF/faces-config.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("jsf"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:JsfIT.java


示例8: testFractionMatching

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatching() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("WEB-INF/beans.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("cdi"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:CDITest.java


示例9: testFractionMatchingWEBINFClasses

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatchingWEBINFClasses() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("WEB-INF/classes/META-INF/beans.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("cdi"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:CDITest.java


示例10: testFractionMatchingMETAINF

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testFractionMatchingMETAINF() throws Exception {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("META-INF/beans.xml");
    FractionUsageAnalyzer analyzer = new FractionUsageAnalyzer();

    final File out = Files.createTempFile(archive.getName(), ".war").toFile();
    out.deleteOnExit();
    archive.as(ZipExporter.class).exportTo(out, true);
    analyzer.source(out);

    assertThat(analyzer.detectNeededFractions()
                   .stream()
                   .filter(fd -> fd.getArtifactId().equals("cdi"))
                   .count()).isEqualTo(1);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:17,代码来源:CDITest.java


示例11: customize

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Override
public void customize() throws ModuleLoadException, IOException {

    if (!this.keycloakServer.subresources().themes().isEmpty()) {
        return;
    }

    Module module = Module.getBootModuleLoader().loadModule("org.keycloak.keycloak-themes");
    URL resource = module.getExportedResource("keycloak-themes.jar");

    JARArchive themesArtifact = ShrinkWrap.create(JARArchive.class);
    themesArtifact.as(ZipImporter.class).importFrom(resource.openStream());

    File root = TempFileManager.INSTANCE.newTempDirectory("keycloak-themes", ".d");
    File exportedDir = themesArtifact.as(ExplodedExporter.class).exportExplodedInto(root);
    File themeDir = new File(exportedDir, "theme");

    this.keycloakServer.theme("defaults", (theme) -> {
        theme.dir(themeDir.getAbsolutePath());
        theme.staticmaxage(2592000L);
        theme.cachethemes(true);
        theme.cachetemplates(true);
    });

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:26,代码来源:KeycloakThemesCustomizer.java


示例12: testAdvertiseMultiple

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testAdvertiseMultiple() {
    JARArchive archive = ShrinkWrap.create(JARArchive.class, "myapp.war");
    archive.as(RibbonArchive.class)
            .advertise("service-a")
            .advertise("service-b")
            .advertise("service-c");

    Asset asset = archive.get(RibbonArchive.REGISTRATION_CONF).getAsset();

    assertThat(asset).isNotNull();
    assertThat(asset).isInstanceOf(StringAsset.class);

    String[] services = ((StringAsset) asset).getSource().split("\n");

    assertThat(services).contains("service-a");
    assertThat(services).contains("service-b");
    assertThat(services).contains("service-c");

    assertThat(archive.as(ServiceActivatorArchive.class).containsServiceActivator(RibbonArchiveImpl.SERVICE_ACTIVATOR_CLASS_NAME)).isTrue();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:22,代码来源:RibbonArchiveTest.java


示例13: getKeycloakJson

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
private InputStream getKeycloakJson() {
    InputStream keycloakJson = Thread.currentThread().getContextClassLoader().getResourceAsStream("keycloak.json");
    if (keycloakJson == null) {

        String appArtifact = System.getProperty(BootstrapProperties.APP_ARTIFACT);

        if (appArtifact != null) {
            try (InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream("_bootstrap/" + appArtifact)) {
                Archive tmpArchive = ShrinkWrap.create(JARArchive.class);
                tmpArchive.as(ZipImporter.class).importFrom(in);
                Node jsonNode = tmpArchive.get("keycloak.json");
                if (jsonNode == null) {
                    jsonNode = tmpArchive.get("WEB-INF/keycloak.json");
                }

                if (jsonNode != null && jsonNode.getAsset() != null) {
                    keycloakJson = jsonNode.getAsset().openStream();
                }
            } catch (IOException e) {
                // ignore
            }
        }
    }
    return keycloakJson;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:26,代码来源:SecuredArchivePreparer.java


示例14: process

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
public void process() {
    if (archive.get("META-INF/arquillian-testable") == null) {
        return;
    }

    archive.add(new StringAsset(archive.getName()), "META-INF/arquillian-testable");

    archive.as(JARArchive.class)
            .addModule("org.wildfly.swarm.arquillian.adapter");

    archive.as(JARArchive.class)
            .addModule("org.wildfly.swarm.arquillian", "deployment");

    archive.as(ServiceActivatorArchive.class)
            .addServiceActivator("org.wildfly.swarm.arquillian.deployment.TestableArchiveServiceActivator");

}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:18,代码来源:ArquillianArchivePreparer.java


示例15: createDeployment

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    deployment.addClass(VertxProvider.class);
    deployment.addModule("io.vertx.jca", "api");
    return deployment;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-vertx,代码行数:9,代码来源:VertxArquillianTest.java


示例16: deployment

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Deployment
public static JARArchive deployment() {
    JARArchive archive = ShrinkWrap.create(JARArchive.class);
    archive.addAsResource("spring/simple-camel-context.xml");
    archive.addClasses(RouteBuilderA.class);
    return archive;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-camel,代码行数:8,代码来源:SimpleCoreTransformTest.java


示例17: deployment

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Deployment
public static JARArchive deployment() {
    JARArchive archive = ShrinkWrap.create(JARArchive.class, "camel-cdi-tests.jar");
    archive.addPackage(RoutesContextA.class.getPackage());
    archive.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    return archive;
}
 
开发者ID:wildfly-swarm-archive,项目名称:wildfly-swarm-camel,代码行数:8,代码来源:CDIIntegrationTest.java


示例18: createDeployment

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    deployment.addModule( "org.wildfly.swarm.messaging" );
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:SimplifiedRemoteMessagingArquillianTest.java


示例19: testDeploymentSuccess

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Test
public void testDeploymentSuccess() throws Exception {
    Swarm swarm = new Swarm();
    swarm.start();
    JARArchive a = ShrinkWrap.create(JARArchive.class, "good-deployment.jar");
    a.add(EmptyAsset.INSTANCE, "nothing.xml");
    swarm.deploy(a);
    swarm.stop();
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:10,代码来源:DeploymentSuccessTest.java


示例20: createDeployment

import org.wildfly.swarm.spi.api.JARArchive; //导入依赖的package包/类
@Deployment
public static Archive createDeployment() {
    JARArchive deployment = ShrinkWrap.create(JARArchive.class);
    deployment.add(EmptyAsset.INSTANCE, "nothing");
    deployment.addPackage(Assertions.class.getPackage());
    return deployment;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:8,代码来源:MailArquillianTest.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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