use of org.apache.deltaspike.proxy.util.EnableInterceptorsInterceptor in project deltaspike by apache.
the class EnableInterceptorsTest method war.
@Deployment
public static WebArchive war() {
String simpleName = EnableInterceptorsTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
// CDI 1.0/Weld 1.x needs EnableInterceptorsInterceptor
BeansDescriptor beansWithEnablingInterceptor = Descriptors.create(BeansDescriptor.class);
beansWithEnablingInterceptor.getOrCreateInterceptors().clazz(EnableInterceptorsInterceptor.class.getName());
// war archive needs MyBeanInterceptor enabled
BeansDescriptor beans = Descriptors.create(BeansDescriptor.class);
beans.getOrCreateInterceptors().clazz(MyBeanInterceptor.class.getName());
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(EnableInterceptorsTest.class.getPackage()).addAsManifestResource(new StringAsset(beansWithEnablingInterceptor.exportAsString()), "beans.xml");
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndProxyArchive()).addAsLibraries(testJar).addAsWebInfResource(new StringAsset(beans.exportAsString()), "beans.xml");
}
Aggregations