db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1054991 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java
Date Tue, 04 Jan 2011 12:07:15 GMT
Author: kahatlen
Date: Tue Jan  4 12:07:15 2011
New Revision: 1054991

URL: http://svn.apache.org/viewvc?rev=1054991&view=rev
Log:
DERBY-2739: Test XPath function call prefixed with namespace

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java?rev=1054991&r1=1054990&r2=1054991&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XMLTypeAndOpsTest.java
Tue Jan  4 12:07:15 2011
@@ -1572,7 +1572,30 @@ public final class XMLTypeAndOpsTest ext
             + "returning sequence empty on empty)"
             + "  as char(70))"
             + "from t1");
-        
+
+        // This should also fail because the function is not recognized.
+        // In addition, we have prefixed the function with an unrecognized
+        // namespace. Verify that it fails with an SQLException and that there
+        // isn't any NPE in the exception chain.
+        try {
+            prepareStatement(
+                    "select i,"
+                    + "  xmlserialize("
+                    + "    xmlquery('myns:data(//@*)' passing by ref x "
+                    + "returning sequence empty on empty)"
+                    + "  as char(70))"
+                    + "from t1");
+            fail("Compilation should fail because of unrecognized namespace");
+        } catch (SQLException sqle) {
+            assertSQLState("10000", sqle);
+            Throwable t = sqle;
+            while ((t = t.getCause()) != null) {
+                if (t instanceof NullPointerException) {
+                    fail("No NPE, please!", t);
+                }
+            }
+        }
+
         // These should all succeed.  Since it's Xalan that's 
         // actually doing the query evaluation we don't need to 
         // test very many queries; we just want to make sure we get 



Mime
View raw message