Package org.apache.karaf.bundle.command.bundletree

Examples of org.apache.karaf.bundle.command.bundletree.Node


    @Test
    public void flattenTree() throws IOException {
        Tree<String> tree = new Tree<String>("root");
        Node<String> child1 = tree.addChild("child1");
        child1.addChild("grandchild");
        Node child2 = tree.addChild("child2");
        child2.addChild("grandchild");

        Set<String> elements = tree.flatten();
        assertNotNull(elements);
        assertEquals(4, elements.size());
        assertTrue(elements.contains("root"));
View Full Code Here


    @Test
    public void hasAncestor() throws IOException {
        Tree<String> tree = new Tree<String>("root");
        Node<String> child1 = tree.addChild("child1");
        child1.addChild("grandchild");
        Node child2 = tree.addChild("child2");
        Node node = child2.addChild("grandchild2");

        assertTrue(node.hasAncestor("child2"));
        assertTrue(node.hasAncestor("root"));
        assertFalse(node.hasAncestor("child1"));
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.bundle.command.bundletree.Node

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.