You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by jk...@apache.org on 2024/01/19 22:04:43 UTC

(xalan-test) branch XALANJ-2419 updated: I *think* that deals with all the encoding-escaping interactions...

This is an automated email from the ASF dual-hosted git repository.

jkesselm pushed a commit to branch XALANJ-2419
in repository https://gitbox.apache.org/repos/asf/xalan-test.git


The following commit(s) were added to refs/heads/XALANJ-2419 by this push:
     new 61e57b0f I *think* that deals with all the encoding-escaping interactions...
61e57b0f is described below

commit 61e57b0f9e7444fa88f73a3cfbb5756d58696edb
Author: kubycsolutions <ke...@kubyc.solutions>
AuthorDate: Fri Jan 19 17:04:31 2024 -0500

    I *think* that deals with all the encoding-escaping interactions...
---
 build.xml                                          |  7 ++--
 .../org/apache/qetest/trax/ToXMLStreamTest.java    | 46 ++++++++++------------
 test.properties                                    | 16 ++++++--
 3 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/build.xml b/build.xml
index b1d858e5..02ff3930 100644
--- a/build.xml
+++ b/build.xml
@@ -121,9 +121,9 @@ dependencies - users must manually 'build jar' first.
 
     <!-- Various names/locations of dependent jars -->
     <!-- NOTE: Need to code version numbers into some jarfile names under
