Code example for NodeList

Methods: getLength

0
        if (count.length() > 0) { 
            return new XPathTest(context, select) { 
                @Override void test(Node contextNode) throws XPathExpressionException {
                    NodeList result = (NodeList) xpath.evaluate(
                            select, contextNode, XPathConstants.NODESET);
                    assertEquals(Integer.parseInt(count), result.getLength());
                } 
            }; 
        } 
 
        throw new UnsupportedOperationException("Unsupported test: " + context); 
    } 
 
    /** 
     * Returns the test described by the given {@code <valueOf>} element. These 
     * tests select an expected text. 
     */ 
    private static TestCase createFromValueOf(
            final XPath xpath, final Context context, final Element element) {
        final String select = element.getAttribute("select");
        return new XPathTest(context, select) {