Package org.apache.curator.test

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


    {
        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

        ExecutorService                 executorService = Executors.newFixedThreadPool(CLIENT_QTY);
        ExecutorCompletionService<Void> completionService = new ExecutorCompletionService<Void>(executorService);
        TestingCluster                  cluster = new TestingCluster(3);
        try
        {
            cluster.start();

            final AtomicReference<String>   connectionString = new AtomicReference<String>(cluster.getConnectString());
            final EnsembleProvider          provider = new EnsembleProvider()
            {
                @Override
View Full Code Here

            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

        CuratorFramework client = null;
        PathChildrenCache cache = null;
        TestingCluster cluster = new TestingCluster(3);
        try
        {
            cluster.start();

            client = CuratorFrameworkFactory.newClient(cluster.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
            client.start();
            client.create().creatingParentsIfNeeded().forPath("/test");
View Full Code Here

            CuratorFramework    client = null;
            TestingCluster      cluster = new TestingCluster(2);
            try
            {
                cluster.start();

                client = CuratorFrameworkFactory.builder()
                    .connectString(cluster.getConnectString())
                    .canBeReadOnly(true)
                    .connectionTimeoutMs(timing.connection())
View Full Code Here

    {
        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 ExponentialBackoffRetry(100, 3));
            client.start();
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.