@Test
public void testNamedWorksheet() throws Exception {
RulesComponentImplementationModel rci_model = (RulesComponentImplementationModel)new RulesSwitchYardScanner().scan(NamedWorksheet.class).getImplementation();
QName serviceName = new QName("NamedWorksheet");
RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(NamedWorksheet.class), handler);
serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
handler.start();
List<Object> list = new ArrayList<Object>();
Invoker invoker = new Invoker(serviceDomain, serviceName);
invoker.operation("insert").property("list", list).sendInOnly(new Cheese("cheddar", 42));
invoker.operation("insert").sendInOnly(new Person("michael", "stilton", 25));
invoker.operation("fireAllRules").sendInOnly(null);
Assert.assertEquals(1, list.size());
Assert.assertEquals("Young man cheddar", list.get(0));
handler.stop();
}