public void testWithBeanName() throws Exception {
bean.setProxyTypes(new Class[] { Child.class });
bean.setBeanName("someBean");
bean.afterPropertiesSet();
Child child = (Child) bean.getObject();
try {
child.childMethod();
fail();
}
catch (NoServiceException e) {
}
//now register using types. Will still not be able to find
Child service = newChild();
serviceRegistry.addService(null, "moduleName", new StaticServiceBeanReference(service), Arrays.asList(exportTypes) , null, classLoader);
try {
child.childMethod();
fail();
}