Search in sources :

Example 86 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project javaee7-samples by javaee-samples.

the class FileWatcherTest method deploy.

@Deployment
public static EnterpriseArchive deploy() throws Exception {
    final JavaArchive fsWatcherFileAdapter = ShrinkWrap.create(JavaArchive.class, "rar.jar").addPackages(true, Created.class.getPackage(), FileSystemWatcher.class.getPackage());
    final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "fswatcher.rar").addAsLibrary(fsWatcherFileAdapter);
    final JavaArchive fileWatcher = ShrinkWrap.create(JavaArchive.class, "mdb.jar").addClasses(FileEvent.class, FileWatchingMDB.class).addAsManifestResource("glassfish-ejb-jar.xml").addAsManifestResource("jboss-ejb3.xml").addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    final JavaArchive test = ShrinkWrap.create(JavaArchive.class, "test.jar").addClasses(FileWatcherTest.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    final JavaArchive[] testArchives = Maven.resolver().loadPomFromFile("pom.xml").resolve("org.assertj:assertj-core", "com.jayway.awaitility:awaitility").withTransitivity().as(JavaArchive.class);
    return ShrinkWrap.create(EnterpriseArchive.class, "test.ear").addAsModules(rar, fileWatcher).addAsLibraries(testArchives).addAsLibrary(test);
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) FileSystemWatcher(org.javaee7.jca.filewatch.adapter.FileSystemWatcher) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Created(org.javaee7.jca.filewatch.event.Created) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 87 with EnterpriseArchive

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

the class SubDeploymentOperationsTestCase method initialDeploy.

private ModelNode initialDeploy() throws Exception {
    ModelNode result;
    List<InputStream> attachments = new ArrayList<>();
    JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, JAR_SUBDEPLOYMENT_NAME).addClasses(EJBBusinessInterface.class, SimpleSLSB.class);
    WebArchive war = ShrinkWrap.create(WebArchive.class, WAR_SUBDEPLOYMENT_NAME).addClasses(HelloWorldServlet.class, EjbInvokingServlet.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, TEST_DEPLOYMENT_NAME).addAsModule(ejbJar).addAsModule(war);
    try (InputStream is = ear.as(ZipExporter.class).exportAsInputStream()) {
        ModelNode compositeOp = new ModelNode();
        ModelNode addOp = new ModelNode();
        addOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD);
        addOp.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT, TEST_DEPLOYMENT_NAME);
        addOp.get(ModelDescriptionConstants.CONTENT).add(ModelDescriptionConstants.INPUT_STREAM_INDEX, 0);
        ModelNode content = new ModelNode();
        content.get(ModelDescriptionConstants.INPUT_STREAM_INDEX).set(0);
        ModelNode deployOp = new ModelNode();
        deployOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.DEPLOY);
        deployOp.get(ModelDescriptionConstants.OP_ADDR).set(ModelDescriptionConstants.DEPLOYMENT, TEST_DEPLOYMENT_NAME);
        compositeOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.COMPOSITE);
        compositeOp.get(ModelDescriptionConstants.STEPS).setEmptyList();
        compositeOp.get(ModelDescriptionConstants.STEPS).add(addOp);
        compositeOp.get(ModelDescriptionConstants.STEPS).add(deployOp);
        attachments.add(is);
        result = managementClient.getControllerClient().execute(Operation.Factory.create(compositeOp, attachments));
    }
    return result;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) InputStream(java.io.InputStream) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ArrayList(java.util.ArrayList) ModelNode(org.jboss.dmr.ModelNode) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 88 with EnterpriseArchive

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

the class MissingMethodPermissionsDefaultAllowedTestCase method createDeployment.

@Deployment
public static Archive createDeployment() {
    final Package currentPackage = MissingMethodPermissionsDefaultAllowedTestCase.class.getPackage();
    final JavaArchive ejbJarOne = ShrinkWrap.create(JavaArchive.class, MODULE_ONE_NAME + ".jar").addClasses(SecuredBeanOne.class).addAsManifestResource(currentPackage, "one-jboss-ejb3.xml", "jboss-ejb3.xml");
    final JavaArchive ejbJarTwo = ShrinkWrap.create(JavaArchive.class, MODULE_TWO_NAME + ".jar").addClass(SecuredBeanTwo.class).addAsManifestResource(currentPackage, "two-jboss-ejb3.xml", "jboss-ejb3.xml");
    final JavaArchive ejbJarThree = ShrinkWrap.create(JavaArchive.class, MODULE_THREE_NAME + ".jar").addClass(SecuredBeanThree.class);
    final JavaArchive libJar = ShrinkWrap.create(JavaArchive.class, "bean-interfaces.jar").addClasses(SecurityTestRemoteView.class, Util.class, MissingMethodPermissionsDefaultAllowedTestCase.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear").addAsModules(ejbJarOne, ejbJarTwo, ejbJarThree).addAsLibrary(libJar).addAsManifestResource(currentPackage, "permissions.xml", "permissions.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 89 with EnterpriseArchive

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

the class MissingMethodPermissionsTestCase method createDeployment.

@Deployment
public static Archive createDeployment() {
    final Package currentPackage = MissingMethodPermissionsTestCase.class.getPackage();
    final JavaArchive ejbJarOne = ShrinkWrap.create(JavaArchive.class, MODULE_ONE_NAME + ".jar").addClasses(SecuredBeanOne.class).addAsManifestResource(currentPackage, "one-jboss-ejb3.xml", "jboss-ejb3.xml");
    final JavaArchive ejbJarTwo = ShrinkWrap.create(JavaArchive.class, MODULE_TWO_NAME + ".jar").addClass(SecuredBeanTwo.class).addAsManifestResource(currentPackage, "two-jboss-ejb3.xml", "jboss-ejb3.xml");
    final JavaArchive ejbJarThree = ShrinkWrap.create(JavaArchive.class, MODULE_THREE_NAME + ".jar").addClass(SecuredBeanThree.class);
    final JavaArchive libJar = ShrinkWrap.create(JavaArchive.class, "bean-interfaces.jar").addClasses(SecurityTestRemoteView.class, Util.class, MissingMethodPermissionsTestCase.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear").addAsModules(ejbJarOne, ejbJarTwo, ejbJarThree).addAsLibrary(libJar).addAsManifestResource(currentPackage, "permissions.xml", "permissions.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 90 with EnterpriseArchive

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

the class EarDeploymentDistinctNameTestCase method createDeployment.

@Deployment(testable = false)
public static EnterpriseArchive createDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(EarDeploymentDistinctNameTestCase.class.getPackage());
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear");
    ear.addAsModule(jar);
    ear.addAsManifestResource(EarDeploymentDistinctNameTestCase.class.getPackage(), "jboss-app.xml", "jboss-app.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)

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