當前位置: 首頁>>代碼示例>>Java>>正文


Java Archive類代碼示例

本文整理匯總了Java中org.jboss.shrinkwrap.api.Archive的典型用法代碼示例。如果您正苦於以下問題:Java Archive類的具體用法?Java Archive怎麽用?Java Archive使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Archive類屬於org.jboss.shrinkwrap.api包,在下文中一共展示了Archive類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Override
public void process(Archive<?> appArchive, TestClass testClass) {
    if (!(appArchive instanceof WebArchive)) {
        return;
    }
    log.info("Preparing archive: "+appArchive);
    WebArchive war = WebArchive.class.cast(appArchive);
    // Add WEB-INF resources
    String[] webInfRes = getWebInfResources();
    for(String resName : webInfRes) {
        war.addAsWebInfResource(resName);
    }

    // Add WEB-INF/lib libraries
    String[] artifactNames = getWebInfLibArtifacts();
    // TODO; use shrinkwrap resolvers
    for (String mvnArtifact: artifactNames) {
        // Resolve this artifact...
    }
}
 
開發者ID:eclipse,項目名稱:microprofile-jwt-auth,代碼行數:21,代碼來源:BaseWarArchiveProcessor.java

示例2: createTestArchive2

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name= APP_NAME, order = 2, testable = false)
public static Archive<?> createTestArchive2() throws IOException {
    File[] files = Maven.resolver().loadPomFromFile("pom.xml")
                .importRuntimeDependencies().resolve().withTransitivity().asFile();

    return ShrinkWrap.create(WebArchive.class,  "app-jsp.war")
            .addPackages(true, Filters.exclude(".*Test.*"), Controller.class.getPackage())
            .addAsLibraries(files)
            .addAsWebResource(new File(WEBAPP_SRC, "index.jsp"))
            .addAsWebResource(new File(WEBAPP_SRC, "protected.jsp"))
            .addAsWebResource(new File(WEBAPP_SRC, "styles.css"))
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new StringAsset(createClient(ClientBuilder.create(APP_NAME)
                    .rootUrl(ROOT_URL)
                    .accessType(PUBLIC))), "keycloak.json")
            .setWebXML(new File("src/main/webapp", "WEB-INF/web.xml"));
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:18,代碼來源:ArquillianJeeJspTest.java

示例3: createTestArchive

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment
public static Archive<?> createTestArchive() {
	return new ModuleMemberRegistrationDeployment
			.Builder( RedisModuleMemberRegistrationWithTTLConfiguredIT.class )
			.addClasses( PhoneNumber.class, PhoneNumberService.class )
			.persistenceXml( persistenceXml() )
			//We add the private module 'org.hibernate.ogm.redis.driver' as well as the test needs to verify properties on the connection:
			.manifestDependencies(
					"org.hibernate.ogm:${hibernate-ogm.module.slot} services, org.hibernate.ogm.redis:${hibernate-ogm.module.slot} services, org.hibernate.ogm.redis.driver:${hibernate-ogm.module.slot} services"
			)
			.createDeployment();
}
 
開發者ID:hibernate,項目名稱:hibernate-ogm-redis,代碼行數:13,代碼來源:RedisModuleMemberRegistrationWithTTLConfiguredIT.java

示例4: createTestArchive

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment
public static Archive<?> createTestArchive() {
	return new ModuleMemberRegistrationDeployment
			.Builder( RedisModuleMemberRegistrationIT.class )
			.addClasses( PhoneNumber.class, PhoneNumberService.class )
			.persistenceXml( persistenceXml() )
			.manifestDependencies(
					"org.hibernate.ogm:${hibernate-ogm.module.slot} services, org.hibernate.ogm.redis:${hibernate-ogm.module.slot} services"
			)
			.createDeployment();
}
 
開發者ID:hibernate,項目名稱:hibernate-ogm-redis,代碼行數:12,代碼來源:RedisModuleMemberRegistrationIT.java

