use of java.io.FilePermission in project wildfly by wildfly.
the class RemoteCallClientInterceptorTestCase method deployment1.
@Deployment(name = AbstractClientInterceptorsSetupTask.DEPLOYMENT_NAME_CLIENT)
@TargetsContainer(AbstractClientInterceptorsSetupTask.TARGER_CONTAINER_CLIENT)
public static Archive<?> deployment1() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, ARCHIVE_NAME_CLIENT + ".jar");
jar.addClasses(Util.class, ClientInterceptorUtil.class);
jar.addClasses(StatelessBean.class, StatelessRemote.class);
jar.addClasses(RemoteCallClientInterceptorTestCase.class, ClientInterceptor.class);
jar.addPackage(AbstractClientInterceptorsSetupTask.class.getPackage());
jar.addAsManifestResource("META-INF/jboss-ejb-client-receivers.xml", "jboss-ejb-client.xml");
jar.addAsManifestResource(createPermissionsXmlAsset(new SecurityPermission("putProviderProperty.WildFlyElytron"), new FilePermission(System.getProperty("jboss.home") + File.separatorChar + "standalone" + File.separatorChar + "tmp" + File.separatorChar + "auth" + File.separatorChar + "-", "read")), "permissions.xml");
return jar;
}
use of java.io.FilePermission in project wildfly by wildfly.
the class DatabaseTimerServiceMultiNodeTestCase method createDeployment.
private static Archive<?> createDeployment(boolean client) {
final WebArchive war = ShrinkWrap.create(WebArchive.class, ARCHIVE_NAME + ".war");
war.addClasses(Collector.class, RemoteTimedBean.class, TimedObjectTimerServiceBean.class, TimerData.class, FileUtils.class, StartupSingleton.class);
war.addAsWebInfResource(DatabaseTimerServiceMultiNodeTestCase.class.getPackage(), "jboss-ejb3.xml", "jboss-ejb3.xml");
if (!client) {
war.addClass(CollectionSingleton.class);
}
war.addAsResource(new StringAsset(client ? "client" : "server"), "node.txt");
if (client) {
war.addAsManifestResource(DatabaseTimerServiceMultiNodeExecutionDisabledTestCase.class.getPackage(), "jboss-ejb-client.xml", "jboss-ejb-client.xml");
war.addAsManifestResource(createPermissionsXmlAsset(new SocketPermission("*:9092", "connect,resolve"), new SecurityPermission("putProviderProperty.WildFlyElytron"), new FilePermission(System.getProperty("jboss.home") + File.separatorChar + "standalone" + File.separatorChar + "tmp" + File.separatorChar + "auth" + File.separatorChar + "-", "read")), "permissions.xml");
}
return war;
}
use of java.io.FilePermission in project wildfly by wildfly.
the class ServiceRefSevletTestCase method clientDeployment.
@Deployment(name = "servletClient", testable = false)
public static WebArchive clientDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "ws-serviceref-example-servlet-client.war").addClasses(EndpointInterface.class, EndpointService.class, ServletClient.class).addAsWebInfResource(ServiceRefSevletTestCase.class.getPackage(), "web.xml", "web.xml").addAsWebInfResource(ServiceRefSevletTestCase.class.getPackage(), "jboss-web.xml", "jboss-web.xml");
String wsdl = FileUtils.readFile(ServiceRefSevletTestCase.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");
// 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)
war.addAsManifestResource(createPermissionsXmlAsset(new FilePermission("<<ALL FILES>>", "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 war;
}
use of java.io.FilePermission in project wildfly by wildfly.
the class ServerInterceptorsTestCase method deploy.
@Deployment
public static Archive<?> deploy() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "test-server-interceptor.jar");
jar.addPackage(ServerInterceptorsTestCase.class.getPackage());
jar.addPackage(AbstractServerInterceptorsSetupTask.class.getPackage());
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client," + "org.jboss.dmr," + "org.jboss.remoting\n"), "MANIFEST.MF");
jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("connect"), new RemotingPermission("createEndpoint"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read")), "permissions.xml");
return jar;
}
use of java.io.FilePermission in project wildfly by wildfly.
the class SimpleRestClientTestCase method deploy.
@Deployment
public static Archive<?> deploy() {
WebArchive war = ShrinkWrap.create(WebArchive.class);
war.addClass(SimpleRestClientTestCase.class);
war.addClass(OpenTracingApplication.class);
war.addClass(TracedEndpoint.class);
war.addClass(MockTracerFactory.class);
war.addPackage(MockTracer.class.getPackage());
war.addAsServiceProvider(TracerFactory.class, MockTracerFactory.class);
war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
war.addAsManifestResource(createPermissionsXmlAsset(// Required for the ClientBuilder.newBuilder() so the ServiceLoader will work
new FilePermission("<<ALL FILES>>", "read"), // reflection test to check for JAXRS 2.0.
new RuntimePermission("accessDeclaredMembers"), // Required for the client to connect
new SocketPermission(TestSuiteEnvironment.getHttpAddress() + ":" + TestSuiteEnvironment.getHttpPort(), "connect,resolve")), "permissions.xml");
return war;
}
Aggregations