-	 mvn that we didn't under ant. See xxx.versioned.jar 
-	 Better fix might be to just use the one wildcard classpaths
-	 support, ${xalan.build.dir}/*
+         mvn that we didn't under ant. See xxx.versioned.jar 
+         Better fix might be to just use the one wildcard classpaths
+         support, ${xalan.build.dir}/*
     -->
     <property name="xalan.jar" value="${xalan.build.dir}/xalan.jar"/>
     <property name="xalan.unbundled.jar"
@@ -1734,6 +1734,7 @@ dependencies - users must manually 'build jar' first.
     <!-- ================================================================== -->
     <!-- Special: Targets specific to XSLTC which requires extra .jars      -->
     <!-- This section will be updated as xsltc integrates more with xalan   -->
+    <!-- (In fact, it's probably obsolete at this point)                    -->
     <!-- ================================================================== -->
     <!-- Actually, I'd like to figure out some sneaky Ant trick to
          allow swapping of parts of classpaths (i.e. swap in xsltc.jar
diff --git a/java/src/org/apache/qetest/trax/ToXMLStreamTest.java b/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
index e6f3d5cb..1c0fdafe 100644
--- a/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
+++ b/java/src/org/apache/qetest/trax/ToXMLStreamTest.java
@@ -71,7 +71,6 @@ public class ToXMLStreamTest extends ToStreamTest
         reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
 
         String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
-	String NCR_AELIG_OSLASH_ARING = "&#230;&#248;&#229;";
         String actual2 = outputCharacters(makeStream("UTF-8"), AELIG_OSLASH_ARING);
         reporter.check(actual2, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out unscathed");
         String actual2a = outputAttrValue(makeStream("UTF-8"), AELIG_OSLASH_ARING);
@@ -87,9 +86,9 @@ public class ToXMLStreamTest extends ToStreamTest
         reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
 
         String actual4 = outputCharacters(makeStream("UTF-8"), utf16String);
-        reporter.check(actual4, utf16String, "Astral characters should come out unscathed: got '"+actual4+"', expected '"+utf16String+"'");
+        reporter.check(actual4, utf16String, "Astral characters should come out unscathed");
         String actual4a = outputAttrValue(makeStream("UTF-8"), utf16String);
-        reporter.check(actual4a, utf16String, "Astral characters should come out unscathed (as attribute value): got '"+actual4+"', expected '"+utf16String+"'");
+        reporter.check(actual4a, utf16String, "Astral characters should come out unscathed (as attribute value)");
 
         reporter.testCaseClose();
         return true;
@@ -103,7 +102,7 @@ public class ToXMLStreamTest extends ToStreamTest
      */
     public boolean testCase2() throws SAXException, IOException
     {
-        reporter.testCaseInit("Verify setting output properties individually or whole blocks.");
+        reporter.testCaseInit("Verify handling of ISO-8859-1 encoding in ToStream.");
 
         String actual1 = outputCharacters(makeStream("ISO-8859-1"), "abc");
         reporter.check(actual1, "abc", "Simple characters should come out unscathed");
@@ -111,31 +110,26 @@ public class ToXMLStreamTest extends ToStreamTest
         reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
 
         String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
-	String NCR_AELIG_OSLASH_ARING = "&#230;&#248;&#229;";
         String actual2 = outputCharacters(makeStream("ISO-8859-1"), AELIG_OSLASH_ARING);
-        reporter.check(actual2, NCR_AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as Numeric Character References"+": got '"+actual2+"' expected '"+NCR_AELIG_OSLASH_ARING+"'");
+        reporter.check(actual2, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out unscathed");
         String actual2a = outputAttrValue(makeStream("ISO-8859-1"), AELIG_OSLASH_ARING);
-	// GONK: WRONG EXPECTED VALUE, LITERALS RATHER THAN NUMERIC CHAR REFS
-        reporter.check(actual2a, NCR_AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out as Numeric Character References (as attribute value)"+": got '"+actual2+"' expected '"+NCR_AELIG_OSLASH_ARING+"'");
+        reporter.check(actual2a, AELIG_OSLASH_ARING, "ISO-8859-1 characters should come out unscathed (attribute)");
 
         String CHINESE = "\u95c9\u6d77\u4e95";
+        String NCR_CHINESE = "&#38345;&#28023;&#20117;";
         String actual3 = outputCharacters(makeStream("ISO-8859-1"), CHINESE);
-        reporter.check(actual3, "&#38345;&#28023;&#20117;", "BMP characters should come out as Numeric Character References");
+        reporter.check(actual3, NCR_CHINESE, "BMP characters should come out as Numeric Character References");
         String actual3a = outputAttrValue(makeStream("ISO-8859-1"), CHINESE);
-        reporter.check(actual3a, "&#38345;&#28023;&#20117;", "BMP characters should come out as Numeric Character References (as attribute value)");
+        reporter.check(actual3a, NCR_CHINESE, "BMP characters should come out as Numeric Character References (as attribute value)");
 
         String utf16String = buildUtf16String(new int[] { 0x010030, 0xa4, 0x010032});
         reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
 
         String actual4 = outputCharacters(makeStream("ISO-8859-1"), utf16String);
-	// This was using literal for the middle character, but I think
-	// Numeric Character Entity is in fact expected...? GONK: REVIEW
-	String NCR_ASTRAL_MIX="&#65584;&#164;&#65586;";
-        reporter.check(actual4, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References"+": got '"+actual4+"' expected '"+NCR_ASTRAL_MIX+"'");
+        String NCR_ASTRAL_MIX="&#65584;\u00a4&#65586;";
+        reporter.check(actual4, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References");
         String actual4a = outputAttrValue(makeStream("ISO-8859-1"), utf16String);
-	// This was using literal for the middle character, but I think
-	// Numeric Character Entity is in fact expected...? GONK: REVIEW
-        reporter.check(actual4a, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References (as attribute value)"+": got '"+actual4+"' expected '"+NCR_ASTRAL_MIX+"'");
+        reporter.check(actual4a, NCR_ASTRAL_MIX, "Astral characters should come out as Numeric Character References (as attribute value)");
 
         reporter.testCaseClose();
         return true;
@@ -149,7 +143,7 @@ public class ToXMLStreamTest extends ToStreamTest
      */
     public boolean testCase3() throws SAXException, IOException
     {
-        reporter.testCaseInit("Verify setting output properties individually or whole blocks.");
+        reporter.testCaseInit("Verify handling of ASCII encoding in ToStream.");
 
         String actual1 = outputCharacters(makeStream("ASCII"), "abc");
         reporter.check(actual1, "abc", "Simple characters should come out unscathed");
@@ -157,24 +151,26 @@ public class ToXMLStreamTest extends ToStreamTest
         reporter.check(actual1a, "abc", "Simple characters should come out unscathed (as attribute value)");
 
         String AELIG_OSLASH_ARING = "\u00e6\u00f8\u00e5";
+        String NCR_AELIG_OSLASH_ARING = "&#230;&#248;&#229;";
         String actual2 = outputCharacters(makeStream("ASCII"), AELIG_OSLASH_ARING);
-        reporter.check(actual2, "&#230;&#248;&#229;","ISO-8859-1 characters should come out as Numeric Character References");
+        reporter.check(actual2, NCR_AELIG_OSLASH_ARING,"ISO-8859-1 characters should come out as Numeric Character References");
         String actual2a = outputAttrValue(makeStream("ASCII"), AELIG_OSLASH_ARING);
-        reporter.check(actual2a, "&#230;&#248;&#229;","ISO-8859-1 characters should come out as Numeric Character References (as attribute value)");
+        reporter.check(actual2a, NCR_AELIG_OSLASH_ARING,"ISO-8859-1 characters should come out as Numeric Character References (as attribute value)");
 
         String CHINESE = "\u95c9\u6d77\u4e95";
+        String NCR_CHINESE = "&#38345;&#28023;&#20117;";
         String actual3 = outputCharacters(makeStream("ASCII"), CHINESE);
-        reporter.check(actual3, "&#38345;&#28023;&#20117;", "BMP characters should come out as Numeric Character References");
+        reporter.check(actual3, NCR_CHINESE, "BMP characters should come out as Numeric Character References");
         String actual3a = outputAttrValue(makeStream("ASCII"), CHINESE);
-        reporter.check(actual3a, "&#38345;&#28023;&#20117;", "BMP characters should come out as Numeric Character References (as attribute value)");
+        reporter.check(actual3a, NCR_CHINESE, "BMP characters should come out as Numeric Character References (as attribute value)");
 
         String utf16String = buildUtf16String(new int[] { 0x010030, 0xa4, 0x010032});
         reporter.check(utf16String.length(), 5, "String with two astral characters and one in the BMP should have length of 5 UTF-16 code units");
-
+        String NCR_utf16String = "&#65584;&#164;&#65586;";
         String actual4 = outputCharacters(makeStream("ASCII"), utf16String);
-        reporter.check(actual4, "&#65584;&#164;&#65586;", "Astral characters should come out as Numeric Character References");
+        reporter.check(actual4, NCR_utf16String, "Astral characters should come out as Numeric Character References");
         String actual4a = outputAttrValue(makeStream("ASCII"), utf16String);
-        reporter.check(actual4a, "&#65584;&#164;&#65586;", "Astral characters should come out as Numeric Character References (as attribute value)");
+        reporter.check(actual4a, NCR_utf16String, "Astral characters should come out as Numeric Character References (as attribute value)");
 
         reporter.testCaseClose();
         return true;
diff --git a/test.properties b/test.properties
index 14218151..9990555b 100644
--- a/test.properties
+++ b/test.properties
@@ -102,9 +102,19 @@ qetest.perfLogging=true
 
 
 #---- Choose XSLT processor and test algorithim ----
+# TrAX is an old name for what became the javax.xml.transform interfaces
 # ProcessorWrapper flavors supported: trax|trax.dom|trax.sax|other...
 qetest.flavor=trax
 
+# Default to testing interpretive Apache Xalan, using Apache Xerces as
+# our parser.  If these aren't set, the JAXP/TrAX/javax factories will
+# select a default implementation, often one based on a back-level
+# snapshot of the Apache code.  For convenience, some of the test
+# targets explicitly replace these with other implementations, eg
+# switching to compiled-mode (xsltc) Xalan.
+javax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl
+
+
 # Exclusion lists based on specific flavors
 # Some tests are not valid when outputting DOMs
 # conflictres19.xsl mismatch-value;TEXT_NODE(#text)len=85;TEXT_NODE(#text)len=85;lengths do not match
@@ -169,7 +179,7 @@ smoketest.conf.supplemental.excludes=
 smoketest.extensions.excludes=javaBugzilla3722.xsl;libraryNodeset05.xsl;libraryNodeset06.xsl;libraryNodeset07.xsl;libraryNodeset08.xsl
 
 # Runs a selected set of known passing API tests
-smoketest.api.tests=trax.EmbeddedStylesheetTest;trax.ErrorListenerTest;trax.ErrorListenerAPITest;trax.ExamplesTest;trax.OutputPropertiesTest;trax.ToXMLStreamTest;trax.ToHTMLStreamTest;trax.TemplatesAPITest;trax.TransformerAPITest;trax.TransformerFactoryAPITest;trax.SystemIdTest;trax.SystemIdImpInclTest;trax.URIResolverTest;;trax.dom.DOMResultAPITest;trax.dom.DOMSourceAPITest;;trax.sax.SAXResultAPITest;trax.sax.SAXSourceAPITest;trax.sax.TemplatesHandlerAPITest;trax.sax.TransformerHandlerA [...]
+smoketest.api.tests=trax.EmbeddedStylesheetTest;trax.ErrorListenerTest;trax.ErrorListenerAPITest;trax.ExamplesTest;trax.OutputPropertiesTest;trax.ToXMLStreamTest;trax.ToHTMLStreamTest;trax.TemplatesAPITest;trax.TransformerAPITest;trax.TransformerFactoryAPITest;trax.SystemIdTest;trax.SystemIdImpInclTest;trax.URIResolverTest;;trax.dom.DOMResultAPITest;trax.dom.DOMSourceAPITest;;trax.sax.SAXResultAPITest;trax.sax.SAXSourceAPITest;trax.sax.TemplatesHandlerAPITest;trax.sax.TransformerHandlerA [...]
 smoketest.api.inputDir=tests/api
 smoketest.api.goldDir=tests/api-gold
 smoketest.api.outputDir=smoketest/api
@@ -239,7 +249,7 @@ minitest.passFile=smoketest/Pass-Minitest.xml
 #   Note tests do not all include package names since they'll 
 #   actually be loaded by QetestUtils.testClassForName()
 # Note: some tests are Xalan-specific; SmoketestOuttakes is expected to fail
-harness.tests=trax.EmbeddedStylesheetTest;trax.ErrorListenerAPITest;trax.ErrorListenerTest;trax.ExamplesTest;trax.OutputPropertiesTest;trax.ToXMLStreamTest;trax.ToHTMLStreamTest;trax.ParameterTest;trax.TemplatesAPITest;trax.TransformerAPITest;trax.TransformerFactoryAPITest;trax.SystemIdTest;trax.SystemIdImpInclTest;trax.URIResolverTest;;trax.dom.DOMResultAPITest;trax.dom.DOMSourceAPITest;;trax.sax.SAXResultAPITest;trax.sax.SAXSourceAPITest;trax.sax.SAXTransformerFactoryAPITest;trax.sax.T [...]
+harness.tests=trax.EmbeddedStylesheetTest;trax.ErrorListenerAPITest;trax.ErrorListenerTest;trax.ExamplesTest;trax.OutputPropertiesTest;trax.ToXMLStreamTest;trax.ToHTMLStreamTest;trax.ParameterTest;trax.TemplatesAPITest;trax.TransformerAPITest;trax.TransformerFactoryAPITest;trax.SystemIdTest;trax.SystemIdImpInclTest;trax.URIResolverTest;;trax.dom.DOMResultAPITest;trax.dom.DOMSourceAPITest;;trax.sax.SAXResultAPITest;trax.sax.SAXSourceAPITest;trax.sax.SAXTransformerFactoryAPITest;trax.sax.T [...]
 harness.threads.testlet=org.apache.qetest.xsl.ThreadedStylesheetTestlet
 harness.threads.fileList=threads.filelist
 
@@ -306,7 +316,7 @@ perf.xsltc.iterations=5
 qetest.dtm.tests=TestDTM;TestDTMIter;TestDTMTrav;TimeDTMIterDeep;TimeDTMTravDeep
 qetest.trax.dom.tests=DOMResultAPITest;DOMSourceAPITest
 qetest.trax.sax.tests=SAXResultAPITest;SAXSourceAPITest;SAXTransformerFactoryAPITest;TemplatesHandlerAPITest;TransformerHandlerAPITest;TransformerHandlerTest
-qetest.trax.tests=EmbeddedStylesheetTest;ErrorListenerAPITest;ErrorListenerTest;TransformerFactoryAPITest;URIResolverTest
+qetest.trax.tests=EmbeddedStylesheetTest;ErrorListenerAPITest;ErrorListenerTest;TransformerFactoryAPITest;URIResolverTest;ToHTMLStreamTest;ToXMLStreamTest;stream.StreamResultAPITest
 qetest.xalanj2.tests=DTMDumpTest;SerializedStylesheetTest;SmoketestOuttakes;SystemIDResolverAPITest;TestXPathAPI;TraceListenerTest;TransformStateAPITest
 
 # End of File


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xalan.apache.org
For additional commands, e-mail: commits-help@xalan.apache.org