Code example for CDATASection

Methods: replaceWholeText

0
                expected, domToString(document));
    } 
 
    public void testReplaceWholeTextMiddleWithNull() throws TransformerException { 
        String original = domToString(document);
        assertNull(descriptionText2.replaceWholeText(null));
        String expected = original.replaceFirst(">.*</description>", "/>");
        assertEquals("This implementation doesn't remove adjacent nodes in replaceWholeText(null)",
                expected, domToString(document));
    } 
 
    public void testReplaceWholeTextLastWithNull() throws TransformerException { 
        String original = domToString(document);
        assertNull(descriptionText3.replaceWholeText(null));
        String expected = original.replaceFirst(">.*</description>", "/>");
        assertEquals("This implementation doesn't remove adjacent nodes in replaceWholeText(null)",
                expected, domToString(document));
    } 
 
    public void testReplaceWholeTextFirstWithEmptyString() throws TransformerException { 
Connect your IDE to all the code out there  Get Codota for Java