Search in sources :

Example 16 with RemotingPermission

use of org.jboss.remoting3.security.RemotingPermission 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 17 with RemotingPermission

use of org.jboss.remoting3.security.RemotingPermission 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)

Example 18 with RemotingPermission

use of org.jboss.remoting3.security.RemotingPermission in project wildfly by wildfly.

the class DatasourcePoolAttributesTestCase 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, DatasourcePoolAttributesTestCase.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," + "org.jboss.staxmapper," + // Needed for RemotingPermission class if security manager is enabled
    (System.getProperty("security.manager") == null ? "" : "org.jboss.remoting,") + "org.jboss.ironjacamar.api," + "org.jboss.ironjacamar.impl," + "org.jboss.ironjacamar.jdbcadapters\n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("connect"), new RemotingPermission("createEndpoint"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks"), 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)

Example 19 with RemotingPermission

use of org.jboss.remoting3.security.RemotingPermission in project wildfly by wildfly.

the class WebSuspendTestCase method deployment.

@Deployment
public static WebArchive deployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "web-suspend.war");
    war.addPackage(WebSuspendTestCase.class.getPackage());
    war.addPackage(HttpRequest.class.getPackage());
    war.addClass(TestSuiteEnvironment.class);
    war.addAsResource(new StringAsset("Dependencies: org.jboss.dmr, org.jboss.as.controller, org.jboss.remoting\n"), "META-INF/MANIFEST.MF");
    war.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission("management.address", "read"), new PropertyPermission("jboss.http.port", "read"), new PropertyPermission("node0", "read"), // executorService.shutdown() needs the following permission
    new RuntimePermission("modifyThread"), // ManagementClient needs the following permissions and a dependency on 'org.jboss.remoting3' module
    new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), // HttpClient needs the following permission
    new SocketPermission(TestSuiteEnvironment.getServerAddress() + ":" + TestSuiteEnvironment.getHttpPort(), "connect,resolve"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
    return war;
}
Also used : HttpRequest(org.jboss.as.test.integration.common.HttpRequest) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) FilePermission(java.io.FilePermission) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 20 with RemotingPermission

use of org.jboss.remoting3.security.RemotingPermission in project wildfly by wildfly.

the class ExpressionSubstitutionInContainerTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME + ".jar");
    jar.addPackage(ExpressionSubstitutionInContainerTestCase.class.getPackage());
    jar.addClasses(ModelUtil.class, TestSuiteEnvironment.class, Authentication.class);
    jar.addAsManifestResource(new StringAsset("Manifest-Version: 1.0\n" + // there has to be a spacer - otherwise you meet "java.io.IOException: invalid header field"
    "Class-Path: \n" + "Dependencies: org.jboss.as.controller-client, org.jboss.as.controller, org.jboss.dmr, org.jboss.remoting \n"), "MANIFEST.MF");
    jar.addAsManifestResource(createPermissionsXmlAsset(// Needed by the StatelessBean#addSystemProperty()
    new PropertyPermission("qa.test.*", "write"), new PropertyPermission("qa.test.*", "read"), new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new PropertyPermission("management.address", "read"), new PropertyPermission("node0", "read"), new PropertyPermission("as.managementPort", "read"), new PropertyPermission("management.port", "read"), new PropertyPermission("jboss.management.user", "read"), new PropertyPermission("jboss.management.password", "read"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "jboss-permissions.xml");
    return jar;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PropertyPermission(java.util.PropertyPermission) RemotingPermission(org.jboss.remoting3.security.RemotingPermission) FilePermission(java.io.FilePermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

FilePermission (java.io.FilePermission)21 Deployment (org.jboss.arquillian.container.test.api.Deployment)21 RemotingPermission (org.jboss.remoting3.security.RemotingPermission)21 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)21 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)18 PropertyPermission (java.util.PropertyPermission)8 ReflectPermission (java.lang.reflect.ReflectPermission)7 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)3 SocketPermission (java.net.SocketPermission)2 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)2 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)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 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)2 AbstractServerInterceptorsSetupTask (org.jboss.as.test.shared.integration.ejb.interceptor.serverside.AbstractServerInterceptorsSetupTask)1