Search in sources :

Example 31 with PropertyPermission

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

the class ResourceAdapterNameTestCase method getDeployment.

@Deployment
public static Archive getDeployment() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "resource-adapter-name-mdb-test.jar");
    ejbJar.addClasses(OverriddenResourceAdapterNameMDB.class, JMSMessagingUtil.class, ResourceAdapterNameTestCase.class, JmsQueueSetup.class, TimeoutUtil.class);
    ejbJar.addPackage(JMSOperations.class.getPackage());
    ejbJar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr \n"), "MANIFEST.MF");
    ejbJar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission(TimeoutUtil.FACTOR_SYS_PROP, "read")), "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 32 with PropertyPermission

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

the class MDBWhichDependsOnTestCase method getTestArchive.

@Deployment(name = Constants.DEPLOYMENT_NAME_COUNTER, order = 0, managed = true, testable = true)
public static Archive<?> getTestArchive() throws Exception {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, Constants.DEPLOYMENT_JAR_NAME_COUNTER);
    jar.addClass(CallCounterSingleton.class);
    jar.addClass(MDBWhichDependsOnTestCase.class);
    jar.addClass(Constants.class);
    jar.addClasses(JMSMessagingUtil.class, TimeoutUtil.class);
    jar.addClasses(JmsQueueServerSetupTask.class, SetupModuleServerSetupTask.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, " + Constants.TEST_MODULE_NAME_FULL + "\n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission(TimeoutUtil.FACTOR_SYS_PROP, "read")), "permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 33 with PropertyPermission

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

the class JSFDeploymentProcessorTestCase method createDeployment1.

/**
 * Creates a war with all the libraries needed in the war/lib folder, this sample does not call the
 * ejb as it is not necessary to test if the bundled Jakarta Server Faces is loaded
 * @return
 */
@Deployment(name = WEB_BUNDLED_JSF, testable = false, managed = false)
public static EnterpriseArchive createDeployment1() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, WEB_BUNDLED_JSF + ".ear");
    ear.addAsManifestResource(JSFDeploymentProcessorTestCase.class.getPackage(), WEB_BUNDLED_JSF + "-application.xml", "application.xml");
    ear.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader"), new RuntimePermission("accessDeclaredMembers"), new PropertyPermission("*", "read"), new FilePermission("/-", "read")), "permissions.xml");
    JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "bundled-jsf-ejb.jar");
    ejb.addClasses(JSFMyFacesEJB.class);
    // add the ejb
    ear.addAsModule(ejb);
    final WebArchive war = ShrinkWrap.create(WebArchive.class, WEB_BUNDLED_JSF + "-webapp.war");
    war.addClasses(JSFMyFaces.class);
    war.addAsWebResource(JSFVersion.class.getPackage(), "jsfmyfacesversion.xhtml", "jsfmyfacesversion.xhtml");
    war.addAsWebInfResource(JSFVersion.class.getPackage(), WEB_BUNDLED_JSF_WEB_XML, "web.xml");
    // add Jakarta Server Faces as webapp lib
    war.addAsLibrary("myfaces/commons-beanutils-1.9.3.jar", "commons-beanutils-1.9.3.jar");
    war.addAsLibrary("myfaces/commons-collections-3.2.2.jar", "commons-collections-3.2.2.jar");
    war.addAsLibrary("myfaces/commons-digester-1.8.jar", "commons-digester-1.8.jar");
    war.addAsLibrary("myfaces/myfaces-api-2.0.24.jar", "myfaces-api-2.0.24.jar");
    war.addAsLibrary("myfaces/myfaces-impl-2.0.24.jar", "myfaces-impl-2.0.24.jar");
    // add the .war
    ear.addAsModule(war);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JSFVersion(org.jboss.as.test.integration.jsf.version.war.JSFVersion) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 34 with PropertyPermission

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

the class RemoteEJB2ClientStatefulBeanFailoverDDTestCase method createDeployment.

private static Archive<?> createDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(CounterRemote.class.getPackage());
    jar.addClass(CounterBeanDD.class);
    jar.addClass(NodeNameGetter.class);
    jar.addAsManifestResource(RemoteEJB2ClientStatefulBeanFailoverDDTestCase.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml");
    jar.addAsManifestResource(new StringAsset("Dependencies: deployment." + MODULE_NAME_SINGLE + ".jar\n"), "MANIFEST.MF");
    jar.addAsResource(createPermissionsXmlAsset(new PropertyPermission("jboss.node.name", "read")), "META-INF/jboss-permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) CounterRemote(org.jboss.as.test.clustering.cluster.ejb2.stateful.failover.bean.shared.CounterRemote) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 35 with PropertyPermission

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

the class RemoteStatelessFailoverTestCase method createDeployment.

private static Archive<?> createDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
    jar.addPackage(StatelessRemote.class.getPackage());
    jar.addClass(StatelessBean.class);
    jar.addClass(NodeNameGetter.class);
    jar.addAsResource(createPermissionsXmlAsset(new PropertyPermission("jboss.node.name", "read")), "META-INF/jboss-permissions.xml");
    return jar;
}
Also used : StatelessRemote(org.jboss.as.test.clustering.cluster.ejb2.stateless.bean.StatelessRemote) PropertyPermission(java.util.PropertyPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Aggregations

PropertyPermission (java.util.PropertyPermission)98 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