Examples of Propfind


Examples of org.apache.wink.webdav.model.Propfind

    }

    public void testAllProperties() throws Exception {

        // request
        Propfind propfind = new Propfind();
        propfind.setAllprop(new Allprop());
        Multistatus multistatus = propfind(propfind, "/", -1);

        // responses - depth is 1 so we have 2 ('/' and '/feed')
        Map<String, Response> responses = multistatus.getResponsesAsMapByHref();
        Assert.assertEquals(2, responses.size());
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

    }

    public void testNonExistingProperty() throws Exception {

        // request with depth 0
        Propfind propfind = new Propfind();
        QName propertyName = new QName("blah");
        Prop prop = new Prop();
        prop.setProperty(propertyName);
        propfind.setProp(prop);
        Multistatus multistatus = propfind(propfind, "/", 0);

        // 1 response - '/'
        Map<String, Response> responses = multistatus.getResponsesAsMapByHref();
        Assert.assertEquals(1, responses.size());
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

     */
    public Response propfind(SyndEntry entry, String propfindXml, PropertyHandler handler)
        throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

                             String propfindXml,
                             String depthStr,
                             CollectionPropertyHandler provider) throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

    @Test
    public void test2() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind2.xml"));
        Propfind propfind = read(input);
        Assert.assertNull(propfind.getProp());
        Assert.assertFalse(propfind.isAllprop());
        Assert.assertTrue(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        propfind.setPropname(new Propname());
        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

    @Test
    public void test3() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind3.xml"));
        Propfind propfind = read(input);
        Assert.assertNull(propfind.getProp());
        Assert.assertTrue(propfind.isAllprop());
        Assert.assertFalse(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        propfind.setAllprop(new Allprop());
        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }

    private Propfind read(String input) throws Exception {
        Propfind propfind = Propfind.unmarshal(new StringReader(input));
        return propfind;
    }
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

    @Test
    public void test1() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind1.xml"));
        Propfind propfind = read(input);
        Prop prop = propfind.getProp();
        Assert.assertEquals(PROPERTIES.length, prop.getAny().size());
        for (QName qname : PROPERTIES) {
            Element element = prop.getAnyByName(qname);
            Assert.assertNotNull(element);
            Assert.assertEquals(qname.getNamespaceURI(), element.getNamespaceURI());
            Assert.assertEquals(qname.getLocalPart(), element.getLocalName());
        }
        Assert.assertFalse(propfind.isAllprop());
        Assert.assertFalse(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        prop = new Prop();
        propfind.setProp(prop);
        prop.setProperty(PROPERTIES[0]);
        prop.setProperty(PROPERTIES[1]);
        prop.setProperty(PROPERTIES[2]);
        prop.setProperty(PROPERTIES[3]);
        diff = new Diff(input, write(propfind));
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

     */
    public Response propfind(SyndEntry entry, String propfindXml, PropertyHandler handler)
        throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here

Examples of org.apache.wink.webdav.model.Propfind

                             String propfindXml,
                             String depthStr,
                             CollectionPropertyHandler provider) throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
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.