}
return webArchive;
}
static private WebArchive createTestArchive(String entity) {
WebArchive war = ShrinkWrap.create(WebArchive.class, entity + ".war");
war.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
.loadReposFromPom("../external/pom.xml")
.artifact("org.jboss.solder:solder-impl")
.artifact("org.jboss.seam.security:seam-security")
.artifact("org.openid4java:openid4java-consumer:pom").exclusion("xerces:xercesImpl")
.artifact("nekohtml:nekohtml")
.artifact("org.apache:xmlsec")
.artifact("commons-httpclient:commons-httpclient")
.resolveAs(GenericArchive.class));
war.addAsLibraries(
ShrinkWrap.create(ZipImporter.class, "seam-security-external.jar")
.importFrom(new File("../external/target/seam-security-external.jar"))
.as(JavaArchive.class));
war.addAsWebInfResource("WEB-INF/" + entity + "-beans.xml", "beans.xml");
war.addAsWebInfResource("WEB-INF/" + entity + "-seam-beans.xml", "classes/META-INF/seam-beans.xml");
war.addAsWebInfResource("WEB-INF/context.xml", "context.xml");
war.addPackage(MetaDataLoader.class.getPackage());
if (entity.equals("sp")) {
war.addPackage(SpCustomizer.class.getPackage());
war.addAsWebInfResource("test_keystore.jks", "classes/test_keystore.jks");
} else if (entity.equals("idp")) {
war.addPackage(IdpCustomizer.class.getPackage());
war.addAsWebInfResource("test_keystore.jks", "classes/test_keystore.jks");
} else if (entity.equals("op")) {
war.addPackage(OpCustomizer.class.getPackage());
} else if (entity.equals("rp")) {
war.addPackage(RpCustomizer.class.getPackage());
}
return war;
}