-
1. Re: Deploy a war dependency as part of an arquillian run
aslak Mar 1, 2012 5:28 PM (in response to tomjenkinson)/* if you're not really doing in container testing you can add testable = false */ @Deployment(name = "dep", order = 1 ) public static JavaArchive jar() {...} @Deployment(order = 2) public static WebArchive war() {...} @Test // will default to @OperatesOnDeployment with Default name (the one not named) public void should() {..}
-
2. Re: Deploy a war dependency as part of an arquillian run
aslak Mar 1, 2012 5:34 PM (in response to aslak)Missread your message a bit... same principle as the solution above (tho a WebArchive instead of a JavaArchive), but i guess the question is, how do you package a app outside of your module ?
Couple of options comes to mind:
* Using the new ShrinkWrap Resolver (soon to be released) you can package war1 based on maven cordinates and resolve it directly from workspace or maven repo depending on how it's being ran.
* You could package it based on File ref outside of your module, e.g. addAsResource(new File("../war1/src/main/webapp"))
* If war2 depend on war1 in maven wise, you can just create it using normal shrinkwrap stuff, or potentially introduce a 3 module that depend on them both where this test lives.
-
3. Re: Deploy a war dependency as part of an arquillian run
tomjenkinson Mar 2, 2012 1:35 AM (in response to aslak)Thanks Aslak,
A few time sensitive issues have popped up since I posted this but one thing I want to try is:
@Deployment public static Archive createTestArchive() { MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class) .loadMetadataFromPom("pom.xml"); return ShrinkWrap.create(EnterpriseArchive.class, "test.ear") .addClasses(War2EJB.class) .addAsLibraries(resolver.artifact("foo:war1").resolveAsFiles()); }
Do you think something like that might work, where foo:war1 resolves to a dependent .war? I guess I might have to provide an application.xml programmatically too (Maven builds it atm).
I will try it once I have cleared a few issues.
Thanks again for the feedback,
Tom
-
4. Re: Deploy a war dependency as part of an arquillian run
aslak Mar 2, 2012 4:30 AM (in response to tomjenkinson)Yea, that should work.
(you can't add Classes to a EAR, but beyond that..
-
5. Re: Deploy a war dependency as part of an arquillian run
tomjenkinson Mar 2, 2012 4:57 AM (in response to aslak)Thanks Aslak, I will let you know how I get on.