-
1. Re: @Inject across WAR and JAR
aslak Mar 20, 2012 11:49 AM (in response to gboro54)It shouldn't be required.
Can you copy/paste your deploy method ?
-
2. Re: @Inject across WAR and JAR
gboro54 Mar 20, 2012 1:08 PM (in response to aslak)Here is my code for the deployment:
{code}
public static JavaArchive getEJBJar() {
JavaArchive imported = DependencyResolvers
.use(MavenDependencyResolver.class)
.goOffline()
.artifact(
"com.example:example-common:0.0.1-SNAPSHOT")
.resolveAs(JavaArchive.class).iterator().next();
JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "common.jar")
.merge(imported).addAsManifestResource("test-ds.xml");
return ja;
}
@Deployment(order = 2, name = "build_ear")
public static EnterpriseArchive buildTestableArchive() {
WebArchive web = ShrinkWrap
.create(WebArchive.class, "mtd.war")
.addClasses(RuleCompilationTest.class, AbstractBaseTest.class)
.addAsWebInfResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"))
.addAsWebInfResource("web.xml")
return ShrinkWrap
.create(EnterpriseArchive.class, "core-test.ear")
.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
.includeDependenciesFromPom("pom.xml")
.goOffline().resolveAs(JavaArchive.class))
.addAsModule(web).addAsModule(getEJBJar())
.setApplicationXML("application.xml");
}
{code} -
3. Re: @Inject across WAR and JAR
gboro54 Mar 21, 2012 7:50 AM (in response to gboro54)Am I doing anything wrong with my deploy methods? I can't even seem to inject BeanManager. Do I need to do something else to setup my beans.xml in this case(I have tried doing a copy of a blank one as well)
-
4. Re: @Inject across WAR and JAR
gboro54 Mar 21, 2012 9:29 AM (in response to gboro54)I have attached my whole test case to be sure I am doing this correctly. Can anyone provide insight?
-
TestCase.java.zip 1.2 KB
-
-
5. Re: @Inject across WAR and JAR
gboro54 Mar 21, 2012 10:36 AM (in response to gboro54)I figured it out. I am using Arquillian to deploy a driver as well. In this case you need to specify which deployment the test should run against.