Package org.jaxen

Examples of org.jaxen.XPath.evaluate()


    }   
 
    public void testTranslateIgnoresExtraArguments() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'b', 'dghf')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("adc", result);
    }   
 
    public void testTranslateFunctionRequiresAtLeastThreeArguments()
      throws JaxenException {
View Full Code Here


    }  
   
    public void testTranslateStringThatContainsNonBMPChars() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('ab\uD834\uDD00b', 'b', 'd')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("ad\uD834\uDD00d", result);
    }
   

    public void testTranslateNonBMPChars() throws JaxenException
View Full Code Here

   

    public void testTranslateNonBMPChars() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('ab\uD834\uDD00b', '\uD834\uDD00', 'd')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("abdb", result);
    }  
   

    public void testTranslateNonBMPChars2() throws JaxenException
View Full Code Here

   

    public void testTranslateNonBMPChars2() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('ab\uD834\uDD00b', '\uD834\uDD00', 'da')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("abdb", result);
    }  
   

    public void testTranslateWithNonBMPChars() throws JaxenException
View Full Code Here

   

    public void testTranslateWithNonBMPChars() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834\uDD00')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("ab\uD834\uDD00", result);
    }  
   

    public void testTranslateWithNonBMPChars2() throws JaxenException
View Full Code Here

   

    public void testTranslateWithNonBMPChars2() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834\uDD00b')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("ab\uD834\uDD00", result);
    }  
   

    public void testTranslateWithMalformedSurrogatePair() throws JaxenException
View Full Code Here

    public void testTranslateWithMalformedSurrogatePair() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', '\uD834X\uDD00b')" );
        try {
            xpath.evaluate( doc );
            fail("Allowed malformed surrogate pair");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
View Full Code Here

    public void testTranslateWithMissingLowSurrogate() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', 'AB\uD834X')" );
        try {
            xpath.evaluate( doc );
            fail("Allowed malformed surrogate pair");
        }
        catch (FunctionCallException ex) {
            assertNotNull(ex.getMessage());
        }
View Full Code Here

   

    public void testTranslateWithExtraCharsInReplacementString() throws JaxenException
    {
        XPath xpath = new DOMXPath( "translate('abc', 'c', 'def')" );
        String result = (String) xpath.evaluate( doc );
        assertEquals("abd", result);
    }  
   

}
View Full Code Here

    }

    public void testStringLengthOfNumber() throws JaxenException
    {
        XPath xpath = new DOMXPath( "string-length(3)" );
        Double result = (Double) xpath.evaluate( doc );
        assertEquals(1, result.intValue());
    }   
 
    public void testStringLengthOfEmptyString() 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.