Package org.apache.sling.ide.transport

Examples of org.apache.sling.ide.transport.ResourceProxy


        assertThat("Incorrect node order", finalOrder, equalTo(expected));
    }

    private ResourceProxy newResource(String path, String primaryType) {

        ResourceProxy resource = new ResourceProxy(path);
        resource.addProperty("jcr:primaryType", primaryType);
        return resource;
    }
View Full Code Here


    }

    @Test
    public void parseFullCoverageXmlFile() throws ParserConfigurationException, SAXException, IOException {

        ResourceProxy root = parseContentXmlFile("full-coverage.xml", "/apps/full-coverage");

        assertThat("full-coverage path", root.getPath(), is("/apps/full-coverage"));
        assertThat("full-coverage properties.size", root.getProperties().size(), is(3));
        assertThat("full-coverage properties[jcr:title]", root.getProperties(),
                hasEntry("jcr:title", (Object) "Full coverage parent"));
        assertThat("full-coverage children.size", root.getChildren().size(), is(2));

        ResourceProxy parent1 = root.getChildren().get(0);
        assertThat("parent-1 path", parent1.getPath(), is("/apps/full-coverage/parent-1"));
        assertThat("parent-1 properties[jcr:title]", parent1.getProperties(),
                hasEntry("jcr:title", (Object) "Parent 1"));
        assertThat("parent-1 children.size", parent1.getChildren().size(), is(2));

        ResourceProxy child11 = parent1.getChildren().get(0);
        assertThat("child-1-1 path", child11.getPath(), is("/apps/full-coverage/parent-1/child-1-1"));
        assertThat("child-1-1 properties[jcr:title]", child11.getProperties(),
                hasEntry("jcr:title", (Object) "Child 1-1"));

    }
View Full Code Here

    }

    @Test
    public void parseRootContentXml() throws ParserConfigurationException, SAXException, IOException {

        ResourceProxy root = parseContentXmlFile("root-content.xml", "/");

        assertThat("root contains /jcr:system", root.getChildren(), hasChildPath("/jcr:system"));
    }
View Full Code Here

    }

    @Test
    public void encodedChildContentXml() throws ParserConfigurationException, SAXException, IOException {

        ResourceProxy root = parseContentXmlFile("encoded-child-content.xml", "/ROOT");

        assertThat("/ROOT contains /_jcr_content", root.getChildren(), hasChildPath("/ROOT/_jcr_content"));
    }
View Full Code Here

    }

    @Test
    public void parseContentXmlWithEscapedNames() throws ParserConfigurationException, SAXException, IOException {

        ResourceProxy root = parseContentXmlFile("full-coverage-escaped-names.xml", "/");
        assertThat("node contains /50-50", root.getChildren(), hasChildPath("/50-50"));
    }
View Full Code Here

    }

    @Test
    public void parseContentXmlWithBinaryProperty() throws ParserConfigurationException, SAXException, IOException {

        ResourceProxy root = parseContentXmlFile("binary-property.xml", "/");

        assertThat("root has 1 property, binary property is ignored", root.getProperties().entrySet(), hasSize(1));
    }
View Full Code Here

    }

    @Test
    public void escapedBraceAtStartOfPropertyValue() throws Exception {

        ResourceProxy root = parseContentXmlFile("escaped-braces-at-start-of-property.xml", "/");
        assertThat("properties[org.apache.sling.commons.log.pattern]",
                root.getProperties(), hasEntry("org.apache.sling.commons.log.pattern",
                        (Object) "{0,date,dd.MM.yyyy HH:mm:ss.SSS} *{4}* [{2}] {3} {5}"));
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.ide.transport.ResourceProxy

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.