use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.
the class ResourceAdapterStatisticsTestCase method createDeployment.
public static ResourceAdapterArchive createDeployment(String deploymentName) throws Exception {
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, deploymentName + ".rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, deploymentName + ".jar");
ja.addPackage(pack);
raa.addAsLibrary(ja);
raa.addAsManifestResource(ResourceAdapterStatisticsTestCase.class.getPackage(), "ra.xml", "ra.xml");
return raa;
}
use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.
the class RarClassLoadingTestCase method deployment.
@Deployment
public static Archive<?> deployment() {
ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "rarClassLoadingTest.rar");
JavaArchive jar1 = ShrinkWrap.create(JavaArchive.class, "main.jar");
jar1.addClasses(RarClassLoadingTestCase.class, RarMainClass.class);
jar1.addPackage(ValidConnectionFactory.class.getPackage());
rar.add(jar1, "/", ZipExporter.class);
JavaArchive jar2 = ShrinkWrap.create(JavaArchive.class, "support.jar");
jar2.addClasses(RarSupportClass.class);
rar.add(jar2, "some/random/directory", ZipExporter.class);
rar.addAsManifestResource(RarClassLoadingTestCase.class.getPackage(), "ra.xml", "ra.xml");
return rar;
}
use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.
the class RarTransientDependenciesTestCase method createDeployment.
/**
* Creates a .ear which has the following packaging structure:
* <p/>
* rar-transient-dep.ear
* |
* |--- rardeployment.rar (RAR deployment)
* | |
* | |--- META-INF
* | | |
* | | |--- ra.xml
* | | |
* | | |--- MANIFEST.MF containing -> Class-Path: transient.jar (to point to the jar at the root of the .ear)
* |
* |
* |--- referenceingwebapp.war (war deployment)
* | |
* | |
* | |--- org.jboss.as.test.integration.deployment.classloading.transientdependencies.Servlet (the servlet which tries to access the class in the transient.jar, when invoked)
* |
* |
* |--- transient.jar (simple jar file and NOT a deployment. this jar is referenced via the Class-Path manifest attribute in the .rar and as a result, is transitively expected to be available for access in the .war)
* | |
* | |--- org.jboss.as.test.integration.deployment.classloading.transientdependencies.JarClass
*
* @return
*/
@Deployment
public static Archive<?> createDeployment() {
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "rar-transient-dep.ear");
final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "rardeployment.rar");
JavaArchive jar1 = ShrinkWrap.create(JavaArchive.class, "main.jar");
jar1.addPackage(ValidConnectionFactory.class.getPackage());
rar.add(jar1, "/", ZipExporter.class);
rar.addAsManifestResource(RarTransientDependenciesTestCase.class.getPackage(), "MANIFEST.MF", "MANIFEST.MF");
rar.addAsManifestResource(RarTransientDependenciesTestCase.class.getPackage(), "ra.xml", "ra.xml");
// add the .rar to the .ear
ear.addAsModule(rar);
// now create the transient.jar with the JarClass.class
final JavaArchive transientDepJar = ShrinkWrap.create(JavaArchive.class, "transient.jar");
transientDepJar.addClass(JarClass.class);
// add this jar to the root of the .ear as simple jar and not as a module. the .rar in the .ear will have a Class-Path reference
// to this jar
ear.add(transientDepJar, "/", ZipExporter.class);
// finally create and add the .war to the .ear
final WebArchive war = ShrinkWrap.create(WebArchive.class, "referenceingwebapp.war");
war.addClasses(RarTransientDependenciesTestCase.class, Servlet.class);
war.addAsWebInfResource(RarTransientDependenciesTestCase.class.getPackage(), "web.xml", "web.xml");
ear.addAsModule(war);
return ear;
}
use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.
the class RaAnnoTestCase method createDeployment.
/**
* Define the deployment
*
* @return The deployment archive
* @throws Exception in case of error
*/
@Deployment
public static ResourceAdapterArchive createDeployment() throws Exception {
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, "ra16anno.rar");
JavaArchive ja = ShrinkWrap.create(JavaArchive.class);
ja.addClasses(MgmtOperationException.class, XMLElementReader.class, XMLElementWriter.class, RaAnnoTestCase.class);
ja.addPackage(AbstractMgmtTestBase.class.getPackage()).addPackage(AnnoConnectionFactory.class.getPackage());
raa.addAsLibrary(ja).addAsManifestResource(RaAnnoTestCase.class.getPackage(), "ra.xml", "ra.xml").addAsManifestResource(new StringAsset("Dependencies: javax.inject.api,org.jboss.as.connector,org.jboss.as.controller-client,org.jboss.dmr,org.jboss.as.cli\n"), "MANIFEST.MF");
return raa;
}
use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.
the class WarServletDeploymentTestCase method getRar.
@Deployment(name = "rar", order = 1)
public static Archive<?> getRar() {
ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, rarDeploymentName);
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "lib.jar");
ja.addPackage(MultipleAdminObject1.class.getPackage());
raa.addAsLibrary(ja);
raa.addAsManifestResource(WarServletDeploymentTestCase.class.getPackage(), "ra.xml", "ra.xml");
return raa;
}
Aggregations