Package org.apache.sling.engine.impl.request

Examples of org.apache.sling.engine.impl.request.SlingRequestPathInfo


        assertEquals("1", p.getSelectorString());
    }
   
    public void testJIRA_250_b() {
      RequestPathInfo p =
            new SlingRequestPathInfo(
                    new MockResource("/"),
                    "/.1.json"
            );
        assertEquals("/", p.getResourcePath());
        assertEquals("json", p.getExtension());
        assertNull(p.getSuffix());
        assertEquals("Selector string must not be null", "1", p.getSelectorString());
    }
View Full Code Here


        assertEquals("Selector string must not be null", "1", p.getSelectorString());
    }
   
    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());
    }
View Full Code Here

        assertEquals("Selector string must not be null", "1", p.getSelectorString());
    }
   
    public void testJIRA_250_d() {
      RequestPathInfo p =
            new SlingRequestPathInfo(
                    new MockResource("/"),
                    "/.json"
            );
        assertEquals("/", p.getResourcePath());
        assertEquals("json", p.getExtension());
        assertNull(p.getSuffix());
        assertNull(p.getSelectorString());
    }
View Full Code Here

/** Test the SlingRequestPathInfo class */
public class SlingRequestPathInfoTest extends TestCase {

    public void testNullResource() {
        try {
            new SlingRequestPathInfo(null);
            fail("Expected NullPointerException");
        } catch (NullPointerException npe) {
            // required for a null resource
        }
    }
View Full Code Here

            // required for a null resource
        }
    }

    public void testTrailingDot() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", "."));
        assertEquals("/some/path", 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());
    }
View Full Code Here

        assertNull("Extension is null",p.getExtension());
        assertNull("Suffix is null", p.getSuffix());
    }

    public void testTrailingDotWithSuffix() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", "./suffix"));
        assertEquals("/some/path", p.getResourcePath());
        assertNull("Selectors are null",p.getSelectorString());
        assertEquals(0, p.getSelectors().length);
        assertNull("Extension is null",p.getExtension());
        assertEquals("/suffix", p.getSuffix());
    }
View Full Code Here

        assertNull("Extension is null",p.getExtension());
        assertEquals("/suffix", p.getSuffix());
    }

    public void testTrailingDotDot() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", ".."));
        assertEquals("/some/path", 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());
    }
View Full Code Here

        assertNull("Extension is null",p.getExtension());
        assertNull("Suffix is null",p.getSuffix());
    }

    public void testTrailingDotDotWithSuffix() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", "../suffix"));
        assertEquals("/some/path", p.getResourcePath());
        assertNull("Selectors are null",p.getSelectorString());
        assertEquals(0, p.getSelectors().length);
        assertNull("Extension is null",p.getExtension());
        assertEquals("/suffix", p.getSuffix());
    }
View Full Code Here

        assertNull("Extension is null",p.getExtension());
        assertEquals("/suffix", p.getSuffix());
    }

    public void testTrailingDotDotDot() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", "..."));
        assertEquals("/some/path", 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());
    }
View Full Code Here

        assertNull("Extension is null",p.getExtension());
        assertNull("Suffix is null",p.getSuffix());
    }

    public void testTrailingDotDotDotWithSuffix() {
        RequestPathInfo p = new SlingRequestPathInfo(new MockResource(
            "/some/path", ".../suffix"));
        assertEquals("/some/path", p.getResourcePath());
        assertNull("Selectors are null",p.getSelectorString());
        assertEquals(0, p.getSelectors().length);
        assertNull("Extension is null",p.getExtension());
        assertEquals("/suffix", p.getSuffix());
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.engine.impl.request.SlingRequestPathInfo

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.