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