8081392: getNodeValue should return 'null' value for Element nodes

Reviewed-by: joehw
This commit is contained in:
Aleksei Efimov 2015-05-29 12:28:46 +03:00
parent adc531d210
commit d78a5bc2c1
2 changed files with 7 additions and 5 deletions

View File

@ -26,8 +26,9 @@ import org.w3c.dom.Node;
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;
}
}

View File

@ -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 @@ public class XSLT {
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();