Package org.talend.esb.servicelocator.client.internal.zk

Examples of org.talend.esb.servicelocator.client.internal.zk.ZKBackend.connect()


        expect(zkMock.getState()).andStubReturn(ZooKeeper.States.CONNECTED);
        replay(zkMock);

        ZKBackend zkb = createZKBackend(true);

        RootNode rootNode = zkb.connect();

        assertNotNull(rootNode);
        assertTrue(zkb.isConnected());
        verify(zkMock);
    }
View Full Code Here


        replay(zkMock);

        zkb.setConnectionTimeout(5);

        try {
            zkb.connect();
            fail("A ServiceLocatorException should have been thrown.");
        } catch (ServiceLocatorException e) {
            ignore("Expected exception");
        }
View Full Code Here

        zkMock.addAuthInfo(eq("sl"), aryEq(USER_NAME_PASSWORD_BYTES));
        replay(zkMock);

        zkb.setUserName(USER_NAME);
        zkb.setPassword(PASSWORD);
        zkb.connect();

        verify(zkMock);       
    }

    @Test
View Full Code Here

    public void nodeExistsTrue()  throws Exception {
        expect(zkMock.exists(NODE_PATH.toString(), false)).andReturn(new Stat());
        replay(zkMock);
        ZKBackend zkb = createZKBackend();

        zkb.connect();
        boolean exists = zkb.nodeExists(NODE_PATH);
       
        assertTrue(exists);
        verify(zkMock);
    }
View Full Code Here

        expect(zkMock.exists(NODE_PATH.toString(), false)).andReturn(null);
       
        ZKBackend zkb = createZKBackend();
        replay(zkMock);

        zkb.connect();
        boolean exists = zkb.nodeExists(NODE_PATH);
       
        assertFalse(exists);
        verify(zkMock);
    }
View Full Code Here

            andReturn(NODE_PATH.toString());
       
        ZKBackend zkb = createZKBackend();
        replay(zkMock);

        zkb.connect();
        zkb.createNode(NODE_PATH, PERSISTENT, CONTENT_ANY_1);
        verify(zkMock);
    }
   
    private ZKBackend createZKBackend()
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.