use of org.apache.aries.proxy.weavinghook.WeavingHelper in project aries by apache.
the class WeavingProxyTest method checkProxyController.
@Test(expected = FinalModifierException.class)
public void checkProxyController() throws Exception {
bundleContext.registerService(ProxyWeavingController.class.getName(), new ProxyWeavingController() {
public boolean shouldWeave(WovenClass arg0, WeavingHelper arg1) {
return false;
}
}, null);
Bundle b = bundleContext.getBundle();
Callable<Object> c = new TestCallable();
Collection<Class<?>> classes = new ArrayList<Class<?>>();
// Don't use anonymous inner class in this test as IBM and Sun load it at a different time
// For IBM JDK, the anonymous inner class will be loaded prior to the controller is registered.
Callable<?> callable = new TestFinalDelegate();
classes.add(callable.getClass());
Object o = mgr.createDelegatingProxy(b, classes, c, callable);
if (o instanceof WovenProxy)
fail("Proxy should not have been woven!");
}
Aggregations