Code example for Text

Methods: replaceWholeText

0
        assertEquals(expected, domToString(document));
    } 
 
    public void testReplaceWholeTextFirstWithNull() throws TransformerException { 
        String original = domToString(document);
        assertNull(descriptionText1.replaceWholeText(null));
        String expected = original.replaceFirst(">.*</description>", "/>");
        assertEquals("This implementation doesn't remove adjacent nodes in replaceWholeText(null)",
                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);