Search in sources :

Example 91 with StringAsset

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

the class WarOverlayTestBase method createWARWithOverlayedArchive.

public static Archive<?> createWARWithOverlayedArchive(final boolean resourcePresent, String deploymentOverlayedArchive, final String deploymentTopArchve) {
    WebArchive war = ShrinkWrap.create(WebArchive.class, deploymentTopArchve);
    Archive<?> jar = createOverlayedArchive(resourcePresent, deploymentOverlayedArchive);
    if (resourcePresent) {
        war.add(new StringAsset(OverlayableInterface.ORIGINAL), OVERLAY_HTML);
    }
    war.add(new StringAsset(OverlayableInterface.STATIC), STATIC_HTML);
    war.addAsLibrary(jar);
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive)

Example 92 with StringAsset

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

the class BouncyCastleModuleTestCase method createDeployment.

@Deployment(name = BC_DEPLOYMENT, testable = true)
public static WebArchive createDeployment() {
    WebArchive archive = ShrinkWrap.create(WebArchive.class, BC_DEPLOYMENT + ".war");
    archive.addPackage(BouncyCastleModuleTestCase.class.getPackage());
    //needed to load CDI for arquillian
    archive.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    archive.addAsManifestResource(createPermissionsXmlAsset(new SecurityPermission("insertProvider")), "permissions.xml");
    archive.setManifest(new StringAsset("" + "Manifest-Version: 1.0\n" + "Dependencies: org.bouncycastle\n"));
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SecurityPermission(java.security.SecurityPermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 93 with StringAsset

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

the class SubDeploymentAvailableInClassPathTestCase method createEarWithWarJarAndLib.

@Deployment(name = "ear-with-war-and-jar", testable = false)
public static EnterpriseArchive createEarWithWarJarAndLib() {
    final JavaArchive servletLogicJar = ShrinkWrap.create(JavaArchive.class, "servlet-logic.jar");
    servletLogicJar.addClasses(ClassInJar.class);
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "war-access-to-jar.war");
    war.addClasses(EjbInvokeClassloaderToStringServlet.class);
    war.addAsManifestResource(new StringAsset("Class-Path: servlet-logic.jar"), "MANIFEST.MF");
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "war-access-to-jar.ear");
    ear.addAsModule(servletLogicJar);
    ear.addAsModule(war);
    JavaArchive libraryJar = ShrinkWrap.create(JavaArchive.class, "javax-naming-test-impl.jar");
    libraryJar.addClass(InitialContext.class);
    ear.addAsLibrary(libraryJar);
    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) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 94 with StringAsset

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

the class EarClassPathTransitiveClosureTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    JavaArchive libJar = ShrinkWrap.create(JavaArchive.class);
    libJar.addClasses(TestAA.class, EarClassPathTransitiveClosureTestCase.class);
    war.addAsLibraries(libJar);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "earLib.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: ../cp1.jar\n".getBytes()), "MANIFEST.MF");
    ear.addAsLibraries(earLib);
    earLib = ShrinkWrap.create(JavaArchive.class, "cp1.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: cp2.jar\n".getBytes()), "MANIFEST.MF");
    ear.addAsModule(earLib);
    earLib = ShrinkWrap.create(JavaArchive.class, "cp2.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: a/b/c\n".getBytes()), "MANIFEST.MF");
    earLib.addClass(TestBB.class);
    ear.addAsModule(earLib);
    ear.add(new StringAsset("Hello World"), "a/b/c", "testfile.file");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ByteArrayAsset(org.jboss.shrinkwrap.api.asset.ByteArrayAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 95 with StringAsset

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

the class EarJbossStructureDepedenciesTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
    war.addClasses(TestAA.class, EarJbossStructureDepedenciesTestCase.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    //test the 1.0 parser
    ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure xmlns=\"urn:jboss:deployment-structure:1.0\">" + "<deployment>" + "</deployment>" + "<sub-deployment name=\"test.war\">" + "   <dependencies>" + "       <module name=\"org.jboss.classfilewriter\" />" + "   </dependencies>" + "</sub-deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "earLib.jar");
    earLib.addClass(TestBB.class);
    ear.addAsLibraries(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