use of org.apache.sling.api.request.RequestPathInfo in project sling by apache.
the class SlingRequestPathInfoTest method testPartialResolutionC.
public void testPartialResolutionC() {
RequestPathInfo p = new SlingRequestPathInfo(new MockResource("/some/path.print", ".a4.html/some/suffix"));
assertEquals("/some/path.print", p.getResourcePath());
assertEquals("a4", p.getSelectorString());
assertEquals(1, p.getSelectors().length);
assertEquals("a4", p.getSelectors()[0]);
assertEquals("html", p.getExtension());
assertEquals("/some/suffix", p.getSuffix());
}
use of org.apache.sling.api.request.RequestPathInfo in project sling by apache.
the class SlingRequestPathInfoTest method testSelectorsSplit.
public void testSelectorsSplit() {
RequestPathInfo p = new SlingRequestPathInfo(new MockResource("/some/path", ".print.a4.html/some/suffix"));
assertEquals("/some/path", p.getResourcePath());
assertEquals(2, p.getSelectors().length);
assertEquals("print", p.getSelectors()[0]);
assertEquals("a4", p.getSelectors()[1]);
assertEquals("html", p.getExtension());
assertEquals("/some/suffix", p.getSuffix());
}
use of org.apache.sling.api.request.RequestPathInfo in project sling by apache.
the class SlingRequestPathInfoTest method testDotsAroundSuffix.
public void testDotsAroundSuffix() {
RequestPathInfo p = new SlingRequestPathInfo(new MockResource("/libs/foo/content/something/formitems", ".json/image/vnd/xnd/knd.xml"));
assertEquals("/libs/foo/content/something/formitems", p.getResourcePath());
assertEquals("json", p.getExtension());
assertNull("Selectors are null", p.getSelectorString());
assertEquals("/image/vnd/xnd/knd.xml", p.getSuffix());
}
use of org.apache.sling.api.request.RequestPathInfo in project sling by apache.
the class SlingRequestPathInfoTest method testAllEmpty.
public void testAllEmpty() {
RequestPathInfo p = new SlingRequestPathInfo(new MockResource("/", null));
assertEquals("/", p.getResourcePath());
assertNull("Selectors are null", p.getSelectorString());
assertEquals(0, p.getSelectors().length);
assertNull("Extension is null", p.getExtension());
assertNull("Suffix is null", p.getSuffix());
}
use of org.apache.sling.api.request.RequestPathInfo in project sling by apache.
the class SlingRequestPathInfoTest method testJIRA_250_c.
public void testJIRA_250_c() {
RequestPathInfo p = new SlingRequestPathInfo(new MockResource("/", ".1.json/my/suffix"));
assertEquals("/", p.getResourcePath());
assertEquals("json", p.getExtension());
assertEquals("/my/suffix", p.getSuffix());
assertEquals("Selector string must not be null", "1", p.getSelectorString());
}
Aggregations