@Test
public void testLookup() throws Exception {

    setUp();
    SubscribeInfo subscribeInfo = createSubscribeInfo(true);
    List<ServiceInstance> instances = namingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 0);
    RegisterInfo registerInfo = createRegisterInfo("127.0.0.1", 8012);
    namingService.register(registerInfo);
    instances = namingService.lookup(subscribeInfo);
    Assert.assertTrue(instances.size() == 1);
    Assert.assertTrue(instances.get(0).getIp().equals("127.0.0.1"));
    Assert.assertTrue(instances.get(0).getPort() == 8012);
    namingService.unregister(registerInfo);
    tearDown();
}