Revision: 232
http://jsptest.svn.sourceforge.net/jsptest/?rev=232&view=rev
Author: lkoskela
Date: 2008-06-27 04:32:15 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
Added a test for ignoring comments when collecting 'text content'
Modified Paths:
--------------
trunk/jsptest-generic/jsptest-common/src/test/java/net/sf/jsptest/utils/XMLTest.java
Modified: trunk/jsptest-generic/jsptest-common/src/test/java/net/sf/jsptest/utils/XMLTest.java
===================================================================
--- trunk/jsptest-generic/jsptest-common/src/test/java/net/sf/jsptest/utils/XMLTest.java 2008-05-03 20:49:55 UTC (rev 231)
+++ trunk/jsptest-generic/jsptest-common/src/test/java/net/sf/jsptest/utils/XMLTest.java 2008-06-27 11:32:15 UTC (rev 232)
@@ -33,6 +33,12 @@
assertEquals("parentchild", XML.textContentOf(element));
}
+ public void testCommentsAreIgnoredWhenCollectingTextContent()
+ throws Exception {
+ Element element = parse("<p>before comment<!-- ignore -->After comment</p>");
+ assertEquals("before commentAfter comment", XML.textContentOf(element));
+ }
+
private Element parse(String xmlSnippet) throws Exception {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder parser = dbf.newDocumentBuilder();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|