use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class UsersRolesLoginModuleTestCase method createWar.
/**
* Creates {@link WebArchive} (WAR) for given deployment name.
*
* @param deployment
* @return
*/
private static WebArchive createWar(final String deployment, Coding coding) {
LOGGER.trace("Starting deployment " + deployment);
final String users = ANIL + "=" + Utils.hashMD5(ANIL_PWD, coding) + "\n" + MARCUS + "=" + Utils.hashMD5(MARCUS_PWD, coding);
final WebArchive war = ShrinkWrap.create(WebArchive.class, deployment + ".war");
war.addClasses(SimpleSecuredServlet.class, SimpleServlet.class);
war.addAsWebInfResource(UsersRolesLoginModuleTestCase.class.getPackage(), "web-basic-authn.xml", "web.xml");
war.addAsResource(new StringAsset(users), "users.properties");
war.addAsResource(new StringAsset(ROLES), "roles.properties");
war.addAsWebInfResource(new StringAsset(//
"<jboss-web>" + "<security-domain>" + deployment + //
"</security-domain>" + "</jboss-web>"), "jboss-web.xml");
return war;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class EjbXACMLAuthorizationModuleTestCase method createJar.
// Private methods -------------------------------------------------------
/**
* Creates JAR with the EJB for the test deployment.
*
* @param archiveName
* @param securityDomainName
* @return
*/
private static JavaArchive createJar(final String archiveName, final String securityDomainName) {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, archiveName).addClasses(HelloBean.class, Hello.class, CustomXACMLAuthorizationModule.class).addAsResource(new StringAsset("jduke=theduke\nJohnDoe=jdoe"), "users.properties").addAsResource(new StringAsset("jduke=TestRole,TestRole2\nJohnDoe=TestRole"), "roles.properties").addAsResource(EjbXACMLAuthorizationModuleTestCase.class.getPackage(), XACMLTestUtils.TESTOBJECTS_CONFIG + "/jbossxacml-config.xml", "jbossxacml-config.xml").addAsResource(EjbXACMLAuthorizationModuleTestCase.class.getPackage(), XACMLTestUtils.TESTOBJECTS_POLICIES + "/ejb-xacml-policy.xml", "xacml-policy.xml").addAsManifestResource(EjbXACMLAuthorizationModuleTestCase.class.getPackage(), XACMLTestUtils.TESTOBJECTS_CONFIG + "/jboss-ejb3.xml", "jboss-ejb3.xml");
XACMLTestUtils.addJBossDeploymentStructureToArchive(jar);
jar.addClasses(AbstractSecurityDomainsServerSetupTask.class);
return jar;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class SAML2BasicAuthenticationTestCase method deploymentIdP.
@Deployment(name = IDP)
public static WebArchive deploymentIdP() {
LOGGER.trace("Start deployment " + IDP);
final WebArchive war = ShrinkWrap.create(WebArchive.class, IDP + ".war");
war.addAsResource(new StringAsset(PicketLinkTestBase.USERS), "users.properties");
war.addAsResource(new StringAsset(PicketLinkTestBase.ROLES), "roles.properties");
war.addAsWebInfResource(SAML2BasicAuthenticationTestCase.class.getPackage(), "web.xml", "web.xml");
war.addAsWebInfResource(Utils.getJBossWebXmlAsset("idp", "org.picketlink.identity.federation.bindings.tomcat.idp.IDPWebBrowserSSOValve"), "jboss-web.xml");
war.addAsManifestResource(Utils.getJBossDeploymentStructure("org.picketlink"), "jboss-deployment-structure.xml");
war.addAsWebInfResource(new StringAsset(PicketLinkTestBase.propertiesReplacer("picketlink-idp.xml", IDP, "", IDP_CONTEXT_PATH)), "picketlink.xml");
war.add(new StringAsset("Welcome to IdP"), "index.jsp");
war.add(new StringAsset("Welcome to IdP hosted"), "hosted/index.jsp");
return war;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class SAML2BasicAuthenticationTestCase method deploymentSP1.
@Deployment(name = SP1)
public static WebArchive deploymentSP1() {
LOGGER.trace("Start deployment " + SP1);
final WebArchive war = ShrinkWrap.create(WebArchive.class, SP1 + ".war");
war.addAsWebInfResource(SAML2BasicAuthenticationTestCase.class.getPackage(), "web.xml", "web.xml");
war.addAsWebInfResource(Utils.getJBossWebXmlAsset("sp", "org.picketlink.identity.federation.bindings.tomcat.sp.ServiceProviderAuthenticator"), "jboss-web.xml");
war.addAsManifestResource(Utils.getJBossDeploymentStructure("org.picketlink"), "jboss-deployment-structure.xml");
war.addAsWebInfResource(new StringAsset(PicketLinkTestBase.propertiesReplacer("picketlink-sp.xml", SP1, "POST", IDP_CONTEXT_PATH)), "picketlink.xml");
war.add(new StringAsset("Welcome to SP1"), "index.jsp");
return war;
}
use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.
the class SAML2BasicAuthenticationTestCase method deploymentSP2.
@Deployment(name = SP2)
public static WebArchive deploymentSP2() {
LOGGER.trace("Start deployment " + SP2);
final WebArchive war = ShrinkWrap.create(WebArchive.class, SP2 + ".war");
war.addAsWebInfResource(SAML2BasicAuthenticationTestCase.class.getPackage(), "web.xml", "web.xml");
war.addAsWebInfResource(Utils.getJBossWebXmlAsset("sp", "org.picketlink.identity.federation.bindings.tomcat.sp.ServiceProviderAuthenticator"), "jboss-web.xml");
war.addAsManifestResource(Utils.getJBossDeploymentStructure("org.picketlink"), "jboss-deployment-structure.xml");
war.addAsWebInfResource(new StringAsset(PicketLinkTestBase.propertiesReplacer("picketlink-sp.xml", SP2, "REDIRECT", IDP_CONTEXT_PATH)), "picketlink.xml");
war.add(new StringAsset("Welcome to SP2"), "index.jsp");
return war;
}
Aggregations