public class DefaultServiceRegistryTest {
@Test
public void testRegisterService() throws Exception {
ServiceRegistry registry=DefaultServiceRegistry.getInstance();
TestService ts=new TestServiceImpl();
registry.registerService(ts, TestService.class,TestService2.class);
TestService service1=(TestService) registry.lookup(TestService.class);
assertNotNull(service1);
TestService service2=(TestService) registry.lookup(TestService2.class);
assertNotNull(service2);
assertTrue(ts==service1);
assertTrue(ts==service2);
assertTrue(service1==service2);