Search in sources :

Example 11 with ReflectPermission

use of java.lang.reflect.ReflectPermission in project wildfly by wildfly.

the class FlushOperationsTestCase method deployment.

@Deployment
public static JavaArchive deployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "flush-operations.jar");
    archive.addClass(FlushOperationsTestCase.class);
    archive.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, " + "org.jboss.as.controller, " + "org.jboss.dmr, " + "org.jboss.ironjacamar.jdbcadapters, " + "org.jboss.remoting\n"), "MANIFEST.MF");
    archive.addAsManifestResource(createPermissionsXmlAsset(// ModelControllerClient needs the following
    new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), // flushInvalidConnectionsInPool needs the following
    new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
    return archive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) ReflectPermission(java.lang.reflect.ReflectPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 12 with ReflectPermission

use of java.lang.reflect.ReflectPermission in project wildfly by wildfly.

the class AbstractDatasourceCapacityPoliciesTestCase method createDeployment.

@Deployment
public static Archive<?> createDeployment() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "jca-capacity-test.jar");
    jar.addClasses(JcaMgmtBase.class, ManagementOperations.class, ContainerResourceMgmtTestBase.class, AbstractMgmtTestBase.class, JcaMgmtServerSetupTask.class, MgmtOperationException.class, AbstractDatasourceCapacityPoliciesTestCase.class, DatasourceCapacityPoliciesTestCase.class, JcaTestsUtil.class, TimeoutUtil.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api,org.jboss.as.connector," + "org.jboss.as.controller,org.jboss.dmr,org.jboss.staxmapper," + "org.jboss.ironjacamar.impl, org.jboss.ironjacamar.jdbcadapters,org.jboss.remoting\n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read"), new PropertyPermission("ts.timeout.factor", "read"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks")), "permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) ReflectPermission(java.lang.reflect.ReflectPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 13 with ReflectPermission

use of java.lang.reflect.ReflectPermission in project wildfly by wildfly.

the class LongRunningThreadsCheckTestCase method createDeployment.

/**
 * Define the deployment
 *
 * @return The deployment archive
 */
@Deployment
public static EnterpriseArchive createDeployment() {
    JavaArchive ja = ShrinkWrap.create(JavaArchive.class, "wm.jar");
    ja.addPackage(MultipleConnectionFactory1.class.getPackage()).addClasses(LongRunningThreadsCheckTestCase.class, JcaMgmtServerSetupTask.class, JcaMgmtBase.class, JcaTestsUtil.class);
    ja.addPackage(AbstractMgmtTestBase.class.getPackage());
    ja.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.connector, org.jboss.ironjacamar.api, org.jboss.threads"), "MANIFEST.MF");
    ResourceAdapterArchive ra1 = ShrinkWrap.create(ResourceAdapterArchive.class, "wm1.rar");
    ra1.addAsManifestResource(LongRunningThreadsCheckTestCase.class.getPackage(), "ra.xml", "ra.xml").addAsManifestResource(LongRunningThreadsCheckTestCase.class.getPackage(), "ironjacamar1.xml", "ironjacamar.xml");
    ResourceAdapterArchive ra2 = ShrinkWrap.create(ResourceAdapterArchive.class, "wm2.rar");
    ra2.addAsManifestResource(LongRunningThreadsCheckTestCase.class.getPackage(), "ra.xml", "ra.xml").addAsManifestResource(LongRunningThreadsCheckTestCase.class.getPackage(), "ironjacamar2.xml", "ironjacamar.xml");
    EnterpriseArchive ea = ShrinkWrap.create(EnterpriseArchive.class, "wm.ear");
    ea.addAsLibrary(ja).addAsModule(ra1).addAsModule(ra2);
    ea.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks")), "permissions.xml");
    return ea;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) AbstractMgmtTestBase(org.jboss.as.test.integration.management.base.AbstractMgmtTestBase) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) ReflectPermission(java.lang.reflect.ReflectPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 14 with ReflectPermission

use of java.lang.reflect.ReflectPermission in project wildfly by wildfly.

the class ResourceAdapterPoolAttributesTestCase method createResourceAdapter.

@Deployment
public static Archive<?> createResourceAdapter() {
    ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, RA_NAME);
    rar.addAsManifestResource(LazyResourceAdapter.class.getPackage(), "ra-notx.xml", "ra.xml");
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "pool-attributes-test.jar");
    jar.addClass(LazyResourceAdapter.class).addClass(LazyManagedConnectionFactory.class).addClass(LazyManagedConnection.class).addClass(LazyConnection.class).addClass(LazyConnectionImpl.class).addClass(LazyXAResource.class).addClass(LazyLocalTransaction.class).addClass(LazyManagedConnectionMetaData.class).addClass(LazyConnectionFactory.class).addClass(LazyConnectionFactoryImpl.class);
    jar.addClasses(ResourceAdapterPoolAttributesTestCase.class, AbstractMgmtServerSetupTask.class, JcaMgmtServerSetupTask.class, AbstractMgmtTestBase.class, JcaMgmtBase.class, ContainerResourceMgmtTestBase.class, MgmtOperationException.class, ManagementOperations.class, JcaTestsUtil.class);
    rar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api,org.jboss.as.connector," + "org.jboss.as.controller,org.jboss.dmr,org.jboss.staxmapper," + // Needed for RemotingPermission class if security manager is enabled
    (System.getProperty("security.manager") == null ? "" : "org.jboss.remoting,") + "org.jboss.ironjacamar.impl, org.jboss.ironjacamar.jdbcadapters\n"), "MANIFEST.MF");
    rar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
    rar.addAsLibrary(jar);
    return rar;
}
Also used : LazyManagedConnection(org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyManagedConnection) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) LazyResourceAdapter(org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyResourceAdapter) LazyLocalTransaction(org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyLocalTransaction) LazyConnectionFactory(org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionFactory) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) ReflectPermission(java.lang.reflect.ReflectPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) LazyConnectionImpl(org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionImpl) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 15 with ReflectPermission

