本文整理汇总了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...
}
}
示例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"));
}
示例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();
}
示例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());
}
示例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;
}
示例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");
}
示例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"));
}
示例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");
}
示例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");
}
示例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"));
}
示例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");
}
示例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");
}