changeset 10793:c716a8cc3454

8081392: getNodeValue should return 'null' value for Element nodes Reviewed-by: joehw
author aefimov
date Sun, 31 May 2015 18:55:35 +0300
parents e62f6298008c
children cc67fbf19cfb
files test/javax/xml/jaxp/common/8032908/TestFunc.java test/javax/xml/jaxp/common/8032908/XSLT.java test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java
diffstat 3 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/test/javax/xml/jaxp/common/8032908/TestFunc.java	Sat May 30 15:19:15 2015 +0300
+++ b/test/javax/xml/jaxp/common/8032908/TestFunc.java	Sun May 31 18:55:35 2015 +0300
@@ -26,8 +26,9 @@
 public class TestFunc {
 
     public static String test(Node node) {
-        String s = node.getTextContent();
-        return s;
+        String textContent = node.getTextContent();
+        String nodeValue   = node.getNodeValue();
+        return textContent + ":" + nodeValue;
     }
 
 }
--- a/test/javax/xml/jaxp/common/8032908/XSLT.java	Sat May 30 15:19:15 2015 +0300
+++ b/test/javax/xml/jaxp/common/8032908/XSLT.java	Sun May 31 18:55:35 2015 +0300
@@ -23,9 +23,10 @@
 
 /**
  * @test
- * @bug 8032908
+ * @bug 8032908 8081392
  * @summary Test if Node.getTextContent() function correctly returns children
- * content
+ * content and also check that Node.getNodeValue() returns null value for
+ * Element nodes
  * @compile TestFunc.java XSLT.java
  * @run main/othervm XSLT
  */
@@ -40,7 +41,7 @@
 
     static final String XMLTOTRANSFORM = "/in.xml";
     static final String XSLTRANSFORMER = "/test.xsl";
-    static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG";
+    static final String EXPECTEDRESULT = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>ABCDEFG:null";
 
     public static void main(String[] args) throws TransformerException {
         ByteArrayOutputStream resStream = new ByteArrayOutputStream();
--- a/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java	Sat May 30 15:19:15 2015 +0300
+++ b/test/javax/xml/jaxp/transform/8062518/DocumentExtFunc.java	Sun May 31 18:55:35 2015 +0300
@@ -27,6 +27,6 @@
 
     public static String test(NodeList list) {
         Node node = list.item(0);
-        return "["+node.getNodeName() + ":" + node.getNodeValue()+"]";
+        return "[" + node.getNodeName() + ":" + node.getTextContent() + "]";
     }
 }