i am developing a Java EE application using JBoss EAP 6.1.
Using Arquillian to run tests i have always a null pointer exception while using methods injected in the test and i figured out that the ShrinkWrap cannot create the war folder with my classes.
This is my Arquillian shrink wrap that does not create the war folder.
@Deployment(name = "Test")
@OverProtocol("Servlet 3.0")
public static Archive<?> createDeployment() {
WebArchive archive = ShrinkWrap
.create(WebArchive.class, "test_archive.war")
.addClass(ArquillianTest.class)
.addPackages(true, "it.payroll.model")
.addPackages(true, "it.payroll.dao")
.addPackages(true, "it.payroll.controller")
.addAsResource("META-INF/persistence.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE,
ArchivePaths.create("beans.xml"));
archive.as(ZipExporter.class).exportTo(
new File("target/test_archive.war"), true);
return archive;
}
Thanks for any help.