Examples of awaitLatch()


Examples of org.apache.curator.test.Timing.awaitLatch()

                                if ( isFirst.compareAndSet(true, false) )
                                {
                                    timing.sleepABit();

                                    server.stop();
                                    Assert.assertTrue(timing.awaitLatch(latch));
                                    server = new TestingServer(server.getPort(), server.getTempDirectory());
                                }
                            }
                            finally
                            {
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            Assert.assertTrue(timing.acquireSemaphore(semaphore));

            timing.sleepABit();

            server = new TestingServer(server.getPort(), server.getTempDirectory());
            Assert.assertTrue(timing.awaitLatch(latch));

            timing.sleepABit();

            Assert.assertNull(client.checkExists().forPath("/test-me"));
        }
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            Assert.assertTrue(timing.acquireSemaphore(semaphore));

            timing.sleepABit();

            server = new TestingServer(server.getPort(), server.getTempDirectory());
            Assert.assertTrue(timing.awaitLatch(latch));

            timing.sleepABit();

            Assert.assertNull(namespaceClient.checkExists().forPath("/test-me"));
        }
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            ACL acl = new ACL(ZooDefs.Perms.WRITE, ZooDefs.Ids.AUTH_IDS);
            List<ACL> aclList = Lists.newArrayList(acl);
            client.create().withACL(aclList).forPath("/test", "test".getBytes());

            server.stop();
            Assert.assertTrue(timing.awaitLatch(lostLatch));
            try
            {
                client.checkExists().forPath("/");
                Assert.fail("Connection should be down");
            }
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            Assert.assertTrue(timing.acquireSemaphore(semaphore));

            timing.sleepABit();

            server = new TestingServer(server.getPort(), server.getTempDirectory());
            Assert.assertTrue(timing.awaitLatch(latch));

            timing.sleepABit();

            Assert.assertNull(client.checkExists().forPath("/test-me"));
        }
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            };

            selector = new LeaderSelector(client, "/leader", listener);
            selector.start();

            Assert.assertTrue(timing.awaitLatch(isLeaderLatch));
            selector.interruptLeadership();
            Assert.assertTrue(timing.awaitLatch(losingLeaderLatch));
        }
        finally
        {
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            selector = new LeaderSelector(client, "/leader", listener);
            selector.start();

            Assert.assertTrue(timing.awaitLatch(isLeaderLatch));
            selector.interruptLeadership();
            Assert.assertTrue(timing.awaitLatch(losingLeaderLatch));
        }
        finally
        {
            CloseableUtils.closeQuietly(selector);
            CloseableUtils.closeQuietly(client);
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            selector.debugLeadershipLatch = debugLeadershipLatch;
            selector.debugLeadershipWaitLatch = debugLeadershipWaitLatch;

            selector.start();

            Assert.assertTrue(timing.awaitLatch(debugLeadershipLatch));
            server.stop();
            Assert.assertTrue(timing.awaitLatch(lostLatch));
            timing.sleepABit();
            debugLeadershipWaitLatch.countDown();
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            selector.start();

            Assert.assertTrue(timing.awaitLatch(debugLeadershipLatch));
            server.stop();
            Assert.assertTrue(timing.awaitLatch(lostLatch));
            timing.sleepABit();
            debugLeadershipWaitLatch.countDown();

            server = new TestingServer(server.getPort(), server.getTempDirectory());
            Assert.assertTrue(timing.awaitLatch(reconnectedLatch));
View Full Code Here

Examples of org.apache.curator.test.Timing.awaitLatch()

            Assert.assertTrue(timing.awaitLatch(lostLatch));
            timing.sleepABit();
            debugLeadershipWaitLatch.countDown();

            server = new TestingServer(server.getPort(), server.getTempDirectory());
            Assert.assertTrue(timing.awaitLatch(reconnectedLatch));

            Assert.assertFalse(takeLeadershipLatch.await(3, TimeUnit.SECONDS));
        }
        finally
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.