Search in sources :

Example 86 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class EclipseLinkSharedModuleProviderTestCase method deploy.

@Deployment
public static Archive<?> deploy() throws Exception {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
    lib.addClasses(SFSB1.class);
    ear.addAsModule(lib);
    lib = ShrinkWrap.create(JavaArchive.class, "entities.jar");
    lib.addClasses(Employee.class);
    lib.addAsManifestResource(new StringAsset(persistence_xml), "persistence.xml");
    ear.addAsLibraries(lib);
    final WebArchive main = ShrinkWrap.create(WebArchive.class, "main.war");
    main.addClasses(EclipseLinkSharedModuleProviderTestCase.class);
    ear.addAsModule(main);
    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 87 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class HibernateJarsInDeploymentTestCase method deploy.

@Deployment
public static Archive<?> deploy() throws Exception {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
    addHibernate42xJars(ear);
    JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
    lib.addClasses(SFSB1.class, HibernateJarsInDeploymentTestCase.class);
    lib.addAsManifestResource(HibernateJarsInDeploymentTestCase.class.getPackage(), "persistence.xml", "persistence.xml");
    ear.addAsManifestResource(HibernateJarsInDeploymentTestCase.class.getPackage(), "permissions.xml", "permissions.xml");
    ear.addAsManifestResource(new StringAsset("Dependencies: org.jboss.jandex\n"), "MANIFEST.MF");
    ear.addAsModule(lib);
    lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
    lib.addClass(LibClass.class);
    ear.addAsLibrary(lib);
    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) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 88 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class DeploymentOperationsTestCase method createDeployment.

protected void createDeployment(final File file, final String dependency) throws IOException {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class);
    final String dependencies = "Dependencies: " + dependency;
    archive.add(new StringAsset(dependencies), "META-INF/MANIFEST.MF");
    archive.as(ZipExporter.class).exportTo(file);
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 89 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class WarJbossStructureClassFileTransformerTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
    war.addClasses(TestAA.class, DummyClassFileTransformer1.class, DummyClassFileTransformer2.class, WarJbossStructureClassFileTransformerTestCase.class);
    war.addAsManifestResource(new StringAsset("<jboss-deployment-structure xmlns=\"urn:jboss:deployment-structure:1.0\">\n" + "  <deployment>\n" + "     <transformers>\n" + "         <transformer class=\"" + DummyClassFileTransformer1.class.getName() + "\"/>\n" + "         <transformer class=\"" + DummyClassFileTransformer2.class.getName() + "\"/>\n" + "     </transformers>\n" + "  </deployment>\n" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 90 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class WarInEarChildFirstClassLoadingTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    war.addClasses(WebInfLibClass.class, WarInEarChildFirstClassLoadingTestCase.class, Stateless.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "cp.jar");
    //AS7-5547, make sure an empty dependencies entry is fine
    earLib.addAsManifestResource(new StringAsset("Dependencies: \n"), "MANIFEST.MF");
    earLib.addClasses(TestBB.class, WebInfLibClass.class);
    ear.addAsLibrary(earLib);
    ear.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader")), "permissions.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)

Aggregations

StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)319 Deployment (org.jboss.arquillian.container.test.api.Deployment)259 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)180 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)180 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)60 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)44 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)38 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)25 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)24 File (java.io.File)17 PropertyPermission (java.util.PropertyPermission)17 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)15 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)11 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)10 Util (org.jboss.as.test.shared.integration.ejb.security.Util)10 BeforeClass (org.junit.BeforeClass)8 Test (org.junit.Test)8 SocketPermission (java.net.SocketPermission)7 Properties (java.util.Properties)7 Runner (org.apache.openejb.arquillian.tests.Runner)7