Search in sources :

Example 66 with EnterpriseArchive

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

the class DynamicMessageListenerTestCase method createDeplyoment.

@Deployment
public static Archive createDeplyoment() {
    final EnterpriseArchive ear = create(EnterpriseArchive.class, "ear-with-rar.ear").addAsModule(create(JavaArchive.class, "telnet-ra.rar").addAsManifestResource(TelnetResourceAdapter.class.getPackage(), "ra.xml", "ra.xml").addPackages(true, TelnetResourceAdapter.class.getPackage(), TelnetListener.class.getPackage(), TelnetServer.class.getPackage())).addAsModule(create(JavaArchive.class, "mdb.jar").addClasses(MyMdb.class));
    ear.addAsManifestResource(createPermissionsXmlAsset(// Cmd (TelnetServer package) uses PropertyEditorManager#registerEditor during static initialization
    new PropertyPermission("*", "read,write"), // TelnetServer binds socket and accepts connections
    new SocketPermission("*", "accept,listen")), "permissions.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) TelnetResourceAdapter(org.jboss.as.test.integration.ejb.mdb.dynamic.adapter.TelnetResourceAdapter) PropertyPermission(java.util.PropertyPermission) TelnetListener(org.jboss.as.test.integration.ejb.mdb.dynamic.api.TelnetListener) SocketPermission(java.net.SocketPermission) MyMdb(org.jboss.as.test.integration.ejb.mdb.dynamic.application.MyMdb) TelnetServer(org.jboss.as.test.integration.ejb.mdb.dynamic.impl.TelnetServer) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 67 with EnterpriseArchive

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

the class ServletUnitTestCase method deployEar.

@Deployment(name = "ear", order = 4)
public static Archive<?> deployEar() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ejb3-ear-servlet.ear");
    ear.addAsModule(getClient("ejb3-ear-servlet-client.jar"));
    ear.addAsModule(getEjbs("ejb3-ear-servlet-ejbs.jar"));
    WebArchive war = getServlet("ejb3-ear-servlet.war");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "jboss-web-ear.xml", "jboss-web.xml");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "web-ear.xml", "web.xml");
    war.addClass(EJBServletEar.class);
    ear.addAsModule(war);
    ear.addAsManifestResource(ServletUnitTestCase.class.getPackage(), "application.xml", "application.xml");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 68 with EnterpriseArchive

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

the class DependsOnSingletonUnitTestCase method deployDependsOn.

@Deployment(name = "ear", order = 1, managed = false, testable = false)
public static Archive<?> deployDependsOn() {
    JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "one.jar");
    jarOne.addClass(SingletonOne.class);
    JavaArchive jarTwo = ShrinkWrap.create(JavaArchive.class, "two.jar");
    jarTwo.addClass(SingletonTwo.class);
    JavaArchive jarThree = ShrinkWrap.create(JavaArchive.class, "three.jar");
    jarThree.addClass(SingletonThree.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "dependson-test.ear");
    ear.addAsModule(jarOne);
    ear.addAsModule(jarTwo);
    ear.addAsModule(jarThree);
    ear.addAsManifestResource(DependsOnSingletonUnitTestCase.class.getPackage(), "application.xml", "application.xml");
    ear.addAsManifestResource(new StringAsset("Dependencies: deployment.callcounter.jar \n"), "MANIFEST.MF");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 69 with EnterpriseArchive

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

the class JBossAppXMLSecurityTestCase method createDeployment.

// the incorrectly named "testable" attribute tells Arquillian whether or not
@Deployment(testable = false)
public static // We don't want that, so set that flag to false
Archive createDeployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear");
    ear.addAsManifestResource(JBossAppXMLSecurityTestCase.class.getPackage(), "jboss-app.xml", "jboss-app.xml");
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addClasses(BeanInterface.class, FirstBean.class, SecondBean.class);
    jar.addPackage(CommonCriteria.class.getPackage());
    jar.addAsManifestResource(JBossAppXMLSecurityTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
    ear.addAsModule(jar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 70 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive 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

EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)164 Deployment (org.jboss.arquillian.container.test.api.Deployment)143 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)139 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)85 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)58 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)21 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)15 BeforeClass (org.junit.BeforeClass)10 File (java.io.File)8 ModelNode (org.jboss.dmr.ModelNode)8 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)7 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)6 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)4 ByteArrayAsset (org.jboss.shrinkwrap.api.asset.ByteArrayAsset)4 ApplicationDescriptor (org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor)4 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)4 Properties (java.util.Properties)3 PropertyPermission (java.util.PropertyPermission)3 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)3 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)3