本文整理汇总了Java中org.jboss.shrinkwrap.api.spec.EnterpriseArchive类的典型用法代码示例。如果您正苦于以下问题:Java EnterpriseArchive类的具体用法?Java EnterpriseArchive怎么用?Java EnterpriseArchive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnterpriseArchive类属于org.jboss.shrinkwrap.api.spec包,在下文中一共展示了EnterpriseArchive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive createDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class) //
.addClasses(UserService.class, UserRepository.class, User.class) //
.addClasses(UserRepositoryTest.class, DockerDatabaseTestUtil.class) //
.addAsResource("META-INF/persistence.xml") //
.addAsResource("testdata.xml") //
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
File[] pomDependencies = Maven.resolver() //
.loadPomFromFile("pom.xml").importDependencies(ScopeType.TEST) //
.resolve().withTransitivity().asFile();
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class) //
.addAsModule(war) //
.addAsLibraries(pomDependencies);
return ear;
}
示例2: createDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive createDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class) //
.addClasses(UserService.class, UserRepository.class, User.class) //
.addClasses(UserServiceTest.class, DockerDatabaseTestUtil.class) //
.addAsResource("META-INF/persistence.xml") //
.addAsResource("testdata.xml") //
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
File[] pomDependencies = Maven.resolver() //
.loadPomFromFile("pom.xml").importDependencies(ScopeType.TEST) //
.resolve().withTransitivity().asFile();
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class) //
.addAsModule(war) //
.addAsLibraries(pomDependencies);
return ear;
}
示例3: deploy
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive deploy() throws Exception {
JavaArchive ejbJar = ShrinkWrap
.create(JavaArchive.class, "test-ejb.jar")
.addClass(MyMDB.class)
.addClass(org.jboss.shrinkwrap.descriptor.api.Descriptor.class);
WebArchive war = ShrinkWrap.create(WebArchive.class,"test.war")
.addClass(EarTestCase.class);
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
.addAsModule(war)
.addAsModule(ejbJar);
System.out.println(ear.toString(true));
return ear;
}
示例4: getApplicationXml
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
/**
* This method reads the file /META/INF/application.xml from the enterprise
* archive provided.
*
* @param enterpriseArchive
* is the {@link EnterpriseArchive} to be searched for the
* application.xml.
* @return The application.xml is returned as {@link String}.
* @throws FileNotFoundException
* is thrown in case of the application.xml was not found in
* directory /META-INF.
* @throws IOException
* is thrown if the application.xml could not be read.
*/
public static String getApplicationXml(EnterpriseArchive enterpriseArchive)
throws FileNotFoundException, IOException {
Node node = enterpriseArchive.get(APPLICATION_XML_PATH);
if (node == null) {
throw new FileNotFoundException("File '" + APPLICATION_XML_PATH
+ "' was not found in enterprise archive '"
+ enterpriseArchive.getName());
}
InputStream applicationXmlStream = node.getAsset().openStream();
if (applicationXmlStream == null) {
throw new IOException("File '" + APPLICATION_XML_PATH
+ "' seems to be a directory in enterprise archive '"
+ enterpriseArchive.getName());
}
try {
String resultString = IOUtils.toString(applicationXmlStream);
return resultString;
} finally {
applicationXmlStream.close();
}
}
示例5: createDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static EnterpriseArchive createDeployment() {
JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws2957-ejbinwarwebinflib_ejb.jar");
archive1
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2957.common.HelloIface.class)
.addClass(org.jboss.test.ws.jaxws.jbws2957.common.HelloImpl.class);
WebArchive archive2 = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2957-ejbinwarwebinflib_web.war");
archive2
.addManifest()
.addAsLibraries(archive1)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2957/WEB-INF/ejb-jar.xml"), "ejb-jar.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2957/WEB-INF/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl");
EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws2957-ejbinwarwebinflib.ear");
archive.addManifest().addAsModule(archive2);
return archive;
}
示例6: createDeployment3
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static EnterpriseArchive createDeployment3() {
JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1556.jar");
archive1
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1556.EJB3Bean.class)
.addClass(org.jboss.test.ws.jaxws.jbws1556.UserType.class);
JBossWSTestHelper.writeToFile(archive1);
EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws1556.ear");
archive
.addManifest()
.addAsModule(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-jbws1556.jar"))
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1556/META-INF/application.xml"), "application.xml");
return archive;
}
示例7: createDeployment2
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment(name = "jaxws-jbws1822-two-ejb-modules", testable = false, managed = false)
public static EnterpriseArchive createDeployment2() {
JavaArchive archive3 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1822-one-ejb3-inside.jar");
archive3
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
.addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
// JBossWSTestHelper.writeToFile(archive3);
EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws1822-two-ejb-modules.ear");
archive
.addManifest()
.addAsModule(archive3)
.addAsModule(archive1);
return archive;
}
示例8: createDeployment1
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment(name = "jaxws-jbws1822-one-ejb-module", testable = false, managed = false)
public static EnterpriseArchive createDeployment1() {
JavaArchive archive2 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1822-two-ejb3-inside.jar");
archive2
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanIface.class)
.addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanImpl.class)
.addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
.addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
JBossWSTestHelper.writeToFile(archive2);
EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws1822-one-ejb-module.ear");
archive
.addManifest()
.addAsModule(archive2);
return archive;
}
示例9: 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;
}
示例10: 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;
}
示例11: createDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment(testable = false)
public static EnterpriseArchive createDeployment() {
WebArchive server = ShrinkWrap.createFromZipFile(WebArchive.class,
new File("../" + CALCULATOR_SERVICE_NAME + "/target/"
+ CALCULATOR_SERVICE_NAME + ".war"));
WebArchive client = ShrinkWrap
.create(WebArchive.class,
"ws-security-username-token-client.war")
.addPackages(true, CalcResource.class.getPackage())
.addPackages(true, CalculatorUTService.class.getPackage())
.addAsResource(
new File(RESOURCES_PATH, "wsdl/calculator-ut.wsdl"),
"wsdl/calculator-ut.wsdl")
.addAsWebInfResource(
new File(WEB_APP_PATH, "WEB-INF/beans.xml"))
.addAsManifestResource(
new File(TEST_RESOURCES_PATH, "META-INF/MANIFEST.MF"));
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class,
"ws-security-username-token.ear").addAsModules(server, client);
System.out.println(ear.toString(true));
return ear;
}
示例12: deployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment
public static Archive<?> deployment() {
return ShrinkWrap.create(EnterpriseArchive.class, "camel-ee7.ear")
.addAsLibraries(
Maven.configureResolver()
.workOffline()
.loadPomFromFile("pom.xml")
.resolve("io.astefanutti.camel.cdi:camel-cdi")
.withTransitivity()
.asList(JavaArchive.class))
.addAsModule(
ShrinkWrap.create(JavaArchive.class, "camel-ee7.jar")
// FIXME: Arquillian throws a ClassNotFoundException when removing the Bootstrap class
.addClasses(Bootstrap.class, CamelRoute.class, HelloCamel.class)
// TODO: to be removed when ARQ-659 is fixed
.addClass(CamelEE7Test.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"));
}
示例13: createEnterpriseArchive
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
public static EnterpriseArchive createEnterpriseArchive(ServerType serverType) throws IOException {
JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "cdipropertiesejb.jar").addClasses(
ServiceEjbDefaultMethod.class, InjectedBean.class, TestEntity.class, IdGenerator.class,
ServiceEjbDefaultMethodBean.class);
DeploymentAppenderFactory.create(ejbModule).appendBeansXml().appendPersistenceXml(serverType);
JavaArchive resourcesJar = ShrinkWrap.create(JavaArchive.class, "resources.jar");
DeploymentAppenderFactory.create(resourcesJar).appendLogging().appendProperties().appendOtherProperties()
.appendCDIPropertiesConfig();
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "cdiproperties.ear").addAsModule(ejbModule)
.addAsLibrary(resourcesJar);
DeploymentAppenderFactory.create(ear).appendApplicationXml().appendCDIPropertiesLib();
return ear;
}
示例14: createEnterpriseArchive
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
public static EnterpriseArchive createEnterpriseArchive(ServerType serverType) throws IOException {
JavaArchive ejbModule = ShrinkWrap.create(JavaArchive.class, "cdipropertiesejb.jar").addClasses(
ServiceEjbDefaultMethod.class, ServiceEjbDefaultMethodBean.class, IdGenerator.class,
ServiceEjbProvidedMethodBean.class);
DeploymentAppenderFactory.create(ejbModule).appendBeansXml().appendPersistenceXml(serverType);
JavaArchive resourcesJar = ShrinkWrap.create(JavaArchive.class, "resources.jar");
DeploymentAppenderFactory.create(resourcesJar).appendLogging().appendProperties().appendOtherProperties()
.appendCDIPropertiesConfig();
JavaArchive resolverJar = ShrinkWrap.create(JavaArchive.class, "resolver.jar").addClasses(
EjbProvidedMethodResolver.class, ApplicationScopedBean.class, DependentScopedBean.class,
InjectedBean.class, ServiceEjbProvidedMethod.class, TestEntity.class);
DeploymentAppenderFactory.create(resolverJar).appendBeansXml();
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "cdiproperties.ear").addAsModule(ejbModule)
.addAsLibrary(resourcesJar).addAsLibrary(resolverJar);
DeploymentAppenderFactory.create(ear).appendApplicationXml().appendCDIPropertiesLib();
return ear;
}
示例15: getDeployment
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive; //导入依赖的package包/类
@Deployment
public static EnterpriseArchive getDeployment() {
WebArchive module1 = getTckSubDeployment(1);
module1.addClass(LibTest.class);
// dummy module
WebArchive module2 = getTckSubDeployment(2);
final EnterpriseArchive ear = getEarDeployment(module1, module2);
JavaArchive lib = ShrinkWrap.create(JavaArchive.class);
lib.addClass(LibHelper.class);
new LibUtils().addGaeAsLibrary(ear);
ear.addAsLibraries(lib);
return ear;
}