Search in sources :

Example 76 with SocketPermission

use of java.net.SocketPermission in project wildfly by wildfly.

the class EjbOverHttpTestCase method createClientJar.

private static JavaArchive createClientJar() {
    JavaArchive jar = createJar(EjbOverHttpTestCase.ARCHIVE_NAME_CLIENT);
    jar.addClasses(EjbOverHttpTestCase.class);
    jar.addAsManifestResource("META-INF/jboss-ejb-client-profile.xml", "jboss-ejb-client.xml").addAsManifestResource("ejb-http-wildfly-config.xml", "wildfly-config.xml").addAsManifestResource(createPermissionsXmlAsset(createFilePermission("read,write,delete", "jbossas.multinode.client", Arrays.asList("standalone", "data", "ejb-xa-recovery", "-")), new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(System.getProperty("node0")) + ":" + serverPort, "connect,resolve")), "permissions.xml");
    return jar;
}
Also used : SocketPermission(java.net.SocketPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 77 with SocketPermission

use of java.net.SocketPermission in project wildfly by wildfly.

the class StopFromDifferentNodeTestCase method createDeployment.

private static Archive<?> createDeployment() {
    final WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war");
    war.addClasses(Batchlet1.class, BatchClientIF.class, BatchClientBean.class);
    war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    war.addAsWebInfResource(StopFromDifferentNodeTestCase.class.getPackage(), BATCHLET1_JOB, "classes/META-INF/batch-jobs/" + BATCHLET1_JOB);
    war.addAsManifestResource(createPermissionsXmlAsset(new SocketPermission("*:9092", "connect,resolve"), new SecurityPermission("putProviderProperty.WildFlyElytron")), "permissions.xml");
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) SocketPermission(java.net.SocketPermission) SecurityPermission(java.security.SecurityPermission)

Example 78 with SocketPermission

use of java.net.SocketPermission in project wildfly by wildfly.

the class EjbOverHttpDescriptorTestCase method createClientJar.

private static JavaArchive createClientJar() {
    JavaArchive jar = createJar(EjbOverHttpDescriptorTestCase.ARCHIVE_NAME_CLIENT);
    jar.addClasses(EjbOverHttpDescriptorTestCase.class);
    jar.addAsManifestResource("META-INF/jboss-ejb-client-http-connections.xml", "jboss-ejb-client.xml").addAsManifestResource("ejb-http-wildfly-config.xml", "wildfly-config.xml").addAsManifestResource(createPermissionsXmlAsset(createFilePermission("read,write,delete", "jbossas.multinode.client", Arrays.asList("standalone", "data", "ejb-xa-recovery", "-")), new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(System.getProperty("node0")) + ":" + serverPort, "connect,resolve")), "permissions.xml");
    return jar;
}
Also used : SocketPermission(java.net.SocketPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 79 with SocketPermission

use of java.net.SocketPermission in project wildfly by wildfly.

the class EjbOverHttpWrongCredentialsTestCase method createClientJar.

private static JavaArchive createClientJar() {
    JavaArchive jar = createJar(EjbOverHttpWrongCredentialsTestCase.ARCHIVE_NAME_CLIENT_WRONG_CREDENTIALS);
    jar.addClasses(EjbOverHttpTestCase.class);
    jar.addAsManifestResource("META-INF/jboss-ejb-client-profile.xml", "jboss-ejb-client.xml").addAsManifestResource("ejb-http-wildfly-config-wrong.xml", "wildfly-config.xml").addAsManifestResource(createPermissionsXmlAsset(createFilePermission("read,write,delete", "jbossas.multinode.client", Arrays.asList("standalone", "data", "ejb-xa-recovery", "-")), new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(System.getProperty("node0")) + ":" + serverPort, "connect,resolve")), "permissions.xml");
    return jar;
}
Also used : SocketPermission(java.net.SocketPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 80 with SocketPermission

use of java.net.SocketPermission in project wildfly by wildfly.

the class JMSResourceDefinitionsTestCase method createArchive.

@Deployment
public static JavaArchive createArchive() throws Exception {
    // Create the credential expressions so we can store them in the deployment
    setupCredentialStoreExpressions(UNIQUE_NAME, USERNAME, PASSWORD);
    JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "JMSResourceDefinitionsTestCase.jar").addPackage(MessagingBean.class.getPackage()).addClasses(SecureExpressionUtil.getDeploymentClasses()).addAsManifestResource(MessagingBean.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml").addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(new SocketPermission("localhost", "resolve")), "permissions.xml").addAsManifestResource(EmptyAsset.INSTANCE, create("beans.xml")).addAsManifestResource(getDeploymentPropertiesAsset(USERNAME, PASSWORD), "jboss.properties");
    return archive;
}
Also used : SocketPermission(java.net.SocketPermission) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

SocketPermission (java.net.SocketPermission)83 Deployment (org.jboss.arquillian.container.test.api.Deployment)27 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)27 FilePermission (java.io.FilePermission)17 PropertyPermission (java.util.PropertyPermission)13 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)13 AccessControlContext (java.security.AccessControlContext)9 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)9 Test (org.testng.annotations.Test)8 URL (java.net.URL)7 PrivilegedActionException (java.security.PrivilegedActionException)6 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)6 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)6 MockTracer (io.opentracing.mock.MockTracer)5 IOException (java.io.IOException)5 DatagramSocket (java.net.DatagramSocket)5 SecurityPermission (java.security.SecurityPermission)5 InetAddress (java.net.InetAddress)4 InetSocketAddress (java.net.InetSocketAddress)4 MulticastSocket (java.net.MulticastSocket)4