本文整理汇总了Java中org.jboss.shrinkwrap.api.spec.EnterpriseArchive.addAsModule方法的典型用法代码示例。如果您正苦于以下问题:Java EnterpriseArchive.addAsModule方法的具体用法?Java EnterpriseArchive.addAsModule怎么用?Java EnterpriseArchive.addAsModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.shrinkwrap.api.spec.EnterpriseArchive
的用法示例。
在下文中一共展示了EnterpriseArchive.addAsModule方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAppclientDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(name = DEP_APPCLIENT_EAR, order = 2, testable = false, managed = false)
public static EnterpriseArchive createAppclientDeployment() {
JavaArchive jarArchive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-webserviceref-appclient.jar");
jarArchive
.setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ "main-class: org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne\n"))
.addClass(org.jboss.test.ws.jaxws.samples.webserviceref.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointClientOne.class)
.addClass(org.jboss.test.ws.jaxws.samples.webserviceref.EndpointService.class)
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/application-client.xml"), "application-client.xml")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/jboss-client.xml"), "jboss-client.xml")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webserviceref/META-INF/wsdl/MultipleEndpoint.wsdl"), "wsdl/MultipleEndpoint.wsdl");
EnterpriseArchive earArchive = ShrinkWrap.create(EnterpriseArchive.class, DEP_APPCLIENT_EAR + ".ear");
earArchive.addAsModule(jarArchive);
JBossWSTestHelper.writeToFile(earArchive);
fullAppclientDepName = earArchive.getName() + "#" + jarArchive.getName();
return earArchive;
}
示例2: createAppclientDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(name = APPCLIENT_DEPLOYMENT, order = 2, testable = false, managed = false)
public static EnterpriseArchive createAppclientDeployment() {
JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-serviceref-appclient.jar");
archive1
.setManifest(
new StringAsset("Manifest-Version: 1.0\n"
+ "main-class: org.jboss.test.ws.jaxws.samples.serviceref.ApplicationClient\n"))
.addClass(org.jboss.test.ws.jaxws.samples.serviceref.ApplicationClient.class)
.addClass(org.jboss.test.ws.jaxws.samples.serviceref.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.samples.serviceref.EndpointService.class)
.addAsManifestResource(
new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/samples/serviceref/META-INF/application-client.xml"), "application-client.xml")
.addAsManifestResource(
new File(JBossWSTestHelper.getTestResourcesDir()
+ "/jaxws/samples/serviceref/META-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl");
EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, APPCLIENT_DEPLOYMENT + ".ear");
archive.addAsModule(archive1);
JBossWSTestHelper.writeToFile(archive);
fullAppclientDepName = archive.getName() + "#" + archive1.getName();
return archive;
}
示例3: deployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment
public static EnterpriseArchive deployment() {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear");
DefaultDeployment.addDependencies(ear, "org.jeeventstore:jeeventstore-persistence-jpa", false);
ear.addAsModule(ShrinkWrap.create(JavaArchive.class, "ejb.jar")
.addAsManifestResource(new File("src/test/resources/META-INF/beans.xml"))
.addAsManifestResource(new File("src/test/resources/META-INF/persistence.xml"))
.addAsManifestResource(new File(
"src/test/resources/META-INF/ejb-jar-EventStorePersistenceJPATest.xml"),
"ejb-jar.xml")
.addClass(XMLSerializer.class)
.addClass(TestUTF8Utils.class)
.addClass(PersistenceTestHelper.class)
.addPackage(AbstractPersistenceTest.class.getPackage())
.addPackage(EventStorePersistenceJPA.class.getPackage())
);
return ear;
}
示例4: createEJBDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment
public static EnterpriseArchive createEJBDeployment() {
final EnterpriseArchive ear = create(EnterpriseArchive.class, "remoting-remote-naming-test.ear");
final JavaArchive jar = create(JavaArchive.class, "remoting-remote-naming-test.jar");
jar.addPackage(Machine.class.getPackage());
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/ejb-jar-remoting.xml")),
"ejb-jar.xml");
ear.addAsModule(jar);
return ear;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:11,代码来源:RemotingNamingTestCase.java
示例5: createEnterpriseDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment
public static EnterpriseArchive createEnterpriseDeployment() {
final EnterpriseArchive ear = create(EnterpriseArchive.class, "sendmail.ear");
final JavaArchive jar = create(JavaArchive.class, "sendmail.jar");
File[] files = resolver().loadPomFromFile("pom.xml").importRuntimeDependencies()
.resolve("org.subethamail:subethasmtp:3.1.7").withTransitivity().asFile();
jar.addPackage(SendMail.class.getPackage());
ear.addAsModule(jar);
ear.addAsLibraries(files);
return ear;
}
开发者ID:PacktPublishing,项目名称:Mastering-Java-EE-Development-with-WildFly,代码行数:12,代码来源:SendMailTestCase.java
示例6: createEJBDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment
public static EnterpriseArchive createEJBDeployment() {
final EnterpriseArchive ear = create(EnterpriseArchive.class, "xml-test.ear");
final JavaArchive jar = create(JavaArchive.class, "xml-test.jar");
jar.addPackage(XMLRemote.class.getPackage());
jar.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/ejb-jar.xml")), "ejb-jar.xml");
ear.addAsModule(jar);
return ear;
}
示例7: selectTestableWAR
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
"server.socket.impl.war");
enterpriseArchive.delete("server.socket.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
}
开发者ID:PureSolTechnologies,项目名称:Purifinity,代码行数:9,代码来源:AbstractPurifinityServerWebsocketClientTest.java
示例8: selectTestableWAR
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
"server.rest.impl.war");
enterpriseArchive.delete("server.rest.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
}
示例9: removeNotNeededWARFiles
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
public static void removeNotNeededWARFiles(
EnterpriseArchive enterpriseArchive) throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
"server.rest.impl.war");
enterpriseArchive.delete("server.rest.impl.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
}
示例10: selectTestableWAR
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@EnhanceDeployment
public static void selectTestableWAR(EnterpriseArchive enterpriseArchive)
throws Exception {
WebArchive testableWar = enterpriseArchive.getAsType(WebArchive.class,
"server.ui.war");
enterpriseArchive.delete("server.ui.war");
enterpriseArchive.addAsModule(Testable.archiveToTest(testableWar));
}
示例11: createEnterpriseArchive
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
* Tried to use to fix missing interface classes issues.
* But we need to test both EAR deployment (all inside) and
* separate RAR and EAR/SAR.
* @return
*/
@Deployment(name="EAR", testable = true, order = 2)
public static EnterpriseArchive createEnterpriseArchive() {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, deploymentName + "_EAR.ear");
ear.addAsModule(createEjb());
//ear.addAsModule(createClient());
ear.addAsLibrary(createConnectorClient());
//ear.addAsManifestResource(, "jboss-deployment-structure.xml");
return ear;
}
示例12: createEnterpriseArchive
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
* Tried to use to fix missing interface classes issues.
* But we need to test both EAR deployment (all inside) and
* separate RAR and EAR/SAR.
* @return
*/
@Deployment(name="EAR", testable = true, order = 1)
public static EnterpriseArchive createEnterpriseArchive() {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, deploymentName + "_EAR.ear");
ear.addAsModule(createConnector());
ear.addAsModule(createEjb());
//ear.addAsManifestResource(, "jboss-deployment-structure.xml");
return ear;
}
示例13: deployWarInsideEar
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
@Deployment(order = 4, name = "war-inside-ear")
public static Archive<?> deployWarInsideEar() throws Exception {
WebArchive warLib = ShrinkWrap.create(WebArchive.class, "bootstrap.war");
warLib.addClasses(DatabaseBootstrapWarTester.class);
warLib.addClasses(HibernateTestUtil.class);
warLib.addClasses(BootstrapDatabaseITCase.class);
warLib.addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml");
warLib.addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("classes/META-INF/beans.xml"));
warLib.addAsWebInfResource(new StringAsset(hibernate_cfg_xml), "classes/META-INF/hibernate.cfg.xml");
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + "-war-inside-ear.ear");
ear.addAsManifestResource(new StringAsset(generateEarDeploymentStructure("bootstrap.war")), "jboss-deployment-structure.xml");
ear.addAsModule(warLib);
return ear;
}
示例14: addMainModule
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
/**
* Dodaje główny moduł do archiwum EAR.
*
* @param ear archiwum EAR
* @param type typ głównego modułu
* @param module główny moduł
* @param descriptorBuilder deskreptor builder dla EAR'a
*/
private static void addMainModule(EnterpriseArchive ear, ModuleType type, Archive<?> module, EarDescriptorBuilder descriptorBuilder) {
if (type.isModule()) {
ear.addAsModule(module);
if (type == ModuleType.EJB) {
descriptorBuilder.addEjb(module.getName());
}
if (type == ModuleType.WAR) {
descriptorBuilder.addWeb(module.getName());
}
} else {
ear.addAsLibrary(module);
}
}
示例15: toEarDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入方法依赖的package包/类
protected static EnterpriseArchive toEarDeployment(WebArchive... wars) {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "gae-tck.ear");
for (WebArchive war : wars) {
war.addClass(ModulesTestBase.class);
ear.addAsModule(war);
}
return ear;
}