Search in sources :

Example 96 with StringAsset

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive)

Example 97 with StringAsset

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Hello(org.jboss.as.test.integration.security.common.ejb3.Hello) HelloBean(org.jboss.as.test.integration.security.common.ejb3.HelloBean) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 98 with StringAsset

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 99 with StringAsset

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 100 with StringAsset

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;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)306 Deployment (org.jboss.arquillian.container.test.api.Deployment)248 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)175 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)168 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)56 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)44 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)34 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)24 PropertyPermission (java.util.PropertyPermission)17 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)15 File (java.io.File)14 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)14 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)11 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)10 Util (org.jboss.as.test.shared.integration.ejb.security.Util)10 BeforeClass (org.junit.BeforeClass)8 SocketPermission (java.net.SocketPermission)7 Properties (java.util.Properties)7 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)5 ServerPermission (org.jboss.as.server.security.ServerPermission)5