Package org.apache.karaf.cellar.core

Examples of org.apache.karaf.cellar.core.ClusterManager


    @Test
    @Ignore
    public void testInstallation() throws InterruptedException {
        installCellar();
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);
        Thread.sleep(20000);
        System.err.println(executeCommand("osgi:list"));
        System.err.println(executeCommand("cluster:node-list"));
    }
View Full Code Here


    @Test
    @Ignore
    public void testCellarObrFeatureInstall() throws Exception {
        installCellar();
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        System.err.println(executeCommand("features:install cellar-obr"));
    }
View Full Code Here

    @Ignore
    public void testClusterWithChildNodes() throws InterruptedException {
        installCellar();
        createCellarChild("child1");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        Node localNode = clusterManager.getNode();
        Set<Node> nodes = clusterManager.listNodes();
        System.err.println(executeCommand("cluster:node-list"));
        assertTrue("There should be at least 2 cellar nodes running", 2 <= nodes.size());
    }
View Full Code Here

    public void testDosgiGreeter() throws InterruptedException {
        installCellar();
        createCellarChild("node1");
        createCellarChild("node2");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        System.err.println(executeCommand("features:addurl mvn:org.apache.karaf.cellar.samples/dosgi-greeter/2.3.0-SNAPSHOT/xml/features"));

        System.err.println(executeCommand("admin:list"));

        System.err.println(executeCommand("cluster:node-list"));
        Node localNode = clusterManager.getNode();
        Set<Node> nodes = clusterManager.listNodes();
        assertTrue("There should be at least 3 cellar nodes running", 3 <= nodes.size());

        Thread.sleep(DEFAULT_TIMEOUT);

        String node1 = getNodeIdOfChild("node1");
View Full Code Here

    public void testCamelSampleApp() throws InterruptedException {
        installCellar();
        createCellarChild("node1");
        createCellarChild("node2");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        System.err.println(executeCommand("features:addurl mvn:org.apache.karaf.cellar.samples/camel-hazelcast-app/2.3.0-SNAPSHOT/xml/features"));

        System.err.println(executeCommand("admin:list"));

        System.err.println(executeCommand("cluster:node-list"));
        Node localNode = clusterManager.getNode();
        Set<Node> nodes = clusterManager.listNodes();
        assertTrue("There should be at least 3 Cellar nodes running", nodes.size() >= 3);

        Thread.sleep(DEFAULT_TIMEOUT);

        String node1 = getNodeIdOfChild("node1");
View Full Code Here

    public void testCellarFeaturesModule() throws InterruptedException {
        installCellar();
        createCellarChild("child1");
        createCellarChild("child2");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        String node1 = getNodeIdOfChild("child1");
        String node2 = getNodeIdOfChild("child2");
        System.err.println(executeCommand("admin:list"));
View Full Code Here

    @Test
    @Ignore
    public void testCellarEventFeatureInstall() throws Exception {
        installCellar();
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);
       
        System.err.println(executeCommand("features:install cellar-event"));
    }
View Full Code Here

    @Test
    @Ignore
    public void testCellarBundleModule() throws Exception {
        installCellar();
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);
       
        System.err.println(executeCommand("cluster:bundle-list default"));
    }
View Full Code Here

    @Ignore
    public void testCellarFeaturesModule() throws InterruptedException {
        installCellar();
        createCellarChild("child1");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        System.err.println(executeCommand("admin:list"));

        String eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(UNINSTALLED));

        //Test feature sync - install
        System.err.println(executeCommand("features:install eventadmin"));
        Thread.sleep(2000);
        eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(INSTALLED));

        //Test feature sync - uninstall
        System.err.println(executeCommand("features:uninstall eventadmin"));
        Thread.sleep(2000);
        eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(UNINSTALLED));

        //Test feature command - install
        System.err.println(executeCommand("cluster:feature-install default eventadmin"));
        Thread.sleep(2000);
        eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(INSTALLED));

        //Test feature command - uninstall
        System.err.println(executeCommand("cluster:feature-uninstall default eventadmin"));
        Thread.sleep(2000);
        eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(UNINSTALLED));

        //Test feature command - install - before a node joins
        System.err.println(executeCommand("cluster:feature-install testgroup eventadmin"));
        System.err.println(executeCommand("cluster:group-set testgroup " + getNodeIdOfChild("child1")));
        Thread.sleep(2000);
        eventadminFeatureStatus = executeCommand("admin:connect child1 features:list | grep eventadmin");
        System.err.println(eventadminFeatureStatus);
        assertTrue(eventadminFeatureStatus.startsWith(INSTALLED));

        Node localNode = clusterManager.getNode();
        Set<Node> nodes = clusterManager.listNodes();
        System.err.println(executeCommand("cluster:node-list"));
        assertTrue("There should be at least 2 cellar nodes running", 2 <= nodes.size());
    }
View Full Code Here

    @Ignore
    public void testGroupsWithChildNodes() throws InterruptedException {
        installCellar();
        createCellarChild("child1");
        Thread.sleep(DEFAULT_TIMEOUT);
        ClusterManager clusterManager = getOsgiService(ClusterManager.class);
        assertNotNull(clusterManager);

        System.err.println(executeCommand("cluster:node-list"));
        Node localNode = clusterManager.getNode();
        Set<Node> nodes = clusterManager.listNodes();
        assertTrue("There should be at least 2 cellar nodes running", 2 <= nodes.size());

        System.err.println(executeCommand("cluster:group-list"));
        System.err.println(executeCommand("cluster:group-set testgroup " + localNode.getId()));
        System.err.println(executeCommand("cluster:group-list"));
View Full Code Here

TOP

Related Classes of org.apache.karaf.cellar.core.ClusterManager

Copyright © 2018 www.massapicom. 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.