Examples of sleepABit()


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

            latch.debugResetWaitLatch = new CountDownLatch(1);
            latch.start()// will call reset()
            latch.reset()// should not result in two nodes

            timing.sleepABit();

            latch.debugResetWaitLatch.countDown();

            timing.sleepABit();
View Full Code Here

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

            timing.sleepABit();

            latch.debugResetWaitLatch.countDown();

            timing.sleepABit();

            Assert.assertEquals(client.getChildren().forPath(PATH_NAME).size(), 1);
        }
        finally
        {
View Full Code Here

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

            latch.debugResetWaitLatch = new CountDownLatch(1);

            latch.start();
            latch.close();

            timing.sleepABit();

            latch.debugResetWaitLatch.countDown();

            timing.sleepABit();
View Full Code Here

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

            timing.sleepABit();

            latch.debugResetWaitLatch.countDown();

            timing.sleepABit();

            Assert.assertEquals(client.getChildren().forPath(PATH_NAME).size(), 0);

        }
        finally
View Full Code Here

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

        {
            client.start();

            leader.start();

            timing.sleepABit();

            notifiedLeader.start();

            timing.sleepABit();
View Full Code Here

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

            timing.sleepABit();

            notifiedLeader.start();

            timing.sleepABit();

            notifiedLeader.close();

            timing.sleepABit();
View Full Code Here

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

            timing.sleepABit();

            notifiedLeader.close();

            timing.sleepABit();

            // Test the close override
            leader.close(LeaderLatch.CloseMode.NOTIFY_LEADER);

            Assert.assertEquals(leader.getState(), LeaderLatch.State.CLOSED);
View Full Code Here

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

        try
        {
            leader.start();

            timing.sleepABit();

            // Start the new server
            server = new TestingServer(server.getPort(), server.getTempDirectory());

            Assert.assertTrue(timing.awaitLatch(leaderCounter), "Not elected leader");
View Full Code Here

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

            queue.getPutListenerContainer().addListener(listener);

            Assert.assertTrue(queue.put("1", timing.milliseconds(), TimeUnit.MILLISECONDS));   // should end up in consumer
            Assert.assertTrue(queue.put("2", timing.milliseconds(), TimeUnit.MILLISECONDS));   // should sit blocking in DistributedQueue
            Assert.assertTrue(timing.awaitLatch(latch));
            timing.sleepABit();
            Assert.assertFalse(queue.put("3", timing.multiple(.5).milliseconds(), TimeUnit.MILLISECONDS));

            semaphore.release(100);
            Assert.assertTrue(queue.put("3", timing.milliseconds(), TimeUnit.MILLISECONDS));
            Assert.assertTrue(queue.put("4", timing.milliseconds(), TimeUnit.MILLISECONDS));
View Full Code Here

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

            {
                if ( messages.size() == 3 )
                {
                    break;
                }
                timing.sleepABit();
            }
            timing.sleepABit();

            Assert.assertEquals(messages, Arrays.asList("1", "2", "3", "4", "5"));
        }
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.