Package org.apache.jackrabbit.spi.Path

Examples of org.apache.jackrabbit.spi.Path.Element


        assertEquals(123, element.getNormalizedIndex());
        assertEquals("{}test[123]", element.getString());
    }

    public void testParentElement() {
        Element element = ParentPath.PARENT_PATH;
        assertFalse(element.denotesCurrent());
        assertFalse(element.denotesIdentifier());
        assertFalse(element.denotesName());
        assertTrue(element.denotesParent());
        assertFalse(element.denotesRoot());
        assertEquals(createName(".."), element.getName());
        assertEquals(Path.INDEX_UNDEFINED, element.getIndex());
        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("..", element.getString());
    }
View Full Code Here


        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("..", element.getString());
    }

    public void testRootElement() {
        Element element = RootPath.ROOT_PATH;
        assertFalse(element.denotesCurrent());
        assertFalse(element.denotesIdentifier());
        assertFalse(element.denotesName());
        assertFalse(element.denotesParent());
        assertTrue(element.denotesRoot());
        assertEquals(createName(""), element.getName());
        assertEquals(Path.INDEX_UNDEFINED, element.getIndex());
        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("{}", element.getString());
    }
View Full Code Here

    private Name createName(String name) {
        return NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, name);
    }

    public void testCurrentElement() {
        Element element = CurrentPath.CURRENT_PATH;
        assertTrue(element.denotesCurrent());
        assertFalse(element.denotesIdentifier());
        assertFalse(element.denotesName());
        assertFalse(element.denotesParent());
        assertFalse(element.denotesRoot());
        assertEquals(createName("."), element.getName());
        assertEquals(Path.INDEX_UNDEFINED, element.getIndex());
        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals(".", element.getString());
    }
View Full Code Here

        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals(".", element.getString());
    }

    public void testIdentifierElement() {
        Element element = new IdentifierPath("test");
        assertFalse(element.denotesCurrent());
        assertTrue(element.denotesIdentifier());
        assertFalse(element.denotesName());
        assertFalse(element.denotesParent());
        assertFalse(element.denotesRoot());
        assertNull(element.getName());
        assertEquals(Path.INDEX_UNDEFINED, element.getIndex());
        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("[test]", element.getString());
    }
View Full Code Here

        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("[test]", element.getString());
    }

    public void testNameElement() {
        Element element =
            new NamePath(null, createName("test"), Path.INDEX_UNDEFINED);
        assertFalse(element.denotesCurrent());
        assertFalse(element.denotesIdentifier());
        assertTrue(element.denotesName());
        assertFalse(element.denotesParent());
        assertFalse(element.denotesRoot());
        assertEquals(createName("test"), element.getName());
        assertEquals(Path.INDEX_UNDEFINED, element.getIndex());
        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("{}test", element.getString());
    }
View Full Code Here

        assertEquals(Path.INDEX_DEFAULT, element.getNormalizedIndex());
        assertEquals("{}test", element.getString());
    }

    public void testIndexedNameElement() {
        Element element = new NamePath(null, createName("test"), 123);
        assertFalse(element.denotesCurrent());
        assertFalse(element.denotesIdentifier());
        assertTrue(element.denotesName());
        assertFalse(element.denotesParent());
        assertFalse(element.denotesRoot());
        assertEquals(createName("test"), element.getName());
        assertEquals(123, element.getIndex());
        assertEquals(123, element.getNormalizedIndex());
        assertEquals("{}test[123]", element.getString());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.Path.Element

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.