Assert.assertEquals(0, _registry.getEndpoints(ep1.getServiceName()).size());
}
@Test
public void testNodeFailure() throws Exception {
RemoteEndpoint ep1 = new RemoteEndpoint()
.setDomainName(new QName("domain1"))
.setServiceName(new QName("service1"));
RemoteEndpoint ep2 = new RemoteEndpoint()
.setDomainName(new QName("domain1"))
.setServiceName(new QName("service2"));
// nothing in the registry
Assert.assertEquals(0, _registry.getEndpoints(ep1.getServiceName()).size());
// add our endpoints on the same node
_registry.addEndpoint(ep1);
_registry.addEndpoint(ep2);
// signal that the node has failed
InfinispanRegistry.MemberDropListener dropListener = _registry.new MemberDropListener();
dropListener.dropAllServices(new FakeAddress(ep1.getNode()));
// check to make sure all endpoints were removed
Assert.assertEquals(0, _registry.getEndpoints(ep1.getServiceName()).size());
// check to make sure all endpoints were removed
Assert.assertEquals(0, _registry.getEndpoints(ep2.getServiceName()).size());
}