assertEquals("Wrong message", "Hello again", proxy.call());
}
@Test
public void testInterception() throws Exception {
ProxyManager mgr = context().getService(ProxyManager.class);
Bundle b = FrameworkUtil.getBundle(this.getClass());
TestDelegate td = new TestDelegate("Hello");
Collection<Class<?>> classes = new ArrayList<Class<?>>();
classes.add(TestDelegate.class);
TestListener tl = new TestListener();
TestDelegate proxy = (TestDelegate) mgr.createInterceptingProxy(b, classes, td, tl);
//We need to call clear here, because the object will have had its toString() called
tl.clear();
assertCalled(tl, false, false, false);