Package org.apache.sling.jcr.contentloader.internal

Examples of org.apache.sling.jcr.contentloader.internal.NodeDescription


        prop.setValue("v2");
        properties.add(prop);

        String json = this.toJsonObject(properties).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }
View Full Code Here


        prop.addValue("v1");
        properties.add(prop);

        String json = this.toJsonObject(properties).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }
View Full Code Here

        prop.addValue(null); // empty multivalue property
        properties.add(prop);

        String json = this.toJsonObject(properties).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }
View Full Code Here

    public void testChildrenNone() throws IOException, JSONException {
        List<NodeDescription> nodes = null;
        String json = this.toJsonObject(nodes).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(nodes, node.getChildren());
    }
View Full Code Here

        assertEquals(nodes, node.getChildren());
    }

    public void testChild() throws IOException, JSONException {
        List<NodeDescription> nodes = new ArrayList<NodeDescription>();
        NodeDescription child = new NodeDescription();
        child.setName("p1");
        nodes.add(child);

        String json = this.toJsonObject(nodes).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(nodes, node.getChildren());
    }
View Full Code Here

        assertEquals(nodes, node.getChildren());
    }

    public void testChildWithMixin() throws IOException, JSONException {
        List<NodeDescription> nodes = new ArrayList<NodeDescription>();
        NodeDescription child = new NodeDescription();
        child.setName("p1");
        child.addMixinNodeType("p1:mix");
        nodes.add(child);

        String json = this.toJsonObject(nodes).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(nodes, node.getChildren());
    }
View Full Code Here

        assertEquals(nodes, node.getChildren());
    }

    public void testTwoChildren() throws IOException, JSONException {
        List<NodeDescription> nodes = new ArrayList<NodeDescription>();
        NodeDescription child = new NodeDescription();
        child.setName("p1");
        nodes.add(child);
        child = new NodeDescription();
        child.setName("p2");
        nodes.add(child);

        String json = this.toJsonObject(nodes).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(nodes, node.getChildren());
    }
View Full Code Here

        assertEquals(nodes, node.getChildren());
    }

    public void testChildWithProperty() throws IOException, JSONException {
        List<NodeDescription> nodes = new ArrayList<NodeDescription>();
        NodeDescription child = new NodeDescription();
        child.setName("c1");
        PropertyDescription prop = new PropertyDescription();
        prop.setName("c1p1");
        prop.setValue("c1v1");
        child.addProperty(prop);
        nodes.add(child);

        String json = this.toJsonObject(nodes).toString();

        NodeDescription node = this.parse(json);
        assertNotNull("Expecting node", node);
        assertEquals(nodes, node.getChildren());
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.jcr.contentloader.internal.NodeDescription

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.