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));
}
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;
}
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;
}
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;
}
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;
}
Aggregations