Package org.apache.sling.servlets.resolver.helper

Examples of org.apache.sling.servlets.resolver.helper.LocationIterator


        // set resource super type
        resourceSuperType = "foo:superBar";
        resourceSuperTypePath = JcrResourceUtil.resourceTypeToPath(resourceSuperType);
        resource.setResourceSuperType(resourceSuperType);

        LocationIterator li = new LocationIterator(request.getResource(),
            DEFAULT_SERVLET_NAME);

        // 1. /foo/bar
        assertTrue(li.hasNext());
        assertEquals(resourceTypePath, li.next());

        // 2. /apps/foo/superBar
        assertTrue(li.hasNext());
        assertEquals(root0 + "/" + resourceSuperTypePath, li.next());

        // 3. /apps/sling/servlet/default
        assertTrue(li.hasNext());
        assertEquals(root0 + "/" + DEFAULT_SERVLET_NAME, li.next());

        // 4. finished
        assertFalse(li.hasNext());
    }
View Full Code Here


        // set resource super type
        resourceSuperType = "foo:superBar";
        resourceSuperTypePath = JcrResourceUtil.resourceTypeToPath(resourceSuperType);
        resource.setResourceSuperType(resourceSuperType);

        LocationIterator li = new LocationIterator(request.getResource(),
            DEFAULT_SERVLET_NAME);

        // 1. /foo/bar
        assertTrue(li.hasNext());
        assertEquals(resourceTypePath, li.next());

        // 2. /apps/foo/superBar
        assertTrue(li.hasNext());
        assertEquals(root0 + "/" + resourceSuperTypePath, li.next());

        // 3. /libs/foo/superBar
        assertTrue(li.hasNext());
        assertEquals(root1 + "/" + resourceSuperTypePath, li.next());

        // 4. /apps/sling/servlet/default
        assertTrue(li.hasNext());
        assertEquals(root0 + "/" + DEFAULT_SERVLET_NAME, li.next());

        // 5. /libs/sling/servlet/default
        assertTrue(li.hasNext());
        assertEquals(root1 + "/" + DEFAULT_SERVLET_NAME, li.next());

        // 6. finished
        assertFalse(li.hasNext());
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.servlets.resolver.helper.LocationIterator

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.