Package org.openengsb.infrastructure.ldap.model

Examples of org.openengsb.infrastructure.ldap.model.Node


    private List<Node> extractNodesFromCursor(SearchCursor cursor) {
        LinkedList<Node> result = new LinkedList<Node>();
        try {
            while (cursor.next()) {
                Node node = new Node(cursor.getEntry());
                result.addFirst(node);
                node.setChildren(searchSubtree(node.getEntry().getDn()));
                for (Node n : node.getChildren()) {
                    n.setParent(node);
                }
            }
        } catch (Exception e) {
            throw new LdapDaoException(e);
View Full Code Here


        assertThat(reversed.get(1), is(second));
    }

    @Test
    public void testSortByIdNode_expectSorted() throws Exception {
        Node first = new Node(newEntryWithId());
        Node second = new Node(newEntryWithId());
        List<Node> reversed = new LinkedList<Node>();
        // add the nodes in reversed order
        reversed.add(second);
        reversed.add(first);
        // sort them
View Full Code Here

        assertThat(list.get(1), is(b));
    }
   
    @Test
    public void testSortByIdNodeWhereNotSet_expectSorted() throws Exception {
        Node first = new Node(newEntryWithId());
        Node second = new Node(new DefaultEntry());
        List<Node> list = new LinkedList<Node>();
        list.add(first);
        list.add(second);
        TimebasedOrderFilter.sortByIdNode(list);
        assertThat(list.get(1), is(first));
View Full Code Here

        assertThat(list.get(0), is(second));
    }

    @Test
    public void testSortByIdNodeWhereNotSet2_expectSorted() throws Exception {
        Node a = new Node(newEntryWithId());
        Node b = new Node(new DefaultEntry());
        List<Node> list = new LinkedList<Node>();
        list.add(b);
        list.add(a);
        TimebasedOrderFilter.sortByIdNode(list);
        assertThat(list.get(1), is(a));
View Full Code Here

        assertThat(list.get(1), is(a));
        assertThat(list.get(0), is(b));
    }
    @Test
    public void testSortByIdNodeWhereBothNotSet_expectSorted() throws Exception {
        Node a = new Node(new DefaultEntry());
        Node b = new Node(new DefaultEntry());
        List<Node> list = new LinkedList<Node>();
        list.add(a);
        list.add(b);
        TimebasedOrderFilter.sortByIdNode(list);
        assertThat(list.get(0), is(a));
View Full Code Here

            result.add(connection.lookup(e.getDn()));
        }
        List<Node> nodes = dao.searchSubtree(baseDn);
        assertThat(contains(nodes, result.get(0)), is(true));
        assertThat(contains(nodes, result.get(1)), is(true));
        Node parent = which(nodes, result.get(1));
        assertThat(contains(parent.getChildren(), result.get(2)), is(true));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.infrastructure.ldap.model.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.