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);
}
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;
}
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;
}
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;
}
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;
}
Aggregations