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