// set resource super type
resourceSuperType = "foo:superBar";
resourceSuperTypePath = JcrResourceUtil.resourceTypeToPath(resourceSuperType);
resource.setResourceSuperType(resourceSuperType);
LocationIterator li = new LocationIterator(request.getResource(),
DEFAULT_SERVLET_NAME);
// 1. /apps/foo/bar
assertTrue(li.hasNext());
assertEquals(root0 + "/" + resourceTypePath, li.next());
// 2. /libs/foo/bar
assertTrue(li.hasNext());
assertEquals(root1 + "/" + resourceTypePath, li.next());
// 3. /apps/foo/superBar
assertTrue(li.hasNext());
assertEquals(root0 + "/" + resourceSuperTypePath, li.next());
// 4. /libs/foo/superBar
assertTrue(li.hasNext());
assertEquals(root1 + "/" + resourceSuperTypePath, li.next());
// 5. /apps/sling/servlet/default
assertTrue(li.hasNext());
assertEquals(root0 + "/" + DEFAULT_SERVLET_NAME, li.next());
// 6. /libs/sling/servlet/default
assertTrue(li.hasNext());
assertEquals(root1 + "/" + DEFAULT_SERVLET_NAME, li.next());
// 7. finished
assertFalse(li.hasNext());
}