You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2003/05/26 19:21:19 UTC

cvs commit: xml-xerces/java/tests/dom/mem Test.java

elena       2003/05/26 10:21:19

  Modified:    java/tests/dom/mem Test.java
  Log:
  Add tests to textContent
  
  Revision  Changes    Path
  1.13      +24 -1     xml-xerces/java/tests/dom/mem/Test.java
  
  Index: Test.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/tests/dom/mem/Test.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Test.java	24 Mar 2003 20:11:05 -0000	1.12
  +++ Test.java	26 May 2003 17:21:19 -0000	1.13
  @@ -62,6 +62,11 @@
   //       2.  Regression tests for bugs fixed.
   //     All individual are wrapped in a memory leak checker.
   //
  +//     DOM Level 3:
  +//     1. textContent 
  +//     2. userData
  +//     3. isEqualNode
  +//
   //     This is NOT a complete test of DOM functionality.
   //
   
  @@ -1285,6 +1290,24 @@
           el2.setTextContent("bye now");
           el.appendChild(el2);
           Assertion.equals(el.getTextContent(), "yo!bye now");
  +        
  +        // check that empty element does not produce null value
  +		NodeImpl el3 = (NodeImpl) doc.createElement("test");
  +		el.appendChild(el3);
  +		NodeImpl empty = (NodeImpl) doc.createElement("empty");
  +		el3.appendChild(empty);
  +		Assertion.verify(el3.getTextContent() != null);
  +		
  +		empty.setTextContent("hello");
  +		Assertion.verify(empty.getChildNodes().getLength() == 1);
  +		// check that setting to empty string or null, does not produce
  +		// any text node
  +		empty.setTextContent(null);
  +		Assertion.verify(empty.getChildNodes().getLength() == 0);
  +		empty.setTextContent("");
  +		Assertion.verify(empty.getChildNodes().getLength() == 0);
  +		
  +		
   
   
           class MyHandler implements UserDataHandler {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org