Search in sources :

Example 1 with ResourceAdapterArchive

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;
}
Also used : ValidConnectionFactory(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidConnectionFactory) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with ResourceAdapterArchive

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;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) ValidConnectionFactory(org.jboss.as.test.integration.jca.beanvalidation.ra.ValidConnectionFactory) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with ResourceAdapterArchive

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) AnnoConnectionFactory(org.jboss.as.test.integration.jca.annorar.AnnoConnectionFactory) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with ResourceAdapterArchive

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;
}
Also used : ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) MultipleAdminObject1(org.jboss.as.test.integration.jca.rar.MultipleAdminObject1) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with ResourceAdapterArchive

use of org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive in project wildfly by wildfly.

the class RarInsideEarReDeploymentTestCase method createDeployment.

/**
     * Define the deployment
     *
     * @return The deployment archive
     */
@Deployment(name = deploymentName, managed = false)
public static EnterpriseArchive createDeployment() throws Exception {
    ResourceAdapterArchive raa = ShrinkWrap.create(ResourceAdapterArchive.class, subDeploymentName);
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "multiple.jar");
    ja.addPackage(MultipleAdminObject1.class.getPackage()).addClasses(RarInsideEarReDeploymentTestCase.class, MgmtOperationException.class, XMLElementReader.class, XMLElementWriter.class);
    ja.addPackage(AbstractMgmtTestBase.class.getPackage());
    raa.addAsLibrary(ja);
    raa.addAsManifestResource(RarInsideEarReDeploymentTestCase.class.getPackage(), "ra.xml", "ra.xml").addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr,org.jboss.as.cli\n"), "MANIFEST.MF");
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, deploymentName);
    ear.addAsModule(raa);
    ear.addAsManifestResource(RarInsideEarReDeploymentTestCase.class.getPackage(), "application.xml", "application.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) AbstractMgmtTestBase(org.jboss.as.test.integration.management.base.AbstractMgmtTestBase) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)55 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)53 Deployment (org.jboss.arquillian.container.test.api.Deployment)45 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)34 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)23 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)11 ValidConnectionFactory (org.jboss.as.test.integration.jca.beanvalidation.ra.ValidConnectionFactory)4 MultipleConnectionFactory1 (org.jboss.as.test.smoke.deployment.rar.MultipleConnectionFactory1)4 LazyConnectionFactory (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionFactory)3 LazyConnectionImpl (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionImpl)3 LazyLocalTransaction (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyLocalTransaction)3 LazyManagedConnection (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyManagedConnection)3 LazyResourceAdapter (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyResourceAdapter)3 MultipleAdminObject1 (org.jboss.as.test.integration.jca.rar.MultipleAdminObject1)3 MultipleConnectionFactory1 (org.jboss.as.test.integration.jca.rar.MultipleConnectionFactory1)3 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)3 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)2 AnnoConnectionFactory (org.jboss.as.test.integration.jca.annorar.AnnoConnectionFactory)2 ExplodedExporter (org.jboss.shrinkwrap.api.exporter.ExplodedExporter)2 File (java.io.File)1