Search in sources :

Example 1 with EnterpriseArchive

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

the class Hibernate4NativeAPINaturalIdTestCase method deploy.

@Deployment
public static Archive<?> deploy() throws Exception {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
    // add required jars as manifest dependencies
    ear.addAsManifestResource(new StringAsset("Dependencies: org.hibernate \n"), "MANIFEST.MF");
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
    lib.addClasses(SFSBHibernateSFNaturalId.class);
    ear.addAsModule(lib);
    lib = ShrinkWrap.create(JavaArchive.class, "entities.jar");
    lib.addClasses(Person.class);
    lib.addAsResource(new StringAsset(testmapping), "testmapping.hbm.xml");
    lib.addAsResource(new StringAsset(hibernate_cfg), "hibernate.cfg.xml");
    ear.addAsLibraries(lib);
    final WebArchive main = ShrinkWrap.create(WebArchive.class, "main.war");
    main.addClasses(Hibernate4NativeAPINaturalIdTestCase.class);
    ear.addAsModule(main);
    // add application dependency on H2 JDBC driver, so that the Hibernate classloader (same as app classloader)
    // will see the H2 JDBC driver.
    // equivalent hack for use of shared Hiberante module, would be to add the H2 dependency directly to the
    // shared Hibernate module.
    // also add dependency on org.slf4j
    ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure>" + " <deployment>" + " <dependencies>" + " <module name=\"com.h2database.h2\" />" + " <module name=\"org.slf4j\"/>" + " </dependencies>" + " </deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with EnterpriseArchive

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

the class DsWithSecurityDomainTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "single.jar").addClasses(DsWithSecurityDomainTestCase.class);
    jar.addClasses(AbstractLoginModuleSecurityDomainTestCaseSetup.class, AbstractSecurityDomainSetup.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear").addAsLibrary(jar).addAsManifestResource(DsWithSecurityDomainTestCase.class.getPackage(), "security-ds.xml", "security-ds.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with EnterpriseArchive

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

the class JAASIdentityCachingTestCase method earDeployment.

// Public methods --------------------------------------------------------
/**
     * Creates {@link EnterpriseArchive} deployment.
     */
@Deployment
public static EnterpriseArchive earDeployment() {
    final JavaArchive libJar = ShrinkWrap.create(JavaArchive.class, LM_LIB_NAME).addClasses(CustomLoginModule.class, CustomPrincipal.class);
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, JAR_BASE_NAME + ".jar").addClasses(Hello.class, HelloBean.class).addAsManifestResource(Utils.getJBossEjb3XmlAsset(TEST_NAME), "jboss-ejb3.xml");
    final WebArchive war = ShrinkWrap.create(WebArchive.class, WAR_BASE_NAME + ".war").addClasses(HelloEJBCallServlet.class, //
    LMCounterServlet.class).addAsWebInfResource(UsersRolesLoginModuleTestCase.class.getPackage(), "web-basic-authn.xml", //
    "web.xml").addAsWebInfResource(Utils.getJBossWebXmlAsset(TEST_NAME), "jboss-web.xml");
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, EAR_BASE_NAME + ".ear");
    ear.addAsLibrary(libJar);
    ear.addAsModule(war);
    ear.addAsModule(ejbJar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) Hello(org.jboss.as.test.integration.security.common.ejb3.Hello) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) HelloBean(org.jboss.as.test.integration.security.common.ejb3.HelloBean) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with EnterpriseArchive

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

the class SharedSessionFailoverTestCase method getDeployment.

private static Archive<?> getDeployment() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE + ".jar");
    jar.addClass(Mutable.class);
    WebArchive war1 = ShrinkWrap.create(WebArchive.class, MODULE_1 + ".war");
    war1.addClass(SimpleServlet.class);
    WebArchive war2 = ShrinkWrap.create(WebArchive.class, MODULE_2 + ".war");
    war2.addClass(SimpleServlet.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, MODULE + ".ear");
    ear.addAsLibraries(jar);
    ear.addAsModule(war1);
    ear.addAsModule(war2);
    ear.addAsManifestResource(SharedSessionFailoverTestCase.class.getPackage(), "jboss-all.xml", "jboss-all.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 5 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project Payara by payara.

the class PayaraRestDeployEarTest method getTestArchive.

/**
 * Deployment for the test
 */
@Deployment(testable = false)
public static Archive<?> getTestArchive() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war").addClasses(GreeterServlet.class);
    final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar").addClasses(Greeter.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear").setApplicationXML("application.xml").addAsModule(war).addAsModule(ejb);
    log.info(ear.toString(true));
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)257 Deployment (org.jboss.arquillian.container.test.api.Deployment)207 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)187 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)127 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)82 File (java.io.File)39 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)35 BeforeClass (org.junit.BeforeClass)22 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)16 ModelNode (org.jboss.dmr.ModelNode)15 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)14 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)11 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)8 BasicPath (org.jboss.shrinkwrap.impl.base.path.BasicPath)8 Test (org.junit.Test)8 Document (org.w3c.dom.Document)8 HashMap (java.util.HashMap)7 GatewayConfig (org.apache.knox.gateway.config.GatewayConfig)7 Topology (org.apache.knox.gateway.topology.Topology)7 PropertyPermission (java.util.PropertyPermission)6