Search in sources :

Example 91 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class MDB20TopicTestCase method getDeployment.

@Deployment
public static Archive getDeployment() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "MDB20TopicTestCase.jar");
    final String tempDir = TestSuiteEnvironment.getTmpDir();
    ejbJar.addClasses(EJB2xMDB.class, AbstractMDB2xTestCase.class);
    ejbJar.addPackage(JMSOperations.class.getPackage());
    ejbJar.addClasses(JmsQueueSetup.class, TimeoutUtil.class);
    ejbJar.addAsManifestResource(MDB20TopicTestCase.class.getPackage(), "ejb-jar-20-topic.xml", "ejb-jar.xml");
    ejbJar.addAsManifestResource(MDB20TopicTestCase.class.getPackage(), "jboss-ejb3-topic.xml", "jboss-ejb3.xml");
    ejbJar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, org.jboss.remoting, org.apache.activemq.artemis\n"), "MANIFEST.MF");
    ejbJar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read"), new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(tempDir + "/-", "read")), "jboss-permissions.xml");
    return ejbJar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) JMSOperations(org.jboss.as.test.integration.common.jms.JMSOperations) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 92 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class MDB20QueueTestCase method getDeployment.

@Deployment
public static Archive getDeployment() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "mdb.jar");
    ejbJar.addClasses(EJB2xMDB.class, AbstractMDB2xTestCase.class);
    ejbJar.addPackage(JMSOperations.class.getPackage());
    ejbJar.addClasses(JmsQueueSetup.class, TimeoutUtil.class);
    ejbJar.addAsManifestResource(MDB20QueueTestCase.class.getPackage(), "ejb-jar-20.xml", "ejb-jar.xml");
    ejbJar.addAsManifestResource(MDB20QueueTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
    ejbJar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, org.apache.activemq.artemis \n"), "MANIFEST.MF");
    ejbJar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read")), "jboss-permissions.xml");
    return ejbJar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) JMSOperations(org.jboss.as.test.integration.common.jms.JMSOperations) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 93 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class PooledEJBLifecycleTestCase method createDeployment.

// ----------------- DEPLOYMENTS ------------
// deploy Singleton bean. this will be deployed/managed by Arquillian outside of the test methods
@Deployment
public static JavaArchive createDeployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, SINGLETON_JAR);
    // this includes test case class, since package name is the same.
    archive.addClass(LifecycleTracker.class);
    archive.addClass(LifecycleTrackerBean.class);
    archive.addClass(TimeoutUtil.class);
    archive.addClass(PointlesMathInterface.class);
    archive.addClass(Constants.class);
    archive.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read")), "jboss-permissions.xml");
    return archive;
}
Also used : PropertyPermission(java.util.PropertyPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 94 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class RemoteAsyncInvocationTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar");
    jar.addPackage(RemoteAsyncInvocationTestCase.class.getPackage());
    jar.addClass(TimeoutUtil.class);
    jar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read")), "permissions.xml");
    return jar;
}
Also used : PropertyPermission(java.util.PropertyPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 95 with PropertyPermission

use of java.util.PropertyPermission in project wildfly by wildfly.

the class RunAsPrincipalTestCase method runAsDeployment.

@Deployment
public static Archive<?> runAsDeployment() {
    // using JavaArchive doesn't work, because of a bug in Arquillian, it only deploys wars properly
    final WebArchive war = ShrinkWrap.create(WebArchive.class, DEPLOYMENT + ".war").addPackage(WhoAmI.class.getPackage()).addClass(SimpleSingletonBean.class).addClass(StatelessSingletonUseBean.class).addClass(Util.class).addClass(Entry.class).addClass(RunAsPrincipalTestCase.class).addClass(TestLogHandlerSetupTask.class).addClass(LoggingUtil.class).addClasses(AbstractSecurityDomainSetup.class, EjbSecurityDomainSetup.class).addAsWebInfResource(RunAsPrincipalTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client,org.jboss.dmr\n"), "MANIFEST.MF").addAsManifestResource(createPermissionsXmlAsset(new ElytronPermission("getSecurityDomain"), new PropertyPermission("jboss.server.log.dir", "read"), PermissionUtils.createFilePermission("read", "standalone", "log", TEST_LOG_FILE_NAME), new ElytronPermission("authenticate"), new ElytronPermission("getIdentity"), new ElytronPermission("createAdHocIdentity"), new ChangeRoleMapperPermission("ejb"), new ElytronPermission("setRunAsPrincipal")), "permissions.xml");
    war.addPackage(CommonCriteria.class.getPackage());
    return war;
}
Also used : TestLogHandlerSetupTask(org.jboss.as.test.shared.TestLogHandlerSetupTask) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) CommonCriteria(org.jboss.as.test.categories.CommonCriteria) StatelessSingletonUseBean(org.jboss.as.test.integration.ejb.security.runasprincipal.transitive.StatelessSingletonUseBean) ElytronPermission(org.wildfly.security.permission.ElytronPermission) ChangeRoleMapperPermission(org.wildfly.security.auth.permission.ChangeRoleMapperPermission) AbstractSecurityDomainSetup(org.jboss.as.test.integration.security.common.AbstractSecurityDomainSetup) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

PropertyPermission (java.util.PropertyPermission)99 Deployment (org.jboss.arquillian.container.test.api.Deployment)49 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)46 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)35 FilePermission (java.io.FilePermission)23 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)18 SocketPermission (java.net.SocketPermission)13 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)13 Permission (java.security.Permission)10 AccessControlException (java.security.AccessControlException)8 RemotingPermission (org.jboss.remoting3.security.RemotingPermission)8 PermissionCollection (java.security.PermissionCollection)7 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)7 ReflectPermission (java.lang.reflect.ReflectPermission)6 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)6 Permissions (java.security.Permissions)5 SecurityPermission (java.security.SecurityPermission)5 AccessControlContext (java.security.AccessControlContext)4 TimeoutUtil (org.jboss.as.test.shared.TimeoutUtil)4 Method (java.lang.reflect.Method)3