Search in sources :

Example 41 with StringAsset

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;
}
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 42 with StringAsset

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;
}
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 43 with StringAsset

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

Example 44 with StringAsset

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

Example 45 with StringAsset

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;
}
Also used : HttpRequest(org.jboss.as.test.integration.common.HttpRequest) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Application(javax.ws.rs.core.Application) 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