Package org.apache.curator.test

Examples of org.apache.curator.test.TestingCluster.start()


            timing.awaitLatch(suspendedLatch);
            timing.forWaiting().sleepABit();
            Assert.assertEquals(0, acquireCount.get());

            cluster = new TestingCluster(3);
            cluster.start();

            connectionString.set(cluster.getConnectString());
            timing.forWaiting().sleepABit();

            Assert.assertTrue(timing.acquireSemaphore(acquiredSemaphore));
View Full Code Here


        final Timing                    timing = new Timing();
        TestingCluster                  cluster = new TestingCluster(3);
        List<SemaphoreClient>           semaphoreClients = Lists.newArrayList();
        try
        {
            cluster.start();

            final AtomicInteger         opCount = new AtomicInteger(0);
            for ( int i = 0; i < QTY; ++i )
            {
                SemaphoreClient semaphoreClient = new SemaphoreClient
View Full Code Here

            int     thisOpCount = opCount.get();

            Iterator<InstanceSpec> iterator = cluster.getInstances().iterator();
            cluster = new TestingCluster(iterator.next(), iterator.next());
            cluster.start();
            timing.forWaiting().sleepABit();

            startTicks = System.currentTimeMillis();
            for(;;)
            {
View Full Code Here

        List<ClientAndLatch>    clients = Lists.newArrayList();
        Timing                  timing = new Timing();
        TestingCluster          cluster = new TestingCluster(PARTICIPANT_QTY);
        try
        {
            cluster.start();

            List<InstanceSpec>      instances = Lists.newArrayList(cluster.getInstances());
            for ( int i = 0; i < PARTICIPANT_QTY; ++i )
            {
                CuratorFramework        client = CuratorFrameworkFactory.newClient(instances.get(i).getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
View Full Code Here

    {
        final Timing        timing = new Timing();

        CuratorFramework    client = null;
        TestingCluster      cluster = new TestingCluster(3);
        cluster.start();
        try
        {
            client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
            client.start();
View Full Code Here

    {
        final Timing        timing = new Timing();

        CuratorFramework    client = null;
        TestingCluster      cluster = new TestingCluster(3);
        cluster.start();
        try
        {
            client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
            client.start();
            client.sync("/", null);
View Full Code Here

            Assert.assertFalse(selector.hasLeadership());

            Assert.assertNotNull(lockNode.get());
           
            cluster = new TestingCluster(instances.toArray(new InstanceSpec[instances.size()]));
            cluster.start();

            try
            {
                client.delete().forPath(ZKPaths.makePath("/leader", lockNode.get()));   // simulate the lock deleting due to session expiration
            }
View Full Code Here

{
  @Test
  public void testRun() throws Exception
  {
    TestingCluster localCluster = new TestingCluster(1);
    localCluster.start();

    CuratorFramework localCf = CuratorFrameworkFactory.builder()
                                                      .connectString(localCluster.getConnectString())
                                                      .retryPolicy(new ExponentialBackoffRetry(1, 10))
                                                      .compressionProvider(
View Full Code Here

                                                      .build();
    localCf.start();


    TestingCluster remoteCluster = new TestingCluster(1);
    remoteCluster.start();

    CuratorFramework remoteCf = CuratorFrameworkFactory.builder()
                                                       .connectString(remoteCluster.getConnectString())
                                                       .retryPolicy(new ExponentialBackoffRetry(1, 10))
                                                       .compressionProvider(
View Full Code Here

        List<ClientAndLatch>    clients = Lists.newArrayList();
        Timing                  timing = new Timing();
        TestingCluster          cluster = new TestingCluster(PARTICIPANT_QTY);
        try
        {
            cluster.start();

            List<InstanceSpec>      instances = Lists.newArrayList(cluster.getInstances());
            for ( int i = 0; i < PARTICIPANT_QTY; ++i )
            {
                CuratorFramework        client = CuratorFrameworkFactory.newClient(instances.get(i).getConnectString(), timing.session(), timing.connection(), new ExponentialBackoffRetry(100, 3));
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.