Search in sources :

Example 31 with StringAsset

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

the class ServletUnitTestCase method deployServlet.

@Deployment(name = "servlet", order = 3)
public static Archive<?> deployServlet() {
    WebArchive war = getServlet("ejb3-servlet.war");
    war.addClass(EJBServlet.class);
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
    war.addAsWebInfResource(ServletUnitTestCase.class.getPackage(), "web.xml", "web.xml");
    war.addAsManifestResource(new StringAsset("Dependencies: deployment.ejb3-servlet-ejbs.jar \n"), "MANIFEST.MF");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 32 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset 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 33 with StringAsset

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

the class MDBWhichDependsOnTestCase method getTestArchive.

@Deployment(name = Constants.DEPLOYMENT_NAME_COUNTER, order = 0, managed = true, testable = true)
public static Archive<?> getTestArchive() throws Exception {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, Constants.DEPLOYMENT_JAR_NAME_COUNTER);
    jar.addClass(CallCounterSingleton.class);
    jar.addClass(MDBWhichDependsOnTestCase.class);
    jar.addClass(Constants.class);
    jar.addClass(JMSMessagingUtil.class);
    jar.addClasses(JmsQueueServerSetupTask.class, SetupModuleServerSetupTask.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, " + Constants.TEST_MODULE_NAME_FULL + "\n"), "MANIFEST.MF");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 34 with StringAsset

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

the class StatefulBeanWhichDependsOnTestCase method getSessionArchive.

@Deployment(name = SessionConstants.DEPLOYMENT_NAME_SESSION, order = 1, managed = false, testable = false)
public static Archive<?> getSessionArchive() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, SessionConstants.DEPLOYMENT_NAME_SESSION);
    jar.addClass(Constants.class);
    jar.addClass(CallCounterProxy.class);
    jar.addClass(SessionConstants.class);
    jar.addClass(BeanBase.class);
    jar.addClass(StatefulBeanWhichDependsOn.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, " + SessionConstants.TEST_MODULE_NAME_FULL + "\n"), "MANIFEST.MF");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 35 with StringAsset

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

the class StatefulTimeoutTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar");
    jar.addPackage(StatefulTimeoutTestCase.class.getPackage());
    jar.add(new StringAsset("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<ejb-jar xmlns=\"http://java.sun.com/xml/ns/javaee\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "    version=\"3.1\" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd\">\n" + "    <enterprise-beans>\n" + "        <session>\n" + "            <ejb-name>" + DescriptorBean.class.getSimpleName() + "</ejb-name>\n" + "            <ejb-class>" + DescriptorBean.class.getName() + "</ejb-class>\n" + "            <session-type>Stateful</session-type>\n" + "            <stateful-timeout>\n" + "                <timeout>1</timeout>\n" + "                <unit>Seconds</unit>\n" + "            </stateful-timeout>\n" + "            <concurrency-management-type>Container</concurrency-management-type>\n" + "        </session>\n" + "    </enterprise-beans>\n" + "</ejb-jar>"), "META-INF/ejb-jar.xml");
    jar.add(EmptyAsset.INSTANCE, "META-INF/beans.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)306 Deployment (org.jboss.arquillian.container.test.api.Deployment)248 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)175 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)168 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)56 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)44 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)34 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)24 PropertyPermission (java.util.PropertyPermission)17 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)15 File (java.io.File)14 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)14 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 SocketPermission (java.net.SocketPermission)7 Properties (java.util.Properties)7 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)5 ServerPermission (org.jboss.as.server.security.ServerPermission)5