示例5: createDeployment

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
/**
 * Create war archive to test.
 *
 * @return the war used for testing
 */
public static Archive<?> createDeployment() {
    return ShrinkWrap.create(WebArchive.class)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsServiceProvider(Extension.class, LauncherExtension.class)
            .addPackages(true,
                         HttpEndpoints.class.getPackage(),
                         ForgeInitializer.class.getPackage())
            .addAsLibraries(Maven.resolver()
                                    .loadPomFromFile("pom.xml")
                                    .importCompileAndRuntimeDependencies()
                                    .resolve().withTransitivity().asFile());
}
 
開發者ID:fabric8-launcher,項目名稱:launcher-backend,代碼行數:18,代碼來源:Deployments.java

示例6: createDeployment

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
private static Archive<?> createDeployment() {
	WebArchive war = create(WebArchive.class, "singleton.war");
	war.addPackage(HAService.class.getPackage());
	war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
	war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader"), // See
																									// org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
			new ServerPermission("useServiceRegistry"), // See
														// org.jboss.as.server.deployment.service.SecuredServiceRegistry
			new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
	war.addAsServiceProvider(ServiceActivator.class, HAServiceActivator.class);
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:SingletonServiceTestCase.java

示例7: createDeployment

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
private static Archive<?> createDeployment() {
	WebArchive war = create(WebArchive.class, "singleton.war");
	war.addPackage(HAService.class.getPackage());
	war.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.server\n"));
	war.addAsServiceProvider(ServiceActivator.class, HAServicePolicyActivator.class);
	war.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader"), // See
																									// org.jboss.as.server.deployment.service.ServiceActivatorProcessor#deploy()
			new ServerPermission("useServiceRegistry"), // See
														// org.jboss.as.server.deployment.service.SecuredServiceRegistry
			new ServerPermission("getCurrentServiceContainer")), "permissions.xml");
	return war;
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Java-EE-Development-with-WildFly,代碼行數:13,代碼來源:SingletonPolicyServiceTestCase.java

示例8: createDeployment

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(testable = false)
public static Archive<?> createDeployment() throws Exception {
    WARArchive deployment = ShrinkWrap.create(WARArchive.class);
    deployment.addPackage("pro.taskana");
    deployment.addClass(TaskanaProducers.class);
    deployment.addAllDependencies();
    deployment.addDependency("org.mybatis:mybatis:3.4.2");
    deployment.addDependency("org.mybatis:mybatis-cdi:1.0.0");
    deployment.addDependency("pro.taskana:taskana-core:0.0.5-SNAPSHOT");
    deployment.addAsResource("META-INF/beans.xml");
    deployment.addAsResource("taskana.properties");
    deployment.addAsResource("project-defaults.yml");
    return deployment;
}
 
開發者ID:Taskana,項目名稱:taskana,代碼行數:15,代碼來源:TaskanaProducersTest.java

