Skip to content

Instantly share code, notes, and snippets.

@milenkovicm
Created March 14, 2012 11:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milenkovicm/2035949 to your computer and use it in GitHub Desktop.
Save milenkovicm/2035949 to your computer and use it in GitHub Desktop.
[Junit] Arquillian - how to export shrinkwrap archive
@RunWith(Arquillian.class)
public class WarSmokeTest {
@Deployment
public static Archive<?> createTestArchive() {
final MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class).loadMetadataFromPom("pom.xml");
final WebArchive archive = ShrinkWrap.create(WebArchive.class)
.addAsWebInfResource("META-INF/beans.xml")
///
.addAsResource("simple.property", "simple.property")
;
archive.as(ZipExporter.class).exportTo(new File("/" + archive.getName()), true);
return archive;
}
@Test
public void test() {
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment