use of java.net.SocketPermission in project wildfly by wildfly.
the class ServiceRefTestCase method deployment.
@Deployment
public static JavaArchive deployment() {
String wsdl = FileUtils.readFile(ServiceRefTestCase.class, "TestService.wsdl");
final Properties properties = new Properties();
properties.putAll(System.getProperties());
final String node0 = NetworkUtils.formatPossibleIpv6Address((String) properties.get("node0"));
if (properties.containsKey("node0")) {
properties.put("node0", node0);
}
return ShrinkWrap.create(JavaArchive.class, "ws-serviceref-example.jar").addClasses(EJB3Bean.class, EndpointInterface.class, EndpointService.class, StatelessBean.class, StatelessRemote.class, CdiBean.class).addAsManifestResource(ServiceRefTestCase.class.getPackage(), "ejb-jar.xml", "ejb-jar.xml").addAsManifestResource(ServiceRefTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml").addAsManifestResource(new StringAsset(PropertiesValueResolver.replaceProperties(wsdl, properties)), "wsdl/TestService.wsdl").addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsManifestResource(createPermissionsXmlAsset(new FilePermission(System.getProperty("java.home") + File.separator + "lib" + File.separator + "wsdl.properties", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission", "resolveUri"), new RuntimePermission("createClassLoader"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(node0 + ":8080", "connect,resolve")), "jboss-permissions.xml");
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class ServiceRefEarTestCase method deployment.
@Deployment(testable = false)
public static Archive<?> deployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ws-serviceref-example.jar").addClasses(EJB3Bean.class, EndpointInterface.class);
WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-serviceref-example-servlet-client.war").addClasses(EndpointInterface.class, EndpointService.class, ServletClient.class).addAsWebInfResource(ServiceRefEarTestCase.class.getPackage(), "web.xml", "web.xml").addAsWebInfResource(ServiceRefEarTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
String wsdl = FileUtils.readFile(ServiceRefEarTestCase.class, "TestService.wsdl");
final Properties properties = new Properties();
properties.putAll(System.getProperties());
final String node0 = NetworkUtils.formatPossibleIpv6Address((String) properties.get("node0"));
if (properties.containsKey("node0")) {
properties.put("node0", node0);
}
war.addAsWebInfResource(new StringAsset(PropertiesValueResolver.replaceProperties(wsdl, properties)), "wsdl/TestService.wsdl");
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "ws-serviceref-example.ear").addAsModule(jar).addAsModule(war);
// all the following permissions are needed because EndpointService directly extends javax.xml.ws.Service class
// and CXF guys are not willing to add more privileged blocks into their code, thus deployments need to have
// the following permissions (note that the wsdl.properties permission is needed by wsdl4j)
ear.addAsManifestResource(createPermissionsXmlAsset(new FilePermission(System.getProperty("java.home") + File.separator + "lib" + File.separator + "wsdl.properties", "read"), new PropertyPermission("user.dir", "read"), new RuntimePermission("getClassLoader"), new RuntimePermission("org.apache.cxf.permission", "resolveUri"), new RuntimePermission("createClassLoader"), new RuntimePermission("accessDeclaredMembers"), new SocketPermission(node0 + ":8080", "connect,resolve")), "jboss-permissions.xml");
return ear;
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class DatasourceNonCcmTestCase method getDeployment.
@Deployment
public static Archive<?> getDeployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "dummy.jar");
jar.addClasses(DatasourceNonCcmTestCase.class, Datasource.class, JcaMgmtBase.class, ManagementOperations.class, ContainerResourceMgmtTestBase.class, AbstractMgmtTestBase.class, JcaMgmtServerSetupTask.class, MgmtOperationException.class, DsMgmtTestBase.class, JcaTestsUtil.class);
jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api,org.jboss.as.connector," + "org.jboss.as.controller, " + "org.jboss.dmr,org.jboss.as.cli, " + "org.jboss.staxmapper, " + "org.jboss.ironjacamar.impl, " + "org.jboss.ironjacamar.jdbcadapters, " + "org.jboss.remoting3\n"), "MANIFEST.MF");
jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("createEndpoint"), new RemotingPermission("addConnectionProvider"), new RemotingPermission("connect"), new RuntimePermission("createXnioWorker"), new SocketPermission(TestSuiteEnvironment.getServerAddress(), "connect,resolve")), "permissions.xml");
return jar;
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class RebindTestCase method deploy.
@Deployment
public static Archive<?> deploy() {
String tmpdir = System.getProperty("jboss.home");
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "RebindTestCase.jar");
jar.addClasses(RebindTestCase.class, BindingLookupBean.class);
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller, " + "org.jboss.remoting3\n"), "MANIFEST.MF");
jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("addConnectionProvider"), new RemotingPermission("connect"), new RemotingPermission("createEndpoint"), new RuntimePermission("createXnioWorker"), new FilePermission(tmpdir + "/standalone/tmp/auth/-", "read"), new SocketPermission(TestSuiteEnvironment.getServerAddress(), "connect,resolve")), "permissions.xml");
return jar;
}
use of java.net.SocketPermission in project wildfly by wildfly.
the class RolloutPlanTestCase method before.
@BeforeClass
public static void before() throws Exception {
CLITestSuite.createSupport(RolloutPlanTestCase.class.getSimpleName());
final WebArchive war = ShrinkWrap.create(WebArchive.class, "RolloutPlanTestCase.war");
war.addClass(RolloutPlanTestServlet.class);
war.addAsManifestResource(createPermissionsXmlAsset(// main-one
new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(CLITestSuite.hostAddresses.get("master")) + ":" + TEST_PORT, "listen,resolve"), // main-three
new SocketPermission(TestSuiteEnvironment.formatPossibleIpv6Address(CLITestSuite.hostAddresses.get("master")) + ":" + (TEST_PORT + 350), "listen,resolve")), "permissions.xml");
String tempDir = System.getProperty("java.io.tmpdir");
warFile = new File(tempDir + File.separator + "RolloutPlanTestCase.war");
new ZipExporterImpl(war).exportTo(warFile, true);
AbstractCliTestBase.initCLI(DomainTestSupport.masterAddress);
// add another server group to default profile
cli.sendLine("/server-group=test-server-group:add(profile=default,socket-binding-group=standard-sockets)");
// add a server to the group
cli.sendLine("/host=master/server-config=test-one:add(group=test-server-group,socket-binding-port-offset=700");
cli.sendLine("/host=master/server-config=test-one/interface=public:add(inet-address=" + CLITestSuite.hostAddresses.get("master") + ")");
CLITestSuite.addServer("test-one", "master", "test-server-group", "default", 700, true);
// start main-two
cli.sendLine("/host=master/server-config=main-two:start(blocking=true)");
CLIOpResult res = cli.readAllAsOpResult();
Assert.assertTrue(res.isIsOutcomeSuccess());
waitUntilState("main-two", "STARTED");
// start test-one
cli.sendLine("/host=master/server-config=test-one:start(blocking=true)");
res = cli.readAllAsOpResult();
Assert.assertTrue(res.isIsOutcomeSuccess());
waitUntilState("test-one", "STARTED");
}
Aggregations