Search in sources :

Example 1 with InternalProxyService

use of com.hazelcast.spi.impl.proxyservice.InternalProxyService in project hazelcast by hazelcast.

the class ClientMapPartitionLostListenerTest method assertProxyExistsEventually.

private void assertProxyExistsEventually(HazelcastInstance instance, final String proxyName) {
    final InternalProxyService proxyService = getNodeEngineImpl(instance).getProxyService();
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            Collection<DistributedObject> allDistributedObjects = proxyService.getAllDistributedObjects();
            for (DistributedObject distributedObject : allDistributedObjects) {
                if (distributedObject.getName().equals(proxyName)) {
                    return;
                }
            }
            fail("There is no proxy with name " + proxyName + " created (yet)");
        }
    });
}
Also used : DistributedObject(com.hazelcast.core.DistributedObject) AssertTask(com.hazelcast.test.AssertTask) Collection(java.util.Collection) InternalProxyService(com.hazelcast.spi.impl.proxyservice.InternalProxyService)

Aggregations

DistributedObject (com.hazelcast.core.DistributedObject)1 InternalProxyService (com.hazelcast.spi.impl.proxyservice.InternalProxyService)1 AssertTask (com.hazelcast.test.AssertTask)1 Collection (java.util.Collection)1