Package org.neo4j.rest.graphdb.entity

Examples of org.neo4j.rest.graphdb.entity.RestNode.addLabel()


    }

    @Test
    public void testGetNodeLabel() {
        RestNode node = restAPI.createNode(map());
        node.addLabel(LABEL_FOO);
        int count=0;
        for (Label label1 : node.getLabels()) {
            assertEquals(LABEL_FOO.name(),label1.name());
            count++;
        }
View Full Code Here


        assertEquals("one label",1,count);
    }
    @Test
    public void testRemoveNodeLabel() {
        RestNode node = restAPI.createNode(map());
        node.addLabel(LABEL_FOO);
        node.removeLabel(LABEL_FOO);
        assertFalse(node.getLabels().iterator().hasNext());
    }

    @Test
View Full Code Here

    }

    @Test
    public void testGetNodeByLabel() throws Exception {
        RestNode node = restAPI.createNode(map());
        node.addLabel(LABEL_FOO);
        int count=0;
        for (RestNode restNode : restAPI.getNodesByLabel(LABEL_FOO.name())) {
            assertEquals(node,restNode);
            count++;
        }
View Full Code Here

    }

    @Test
    public void testSetNodeLabel() throws Exception {
        RestNode n1 = restAPI.createNode(map("name", "node1"));
        n1.addLabel(LABEL_FOO);
        n1.addLabel(LABEL_BAR);
        Collection<String> labels = IteratorUtil.asCollection(new IterableWrapper<String, Label>(n1.getLabels()) {
            protected String underlyingObjectToObject(Label label) {
                return label.name();
            }
View Full Code Here

    @Test
    public void testSetNodeLabel() throws Exception {
        RestNode n1 = restAPI.createNode(map("name", "node1"));
        n1.addLabel(LABEL_FOO);
        n1.addLabel(LABEL_BAR);
        Collection<String> labels = IteratorUtil.asCollection(new IterableWrapper<String, Label>(n1.getLabels()) {
            protected String underlyingObjectToObject(Label label) {
                return label.name();
            }
        });
View Full Code Here

    }

    @Test
    public void testRemoveNodeLabel2() throws Exception {
        RestNode n1 = restAPI.createNode(map("name", "node1"));
        n1.addLabel(LABEL_FOO);
        n1.addLabel(LABEL_BAR);

        n1.removeLabel(LABEL_BAR);
        Collection<String> labels = IteratorUtil.asCollection(new IterableWrapper<String, Label>(n1.getLabels()) {
            protected String underlyingObjectToObject(Label label) {
View Full Code Here

    @Test
    public void testRemoveNodeLabel2() throws Exception {
        RestNode n1 = restAPI.createNode(map("name", "node1"));
        n1.addLabel(LABEL_FOO);
        n1.addLabel(LABEL_BAR);

        n1.removeLabel(LABEL_BAR);
        Collection<String> labels = IteratorUtil.asCollection(new IterableWrapper<String, Label>(n1.getLabels()) {
            protected String underlyingObjectToObject(Label label) {
                return label.name();
View Full Code Here

    }

    @Test
    public void testGetNodeByLabelAndProperty() throws Exception {
        RestNode node = restAPI.createNode(map("name","foo bar"));
        node.addLabel(LABEL_FOO);
        int count=0;
        for (RestNode restNode : restAPI.getNodesByLabelAndProperty(LABEL_FOO.name(),"name","foo bar")) {
            assertEquals(node,restNode);
            count++;
        }
View Full Code Here

    }

    @Test
    public void testGetAllLabelNames() throws Exception {
        RestNode node = restAPI.createNode(map("name","foo bar"));
        node.addLabel(LABEL_FOO);
        node.addLabel(LABEL_BAR);
        assertThat(restAPI.getAllLabelNames(), hasItems(LABEL_FOO.name(),LABEL_BAR.name()));
    }
}
View Full Code Here

    @Test
    public void testGetAllLabelNames() throws Exception {
        RestNode node = restAPI.createNode(map("name","foo bar"));
        node.addLabel(LABEL_FOO);
        node.addLabel(LABEL_BAR);
        assertThat(restAPI.getAllLabelNames(), hasItems(LABEL_FOO.name(),LABEL_BAR.name()));
    }
}
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.