Package org.jaxen

Examples of org.jaxen.BaseXPath.evaluate()


    public void testNaNIsFalse()
      throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("boolean(0 div 0)");
        Object result = xpath.evaluate(null);
        assertEquals(Boolean.FALSE, result);
       
    }   

    public void testNonEmptyStringIsTrue()
View Full Code Here


 
    public void testStringLengthFunctionOperatesOnContextNode()
      throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("string-length()");
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(0, result.intValue());
       
    }   

    public void testStringLengthWithPrivateUseChars() throws JaxenException
View Full Code Here

   
    public void testStringLengthFunctionCountsUnicodeCharactersNotJavaChars()
      throws JaxenException {
  
        BaseXPath xpath = new DOMXPath("string-length('\uD834\uDD00')");
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(1, result.intValue());
       
    }   

    public void testStringLengthFunctionWithMalformedString()
View Full Code Here

    public void testStringLengthFunctionWithMalformedString()
      throws JaxenException {
  
        BaseXPath xpath = new DOMXPath("string-length('\uD834A\uDD00')");
        try {
            xpath.evaluate( doc );
            fail("Allowed Malformed string");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
View Full Code Here

   
    public void testCountRootElement()
      throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("count(/*)");
        Double result = (Double) xpath.evaluate(doc);
        assertEquals(1.0, result.doubleValue(), 0.00001);
       
   
   
   
View Full Code Here

    public void testCeiling() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("ceiling(1.5)");
       
        Object result = xpath.evaluate(doc);
        assertEquals(2, ((Double) result).doubleValue(), 0.0001);
       
    }   

    public void testNegativeCeiling() throws JaxenException {
View Full Code Here

    public void testNegativeCeiling() throws JaxenException {
       
        BaseXPath xpath = new DOMXPath("ceiling(-1.5)");
       
        Object result = xpath.evaluate(doc);
        assertEquals(-1, ((Double) result).doubleValue(), 0.0001);
       
    }   

    public void testNaNCeilingIsNaN() throws JaxenException {
View Full Code Here

       
    }   

    public void testNaNCeilingIsNaN() throws JaxenException {
        BaseXPath xpath = new DOMXPath("ceiling(1.0 div 0.0 - 2.0 div 0.0)");
        double result = ((Double) xpath.evaluate(doc)).doubleValue();
        assertTrue(Double.isNaN(result));
    }   

    public void testCeilingFunctionRequiresAtLeastOneArgument()
      throws JaxenException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.