db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: svn commit: r543183 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/UnaryOperatorNode.java testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Thu, 31 May 2007 18:00:58 GMT
Army <qozinx@gmail.com> writes:

> mamta@apache.org wrote:
>> +      +      s.executeUpdate("set schema APP");
>> +      checkLangBasedQuery(s, "SELECT XMLSERIALIZE(x as CHAR(10)) " +
>> +    		" FROM xmlTable, SYS.SYSTABLES WHERE " + +
>> " XMLSERIALIZE(x as CHAR(10)) = TABLENAME",
>> +      		null);
>
> Just for the record, I think use of XMLSERIALIZE here will fail if the
> test classpath does not include the required Xalan/JAXP classes
> (ex. Sun jdk15 with no external XML jars).  It might be good to wrap
> this particular test inside of an
>
>     if (XML.classpathMeetsXMLReqs())
>      ....
>
> where "XML" is junit/XML.java.  I think that's all that would be
> needed, though I haven't actually tried it out...

You're right that it fails with Sun jdk15 and jdk16 when Xalan is not in
classpath. However, this simple change in XML.checkXMLRequirements()
made CollationTest run just fine:

Index: java/engine/org/apache/derby/iapi/types/XML.java
===================================================================
--- java/engine/org/apache/derby/iapi/types/XML.java    (revision 543186)
+++ java/engine/org/apache/derby/iapi/types/XML.java    (working copy)
@@ -910,7 +910,9 @@
              * point in checking for Xalan unless we've already confirmed
              * that we have the JAXP interfaces.
              */
-            else if (!ClassInspector.classIsLoadable("org.apache.xpath.XPath"))
+            else if (!ClassInspector.classIsLoadable("org.apache.xpath.XPath")
+                         &&
+                     !ClassInspector.classIsLoadable("javax.xml.xpath.XPath"))
                 xmlReqCheck = "Xalan";
         }

Does this mean that the XML functionality works in Sun's JVMs too
without external Xalan jars, if we only check different package names,
or is there something else missing?

-- 
Knut Anders

Mime
View raw message