use of org.jboss.shrinkwrap.api.container.ManifestContainer in project wildfly by wildfly.
the class FaultToleranceApplicationArchiveProcessor method process.
@Override
public void process(Archive<?> applicationArchive, TestClass testClass) {
if (!(applicationArchive instanceof ClassContainer)) {
return;
}
ClassContainer<?> classContainer = (ClassContainer<?>) applicationArchive;
classContainer.addClass(CleanupMetricRegistries.class);
if (applicationArchive instanceof LibraryContainer) {
JavaArchive additionalBeanArchive = ShrinkWrap.create(JavaArchive.class);
additionalBeanArchive.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
((LibraryContainer<?>) applicationArchive).addAsLibrary(additionalBeanArchive);
} else {
classContainer.addAsResource(EmptyAsset.INSTANCE, "META-INF/beans.xml");
}
if (!applicationArchive.contains("META-INF/beans.xml")) {
applicationArchive.add(EmptyAsset.INSTANCE, "META-INF/beans.xml");
}
// Run the TCK with security manager
if (applicationArchive instanceof ManifestContainer) {
ManifestContainer<?> mc = (ManifestContainer<?>) applicationArchive;
mc.addAsManifestResource(createPermissionsXmlAsset(// Permissions required by test instrumentation - arquillian-core.jar and arquillian-testng.jar
new ReflectPermission("suppressAccessChecks"), new PropertyPermission("*", "read"), new RuntimePermission("accessDeclaredMembers"), // Permissions required by test instrumentation - awaitility.jar
new RuntimePermission("setDefaultUncaughtExceptionHandler"), new RuntimePermission("modifyThread")), "permissions.xml");
}
}
Aggregations