示例9: createTestArchive1

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name = APP_SERVICE, order = 1, testable = false)
public static Archive<?> createTestArchive1() throws IOException {
    return ShrinkWrap.createFromZipFile(WebArchive.class,
            new File("../service-jee-jaxrs/target/service.war"))
            .addAsWebInfResource(
                    new StringAsset(createClient(
                            ClientBuilder.create(APP_SERVICE).accessType(BEARER_ONLY))), "keycloak.json");
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:9,代碼來源:ArquillianProfileJeeVanillaTest.java

示例10: createTestArchive2

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name = APP_NAME, order = 2, testable = false)
public static Archive<?> createTestArchive2() throws IOException {
    return ShrinkWrap.create(WebArchive.class, "vanilla.war")
            .addPackages(true, Filters.exclude(".*Test.*"), Controller.class.getPackage())
            .addAsWebResource(new File(WEBAPP_SRC, "index.jsp"))
            .addAsWebResource(new File(WEBAPP_SRC, "profile.jsp"))
            .addAsWebResource(new File(WEBAPP_SRC, "styles.css"))
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .setWebXML(new File("src/main/webapp", "WEB-INF/web.xml"));
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:11,代碼來源:ArquillianProfileJeeVanillaTest.java

示例11: createTestArchive1

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name= APP_SERVICE, order = 1, testable = false)
public static Archive<?> createTestArchive1() throws IOException {
    return ShrinkWrap.createFromZipFile(WebArchive.class,
            new File("../service-jee-jaxrs/target/service.war"))
            .addAsWebInfResource(
                    new StringAsset(createClient(
                            ClientBuilder.create(APP_SERVICE).accessType(BEARER_ONLY))), "keycloak.json");
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:9,代碼來源:ArquillianJeeJspTest.java

示例12: createTestArchive2

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name = APP_NAME, order = 2, testable = false)
public static Archive<?> createTestArchive2() throws IOException {
    return ShrinkWrap.create(WebArchive.class, "app-html5.war")
            .addAsWebResource(new File(WEBAPP_SRC, "app.js"))
            .addAsWebResource(new File(WEBAPP_SRC, "index.html"))
            .addAsWebResource(new File(WEBAPP_SRC, "keycloak.js"))
            .addAsWebResource(new File(WEBAPP_SRC, "styles.css"))
            .addAsWebResource(new StringAsset(createClient(ClientBuilder.create(APP_NAME)
                    .rootUrl(ROOT_URL)
                    .accessType(PUBLIC))), "keycloak.json");
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:12,代碼來源:ArquillianJeeHtml5Test.java

示例13: createTestArchive

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(testable = false)
public static Archive<?> createTestArchive() throws IOException {
    return ShrinkWrap.create(WebArchive.class, "test-demo.war")
            .addPackages(true, Filters.exclude(".*Test.*"), Application.class.getPackage())
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsWebInfResource(new StringAsset(createClient(ClientBuilder.create("test-demo")
                            .baseUrl(TestsHelper.baseUrl).accessType(BEARER_ONLY))), "keycloak.json")
            .setWebXML(new File("src/main/webapp", "WEB-INF/web.xml"));

}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:11,代碼來源:ArquillianServiceJeeJaxrsTest.java

示例14: deployment

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment
public static Archive deployment() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "emptyValues.jar")
            .addClasses(EmptyValuesTest.class, EmptyValuesBean.class)
            .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml")
            .addAsManifestResource(EMPTY_STRING_ASSET, "javaconfig.properties");

    return ShrinkWrap.create(WebArchive.class)
            .addAsLibrary(jar)
            .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
 
開發者ID:eclipse,項目名稱:ConfigJSR,代碼行數:12,代碼來源:EmptyValuesTest.java

示例15: createTestArchive2

import org.jboss.shrinkwrap.api.Archive; //導入依賴的package包/類
@Deployment(name = APP_NAME, order = 2, testable = false)
public static Archive<?> createTestArchive2() throws IOException {
    return ShrinkWrap.create(WebArchive.class, "app-profile-html5.war")
            .addAsWebResource(new File(WEBAPP_SRC, "app.js"))
            .addAsWebResource(new File(WEBAPP_SRC, "index.html"))
            .addAsWebResource(new File(WEBAPP_SRC, "keycloak.js"))
            .addAsWebResource(new File(WEBAPP_SRC, "styles.css"))
            .addAsWebResource(new StringAsset(createClient(ClientBuilder.create(APP_NAME)
                    .rootUrl(ROOT_URL)
                    .accessType(PUBLIC))), "keycloak.json");
}
 
開發者ID:nmajorov,項目名稱:keycloak_training,代碼行數:12,代碼來源:ArquillianProfileJeeHtml5Test.java


注:本文中的org.jboss.shrinkwrap.api.Archive類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。