use of org.jboss.arquillian.container.test.api.Deployment in project wildfly by wildfly.
the class AuthenticationTestCase method deployment.
/*
* Authentication Scenarios
*
* Client -> Bean
* Client -> Bean -> Bean
* Client -> Bean (Re-auth) -> Bean
* Client -> Servlet -> Bean
* Client -> Servlet (Re-auth) -> Bean
* Client -> Servlet -> Bean -> Bean
* Client -> Servlet -> Bean (Re Auth) -> Bean
*/
@Deployment
public static Archive<?> deployment() {
final Package currentPackage = AuthenticationTestCase.class.getPackage();
// using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
final WebArchive war = ShrinkWrap.create(WebArchive.class, "ejb3security.war").addPackage(WhoAmIBean.class.getPackage()).addPackage(EntryBean.class.getPackage()).addClass(WhoAmI.class).addClass(Util.class).addClass(Entry.class).addClasses(WhoAmIServlet.class, AuthenticationTestCase.class).addClasses(AbstractSecurityDomainSetup.class, EjbElytronDomainSetup.class).addClass(TestSuiteEnvironment.class).addAsResource(currentPackage, "users.properties", "users.properties").addAsResource(currentPackage, "roles.properties", "roles.properties").addAsWebInfResource(currentPackage, "web.xml", "web.xml").addAsWebInfResource(currentPackage, "jboss-web.xml", "jboss-web.xml").addAsWebInfResource(currentPackage, "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Manifest-Version: 1.0\nDependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(// login module needs to modify principal to commit logging in
new AuthPermission("modifyPrincipals"), // AuthenticationTestCase#testAuthenticatedCall calls org.jboss.security.client.JBossSecurityClient#performSimpleLogin
new RuntimePermission("org.jboss.security.getSecurityContext"), new RuntimePermission("org.jboss.security.SecurityContextFactory.createSecurityContext"), new RuntimePermission("org.jboss.security.SecurityContextFactory.createUtil"), new RuntimePermission("org.jboss.security.plugins.JBossSecurityContext.setSubjectInfo"), new RuntimePermission("org.jboss.security.setSecurityContext"), // AuthenticationTestCase#execute calls ExecutorService#shutdownNow
new RuntimePermission("modifyThread"), // AuthenticationTestCase#execute calls sun.net.www.http.HttpClient#openServer under the hood
new SocketPermission(SERVER_HOST_PORT, "connect,resolve"), // TestSuiteEnvironment reads system properties
new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("jboss.http.port", "read")), "permissions.xml");
war.addPackage(CommonCriteria.class.getPackage());
return war;
}
use of org.jboss.arquillian.container.test.api.Deployment in project wildfly by wildfly.
the class BatchSubsystemSecurityTestCase method createDeployment.
@Deployment
public static Archive<?> createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "batch-test.jar");
jar.addClasses(AbstractElytronSetupTask.class, SecurityDomainSettingEJB.class, TimeoutUtil.class, IdentityBatchlet.class, FailingBatchlet.class, LongRunningBatchlet.class);
jar.addAsManifestResource(BatchSubsystemSecurityTestCase.class.getPackage(), "assert-identity.xml", "batch-jobs/assert-identity.xml");
jar.addAsManifestResource(BatchSubsystemSecurityTestCase.class.getPackage(), "failing-batchlet.xml", "batch-jobs/failing-batchlet.xml");
jar.addAsManifestResource(BatchSubsystemSecurityTestCase.class.getPackage(), "long-running-batchlet.xml", "batch-jobs/long-running-batchlet.xml");
jar.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
jar.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new AllPermission()), "permissions.xml");
return jar;
}
use of org.jboss.arquillian.container.test.api.Deployment in project wildfly by wildfly.
the class AltDDTestCase method deployment.
@Deployment
public static Archive<?> deployment() {
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "altdd.ear");
ear.addAsManifestResource(AltDDTestCase.class.getPackage(), "application.xml", "application.xml");
ear.addAsResource(AltDDTestCase.class.getPackage(), "alt-ejb-jar.xml", "alt-ejb-jar.xml");
final JavaArchive ejbs = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
ejbs.addClasses(AltDDTestCase.class, AltDDEjb.class);
ejbs.addAsManifestResource(AltDDTestCase.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml");
ear.addAsModule(ejbs);
return ear;
}
use of org.jboss.arquillian.container.test.api.Deployment in project wildfly by wildfly.
the class SimpleApplicationClientTestCase method deploy.
@Deployment(testable = false)
public static Archive<?> deploy() {
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, APP_NAME + ".ear");
final JavaArchive lib = ShrinkWrap.create(JavaArchive.class, "lib.jar");
lib.addClasses(AppClientSingletonRemote.class, AppClientWrapper.class, CallbackHandler.class);
ear.addAsLibrary(lib);
final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
ejb.addClasses(SimpleApplicationClientTestCase.class, AppClientStateSingleton.class);
ear.addAsModule(ejb);
final JavaArchive appClient = ShrinkWrap.create(JavaArchive.class, "client-annotation.jar");
appClient.addClasses(AppClientMain.class);
appClient.addAsManifestResource(new StringAsset("Main-Class: " + AppClientMain.class.getName() + "\n"), "MANIFEST.MF");
ear.addAsModule(appClient);
final JavaArchive clientDD = ShrinkWrap.create(JavaArchive.class, "client-dd.jar");
clientDD.addClasses(DescriptorClientMain.class);
clientDD.addAsManifestResource(new StringAsset("Main-Class: " + DescriptorClientMain.class.getName() + "\n"), "MANIFEST.MF");
clientDD.addAsManifestResource(SimpleApplicationClientTestCase.class.getPackage(), "application-client.xml", "application-client.xml");
ear.addAsModule(clientDD);
final JavaArchive clientOverride = ShrinkWrap.create(JavaArchive.class, "client-override.jar");
clientOverride.addClasses(DescriptorClientMain.class);
clientOverride.addAsManifestResource(new StringAsset("Main-Class: " + DescriptorClientMain.class.getName() + "\n"), "MANIFEST.MF");
clientOverride.addAsManifestResource(SimpleApplicationClientTestCase.class.getPackage(), "application-client.xml", "application-client.xml");
clientOverride.addAsManifestResource(SimpleApplicationClientTestCase.class.getPackage(), "jboss-client.xml", "jboss-client.xml");
clientOverride.addAsManifestResource(SimpleApplicationClientTestCase.class.getPackage(), "wildfly-config.xml", "wildfly-config.xml");
ear.addAsModule(clientOverride);
archive = ear;
return ear;
}
use of org.jboss.arquillian.container.test.api.Deployment in project wildfly by wildfly.
the class JCETestCase method deployment.
@Deployment
public static Archive<?> deployment() throws Exception {
final JavaArchive jce = ShrinkWrap.create(JavaArchive.class, "jcetest.jar").addPackage(DummyProvider.class.getPackage());
final File jceJar = new File("jcetest.jar");
jce.as(ZipExporter.class).exportTo(jceJar, true);
final File signedJceJar = new File("jcetestsigned.jar");
JavaArchive signedJce;
if (isJCETestable()) {
// see genkey-jcetest-keystore in pom.xml for the keystore creation
final JarSignerUtil signer = new JarSignerUtil(new File("../jcetest.keystore"), "password", "password", /* alias */
"test");
signer.sign(jceJar, signedJceJar);
signer.verify(signedJceJar);
signedJce = ShrinkWrap.create(ZipImporter.class, "jcetestsigned.jar").importFrom(signedJceJar).as(JavaArchive.class);
} else {
log.trace("skipping the test since it can run on Oracle JDK only");
signedJce = jce;
}
final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war").addClasses(ControllerServlet.class);
final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "jcetest.ear").addAsLibrary(signedJce).addAsModule(war).addAsManifestResource(JCETestCase.class.getPackage(), "jboss-deployment-structure.xml", "jboss-deployment-structure.xml");
// ControllerServlet and DummyProvider need the following perms for their "dirty" game
ear.addAsManifestResource(createPermissionsXmlAsset(new FilePermission("../jcetest.keystore", "read"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks"), new RuntimePermission("accessClassInPackage.sun.security.validator"), new SecurityPermission("putProviderProperty.DP"), new SecurityPermission("insertProvider"), new RuntimePermission("getProtectionDomain")), "permissions.xml");
return ear;
}
Aggregations