use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class DefaultTransactionTimeoutTestCase method createDeployment.
@Deployment
public static Archive<?> createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test-ejb-cmt-timeout.jar");
// a manifest must have a \n at the end or else it'll not be properly process
// here we hack one in place
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.jts \n"), "MANIFEST.MF");
jar.addClass(BeanWithTimeoutValue.class);
jar.addClass(TimeoutRemoteView.class);
jar.addClass(TimeoutLocalView.class);
jar.addAsManifestResource(DefaultTransactionTimeoutTestCase.class.getPackage(), "jboss-ejb3-default-timeout.xml", "jboss-ejb3.xml");
return jar;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class TransactionTimeoutTestCase method createDeployment.
@Deployment
public static Archive<?> createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test-ejb-cmt-timeout.jar");
// a manifest must have a \n at the end or else it'll not be properly process
// here we hack one in place
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.jts \n"), "MANIFEST.MF");
jar.addClass(BeanWithTimeoutValue.class);
jar.addClass(TimeoutRemoteView.class);
jar.addClass(TimeoutLocalView.class);
jar.addAsManifestResource(TransactionTimeoutTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
jar.addAsManifestResource(TransactionTimeoutTestCase.class.getPackage(), "jboss.properties", "jboss.properties");
return jar;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class Hibernate4NativeAPIProviderTestCase method deploy.
@Deployment
public static Archive<?> deploy() throws Exception {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
// add required jars as manifest dependencies
ear.addAsManifestResource(new StringAsset("Dependencies: org.hibernate, org.javassist\n"), "MANIFEST.MF");
JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
lib.addClasses(SFSBHibernateSessionFactory.class);
ear.addAsModule(lib);
lib = ShrinkWrap.create(JavaArchive.class, "entities.jar");
lib.addClasses(Student.class);
lib.addAsResource(new StringAsset(testmapping), "testmapping.hbm.xml");
lib.addAsResource(new StringAsset(hibernate_cfg), "hibernate.cfg.xml");
ear.addAsLibraries(lib);
final WebArchive main = ShrinkWrap.create(WebArchive.class, "main.war");
main.addClasses(Hibernate4NativeAPIProviderTestCase.class);
ear.addAsModule(main);
// add application dependency on H2 JDBC driver, so that the Hibernate classloader (same as app classloader)
// will see the H2 JDBC driver.
// equivalent hack for use of shared Hiberante module, would be to add the H2 dependency directly to the
// shared Hibernate module.
// also add dependency on org.slf4j
ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure>" + " <deployment>" + " <dependencies>" + " <module name=\"com.h2database.h2\" />" + " <module name=\"org.slf4j\"/>" + " </dependencies>" + " </deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
return ear;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class HibernateNativeAPITransactionTestCase method deploy.
@Deployment
public static Archive<?> deploy() throws Exception {
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, ARCHIVE_NAME + ".ear");
// add required jars as manifest dependencies
ear.addAsManifestResource(new StringAsset("Dependencies: org.hibernate, org.javassist\n"), "MANIFEST.MF");
JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "beans.jar");
lib.addClasses(SFSBHibernateTransaction.class);
ear.addAsModule(lib);
lib = ShrinkWrap.create(JavaArchive.class, "entities.jar");
lib.addClasses(Student.class);
lib.addAsResource(new StringAsset(testmapping), "testmapping.hbm.xml");
lib.addAsResource(new StringAsset(hibernate_cfg), "hibernate.cfg.xml");
ear.addAsLibraries(lib);
final WebArchive main = ShrinkWrap.create(WebArchive.class, "main.war");
main.addClasses(HibernateNativeAPITransactionTestCase.class);
ear.addAsModule(main);
// add application dependency on H2 JDBC driver, so that the Hibernate classloader (same as app classloader)
// will see the H2 JDBC driver.
// equivalent hack for use of shared Hiberante module, would be to add the H2 dependency directly to the
// shared Hibernate module.
// also add dependency on org.slf4j
ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure>" + " <deployment>" + " <dependencies>" + " <module name=\"com.h2database.h2\" />" + " <module name=\"org.slf4j\"/>" + " </dependencies>" + " </deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
return ear;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class CdiDecoratorRootResourceTestCase method deploy.
@Deployment(testable = false)
public static Archive<?> deploy() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "jaxrsapp.war");
war.addPackage(HttpRequest.class.getPackage());
war.addPackage(CdiDecoratorRootResourceTestCase.class.getPackage());
war.addAsWebInfResource(WebXml.get("<servlet-mapping>\n" + " <servlet-name>" + Application.class.getName() + "</servlet-name>\n" + " <url-pattern>/rest/*</url-pattern>\n" + " </servlet-mapping>\n" + "\n"), "web.xml");
war.addAsWebInfResource(new StringAsset("<beans><decorators><class>" + ResourceDecorator.class.getName() + "</class></decorators></beans>"), "beans.xml");
return war;
}
Aggregations