Search in sources :

Example 56 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class MDBEJBRuntimeNameTestsCase method setup.

@Before
public void setup() throws Exception {
    adminSupport = JMSOperationsProvider.getInstance(managementClient);
    //Remote JMS - bind name... to make it available remotely, lookup original name.
    adminSupport.createJmsQueue(QUEUE_NAME, "java:jboss/exported/" + Constants.QUEUE_JNDI_NAME);
    JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, SUB_DEPLOYMENT_NAME);
    ejbJar.addPackage(BEAN_PACKAGE);
    ejbJar.setManifest(new StringAsset(Descriptors.create(ManifestDescriptor.class).attribute("Dependencies", "org.apache.activemq.artemis.ra").exportAsString()));
    EnterpriseArchive earArchive = ShrinkWrap.create(EnterpriseArchive.class, DEPLOYMENT_NAME);
    earArchive.addAsModule(ejbJar);
    ModelNode addDeploymentOp = new ModelNode();
    addDeploymentOp.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.DEPLOYMENT, DEPLOYMENT_NAME);
    addDeploymentOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD);
    addDeploymentOp.get(ModelDescriptionConstants.CONTENT).get(0).get(ModelDescriptionConstants.INPUT_STREAM_INDEX).set(0);
    addDeploymentOp.get(ModelDescriptionConstants.RUNTIME_NAME).set(RT_NAME);
    addDeploymentOp.get(ModelDescriptionConstants.AUTO_START).set(true);
    ModelNode deployOp = new ModelNode();
    deployOp.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.DEPLOY);
    deployOp.get(ModelDescriptionConstants.ADDRESS).add(ModelDescriptionConstants.DEPLOYMENT, DEPLOYMENT_NAME);
    deployOp.get(ModelDescriptionConstants.ENABLED).set(true);
    ModelNode[] steps = new ModelNode[2];
    steps[0] = addDeploymentOp;
    steps[1] = deployOp;
    ModelNode compositeOp = ModelUtil.createCompositeNode(steps);
    OperationBuilder ob = new OperationBuilder(compositeOp, true);
    ob.addInputStream(earArchive.as(ZipExporter.class).exportAsInputStream());
    ModelNode result = managementClient.getControllerClient().execute(ob.build());
    // just to blow up
    Assert.assertTrue("Failed to deploy: " + result, Operations.isSuccessfulOutcome(result));
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) OperationBuilder(org.jboss.as.controller.client.OperationBuilder) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ModelNode(org.jboss.dmr.ModelNode) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Before(org.junit.Before)

Example 57 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class SecurityDomainTestCase method getDeployment2.

@Deployment(name = "secured-servlet", managed = false)
public static Archive<?> getDeployment2() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "SecurityDomainTestCase.war");
    war.addClass(SecuredServlet.class);
    war.addAsWebInfResource(new StringAsset("<jboss-web><security-domain>test</security-domain></jboss-web>"), "jboss-web.xml");
    war.addAsWebInfResource(new StringAsset("<web-app version=\"2.5\"><login-config><auth-method>BASIC</auth-method></login-config></web-app>"), "web.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 58 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class JASPIHttpSchemeServerAuthModelTestCase method warDeployment.

@Deployment(name = "war")
public static WebArchive warDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war");
    final StringAsset usersRolesAsset = new StringAsset(Utils.createUsersFromRoles(Manage.ROLES_ALL));
    war.addAsResource(usersRolesAsset, "users.properties");
    war.addAsResource(usersRolesAsset, "roles.properties");
    war.addAsWebInfResource(JASPIHttpSchemeServerAuthModelTestCase.class.getPackage(), "web.xml", "/web.xml");
    war.addAsWebInfResource(Utils.getJBossWebXmlAsset(TEST_NAME), "jboss-web.xml");
    // temporary. remove once the security subsystem is updated to proper consider the module option
    war.addAsManifestResource(Utils.getJBossDeploymentStructure("org.wildfly.extension.undertow"), "jboss-deployment-structure.xml");
    war.add(new StringAsset("Welcome"), "index.jsp");
    war.add(new StringAsset("Unsecured"), "unsecured/index.jsp");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 59 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class JACCAuthzPropagationTestCase method warDeployment.

// Public methods --------------------------------------------------------
/**
     * Creates {@link WebArchive} deployment.
     */
@Deployment(name = "war")
public static WebArchive warDeployment() {
    LOGGER.trace("Start WAR deployment");
    final WebArchive war = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war");
    war.addClasses(PropagationTestServlet.class, Manage.class, BridgeBean.class, TargetBean.class);
    final StringAsset usersRolesAsset = new StringAsset(Utils.createUsersFromRoles(Manage.ROLES_ALL));
    war.addAsResource(usersRolesAsset, "users.properties");
    war.addAsResource(usersRolesAsset, "roles.properties");
    war.addAsWebInfResource(UsersRolesLoginModuleTestCase.class.getPackage(), "web-basic-authn.xml", "web.xml");
    war.addAsWebInfResource(Utils.getJBossWebXmlAsset(TEST_NAME), "jboss-web.xml");
    war.addAsWebInfResource(Utils.getJBossEjb3XmlAsset(TEST_NAME), "jboss-ejb3.xml");
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) UsersRolesLoginModuleTestCase(org.jboss.as.test.integration.security.loginmodules.UsersRolesLoginModuleTestCase) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 60 with StringAsset

use of org.jboss.shrinkwrap.api.asset.StringAsset in project wildfly by wildfly.

the class JACCTranslateServletDDTestCase method warDeployment.

// Public methods --------------------------------------------------------
/**
     * Creates {@link WebArchive}.
     *
     * @return
     */
@Deployment
public static WebArchive warDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, WEBAPP_NAME);
    war.addClass(ListJACCPoliciesServlet.class);
    war.addAsWebInfResource(JACCTranslateServletDDTestCase.class.getPackage(), "web-JACC11-example.xml", "web.xml");
    war.addAsWebInfResource(new StringAsset(//
    "<jboss-web>" + "<security-domain>" + SECURITY_DOMAIN_NAME + //
    "</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) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)319 Deployment (org.jboss.arquillian.container.test.api.Deployment)259 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)180 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)180 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)60 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)44 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)38 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)25 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)24 File (java.io.File)17 PropertyPermission (java.util.PropertyPermission)17 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)15 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 Test (org.junit.Test)8 SocketPermission (java.net.SocketPermission)7 Properties (java.util.Properties)7 Runner (org.apache.openejb.arquillian.tests.Runner)7