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

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


        assertEquals(properties, node.getProperties());
    }

    public void testPropertiesSingleValue() throws IOException, JSONException {
        List<PropertyDescription> properties = new ArrayList<PropertyDescription>();
        PropertyDescription prop = new PropertyDescription();
        prop.setName("p1");
        prop.setValue("v1");
        properties.add(prop);
       
        String json = this.toJsonObject(properties).toString();
       
        NodeDescription node = this.parse(json);
View Full Code Here


        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }
   
    public void testPropertiesTwoSingleValue() throws IOException, JSONException {
        List<PropertyDescription> properties = new ArrayList<PropertyDescription>();
        PropertyDescription prop = new PropertyDescription();
        prop.setName("p1");
        prop.setValue("v1");
        properties.add(prop);
        prop = new PropertyDescription();
        prop.setName("p2");
        prop.setValue("v2");
        properties.add(prop);

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

        NodeDescription node = this.parse(json);
View Full Code Here

        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }

    public void testPropertiesMultiValue() throws IOException, JSONException {
        List<PropertyDescription> properties = new ArrayList<PropertyDescription>();
        PropertyDescription prop = new PropertyDescription();
        prop.setName("p1");
        prop.addValue("v1");
        properties.add(prop);

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

        NodeDescription node = this.parse(json);
View Full Code Here

        assertEquals(new HashSet<PropertyDescription>(properties), new HashSet<PropertyDescription>(node.getProperties()));
    }

    public void testPropertiesMultiValueEmpty() throws IOException, JSONException {
        List<PropertyDescription> properties = new ArrayList<PropertyDescription>();
        PropertyDescription prop = new PropertyDescription();
        prop.setName("p1");
        prop.addValue(null); // empty multivalue property
        properties.add(prop);

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

        NodeDescription node = this.parse(json);
View Full Code Here

    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();
View Full Code Here

TOP

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

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.