Exemplo n.º 1
0
 @Test
 public void testPrependText() {
   Document doc = Jsoup.parse("<div id=1><p>Hello</p></div>");
   Element div = doc.getElementById("1");
   div.prependText("there & now > ");
   assertEquals("there & now > Hello", div.text());
   assertEquals("there &amp; now &gt; <p>Hello</p>", TextUtil.stripNewlines(div.html()));
 }
Exemplo n.º 2
0
 @Test(expected = IllegalArgumentException.class)
 public void testThrowsOnPrependNullText() {
   Document doc = Jsoup.parse("<div id=1><p>Hello</p></div>");
   Element div = doc.getElementById("1");
   div.prependText(null);
 }