+ assertNotNull(product.getInvocationProxy());
+
+ assertEquals("2 fields should be generated.", 2, product.getInvocationProxy().getClass().getFields().length);
+
+ verifyRouting(product);
+ }
+
+ @Test
+ public void testInvoker() throws Exception {
+
+ FooListenerImpl fooListener = new FooListenerImpl();
+
+ NotificationInvoker invokerFoo = invokerFactory.invokerFor(fooListener);
+
+
+ assertSame(fooListener,invokerFoo.getDelegate());
+ assertNotNull(invokerFoo.getSupportedNotifications());
+ assertEquals(1, invokerFoo.getSupportedNotifications().size());
+ assertNotNull(invokerFoo.getInvocationProxy());
+
+ FooUpdateImpl fooOne = new FooUpdateImpl();
+ invokerFoo.getInvocationProxy().onNotification(fooOne);
+
+ assertEquals(1, fooListener.receivedFoos.size());
+ assertSame(fooOne, fooListener.receivedFoos.get(0));
+
+ CompositeListenerImpl composite = new CompositeListenerImpl();
+
+ NotificationInvoker invokerComposite = invokerFactory.invokerFor(composite);
+
+ assertNotNull(invokerComposite.getSupportedNotifications());
+ assertEquals(3, invokerComposite.getSupportedNotifications().size());
+ assertNotNull(invokerComposite.getInvocationProxy());
+
+ invokerComposite.getInvocationProxy().onNotification(fooOne);
+
+ assertEquals(1, composite.receivedFoos.size());
+ assertSame(fooOne, composite.receivedFoos.get(0));
+
+ assertEquals(0, composite.receivedBars.size());
+
+ BarUpdateImpl barOne = new BarUpdateImpl();
+
+ invokerComposite.getInvocationProxy().onNotification(barOne);
+
+ assertEquals(1, composite.receivedFoos.size());
+ assertEquals(1, composite.receivedBars.size());
+ assertSame(barOne, composite.receivedBars.get(0));
+