From 9b650b33badd9625c8cf5a48aa4cc8e812309519 Mon Sep 17 00:00:00 2001 From: aefimov Date: Sat, 5 Dec 2015 13:24:41 +0300 Subject: [PATCH] 8133924: NPE may be thrown when xsltc select a non-existing node after JDK-8062518 Reviewed-by: joehw, coffeys --- .../transform/8062518/XSLTFunctionsTest.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java b/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java index b60a7be3e..767267355 100644 --- a/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java +++ b/test/javax/xml/jaxp/transform/8062518/XSLTFunctionsTest.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 8062518 + * @bug 8062518 8133924 * @summary This class contains tests for XSLT functions * @compile DocumentExtFunc.java * @run testng/othervm XSLTFunctionsTest @@ -102,17 +102,34 @@ public class XSLTFunctionsTest { @DataProvider(name = "document") public static Object[][] documentTestData() { return new Object[][] { + // 8062518 {documentTestXml, documentTestXsl, documentTestExternalDoc, documentTesteExpectedResult}, + // 8133924 + {documentTestXml, nonExistingNodeXsl, documentTestExternalDoc, nonExistNodeExpectedResult}, }; } + // bug 8133924 xsl: test data to trigger the NPE when non-existing node is specified in xsl + static final String nonExistingNodeXsl = "" + + "" + + " " + + " " + + "" + + ""; + + //For bug 8133924 xsl the empty transformation result is expected instead of NPE + static final String nonExistNodeExpectedResult = "" + + "Doc"; + static final String documentTestXml = "Doc"; static final String documentTestExternalDoc = "External Doc"; static final String documentTestXsl = "" + "" + "" + "" -- GitLab