use of java.lang.reflect.ReflectPermission in project wildfly by wildfly.

the class DatasourceMaxPoolAttributeTestCase method createDeployment.

@Deployment
public static Archive<?> createDeployment() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "deployment.jar");
    jar.addClasses(DatasourceNonCcmTestCase.class, Datasource.class, WildFlyDataSource.class, WrapperDataSource.class, JcaMgmtServerSetupTask.class, DatasourceMaxPoolAttributeTestCase.class, AbstractMgmtServerSetupTask.class, AbstractMgmtTestBase.class, JcaMgmtBase.class, ContainerResourceMgmtTestBase.class, MgmtOperationException.class, ManagementOperations.class, JcaTestsUtil.class, ServerReload.class);
    jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api," + "org.jboss.as.connector," + "org.jboss.as.controller," + "org.jboss.dmr," + // Needed for RemotingPermission class if security manager is enabled
    (System.getProperty("security.manager") == null ? "" : "org.jboss.remoting,") + "org.jboss.staxmapper," + "org.jboss.ironjacamar.api," + "org.jboss.ironjacamar.impl," + "org.jboss.ironjacamar.jdbcadapters\n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks"), new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) ReflectPermission(java.lang.reflect.ReflectPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

ReflectPermission (java.lang.reflect.ReflectPermission)17 FilePermission (java.io.FilePermission)12 Deployment (org.jboss.arquillian.container.test.api.Deployment)10 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)10 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)9 RemotingPermission (org.jboss.remoting3.security.RemotingPermission)7 PropertyPermission (java.util.PropertyPermission)6 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)4 Permissions (java.security.Permissions)3 SecurityPermission (java.security.SecurityPermission)3 MBeanPermission (javax.management.MBeanPermission)3 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)3 SocketPermission (java.net.SocketPermission)2 Permission (java.security.Permission)2 LazyConnectionFactory (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionFactory)2 LazyConnectionImpl (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyConnectionImpl)2 LazyLocalTransaction (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyLocalTransaction)2 LazyManagedConnection (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyManagedConnection)2 LazyResourceAdapter (org.jboss.as.test.integration.jca.lazyconnectionmanager.rar.LazyResourceAdapter)2 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)2