Package org.apache.commons.jxpath.ri

Examples of org.apache.commons.jxpath.ri.QName


     * @return the name of this node
     */
    @Override
    public QName getName()
    {
        return new QName(null, attributeResult.getAttributeName());
    }
View Full Code Here


    @Test
    public void testIterateAllAttributes()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName(null, "*"));
        assertEquals("Wrong number of attributes", 3, iteratorSize(it));
        List<NodePointer> attrs = iterationElements(it);
        Set<String> attrNames = new HashSet<String>();
        for (NodePointer np : attrs)
        {
View Full Code Here

    @Test
    public void testIterateSpecificAttribute()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName(null, TEST_ATTR));
        assertEquals("Wrong number of attributes", 1, iteratorSize(it));
        assertEquals("Wrong attribute", TEST_ATTR, iterationElements(it).get(0)
                .getName().getName());
    }
View Full Code Here

    @Test
    public void testIterateUnknownAttribute()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName(null, "unknown"));
        assertEquals("Found attributes", 0, iteratorSize(it));
    }
View Full Code Here

    @Test
    public void testIterateNamespaceUnknown()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName("test", "*"));
        assertEquals("Found attributes", 0, iteratorSize(it));
    }
View Full Code Here

    @Test
    public void testIterateNamespaceAttribute()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName(NAMESPACE, "attr"));
        assertEquals("Wrong number of attributes", 1, iteratorSize(it));
        assertEquals("Wrong attribute", NS_ATTR, iterationElements(it).get(0)
                .getName().getName());
    }
View Full Code Here

    @Test
    public void testIterateNamespaceWildcard()
    {
        ConfigurationNodeIteratorAttribute<ImmutableNode> it =
                new ConfigurationNodeIteratorAttribute<ImmutableNode>(pointer,
                        new QName(NAMESPACE, "*"));
        assertEquals("Wrong number of attributes", 1, iteratorSize(it));
        assertEquals("Wrong attribute", NS_ATTR, iterationElements(it).get(0)
                .getName().getName());
    }
View Full Code Here

            assertEquals("Wrong child", node.getChildren().get(index - 1),
                    pchild.getNode());
            checkIterators(pchild);
        }

        it = p.attributeIterator(new QName(null, "*"));
        assertEquals("Iterator count differs from attribute count", node
                .getAttributes().size(), iteratorSize(it));
        for (int index = 1; it.setPosition(index); index++)
        {
            NodePointer pattr = it.getNodePointer();
View Full Code Here

     * Tests using a node test with a wildcard name.
     */
    @Test
    public void testIterateWithWildcardTest()
    {
        NodeNameTest test = new NodeNameTest(new QName(null, "*"));
        ConfigurationNodeIteratorChildren<ImmutableNode> it =
                new ConfigurationNodeIteratorChildren<ImmutableNode>(
                        rootPointer, test, false, null);
        assertEquals("Wrong number of elements", CHILD_COUNT, iteratorSize(it));
    }
View Full Code Here

     * namespaces are not supported, no elements should be in the iteration.
     */
    @Test
    public void testIterateWithPrefixTest()
    {
        NodeNameTest test = new NodeNameTest(new QName("prefix", "*"));
        ConfigurationNodeIteratorChildren<ImmutableNode> it =
                new ConfigurationNodeIteratorChildren<ImmutableNode>(
                        rootPointer, test, false, null);
        assertNull("Undefined node pointer not returned", it.getNodePointer());
        assertEquals("Prefix was not evaluated", 0, iteratorSize(it));
View Full Code Here

TOP

Related Classes of org.apache.commons.jxpath.ri.QName

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.