db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r544856 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
Date Wed, 06 Jun 2007 14:45:27 GMT
Author: kristwaa
Date: Wed Jun  6 07:45:27 2007
New Revision: 544856

URL: http://svn.apache.org/viewvc?view=rev&rev=544856
Log:
DERBY-2770: Fixed BlobClob4BlobTest from failing by changing the expected SQLState.
Patch file: derby-2770-1a.diff

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java?view=diff&rev=544856&r1=544855&r2=544856
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BlobClob4BlobTest.java
Wed Jun  6 07:45:27 2007
@@ -2253,16 +2253,17 @@
 
 
         assertTrue("FAIL - shortBlob is NULL", shortBlob != null);
-        // this should give blob/clob unavailable exceptions on client
+        // This should give blob/clob unavailable exceptions with both
+        // client and embedded driver.
         try {
             shortBlob.length();
-            if (usingDerbyNetClient()) {
-                fail("FAIL - should not be able to access Blob after commit");
-            }
+            fail("FAIL - should not be able to access Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
-            assertTrue("FAIL - method should not fail when using embedded",
-                       usingDerbyNetClient());
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
 
         assertTrue("FAIL - blob is NULL", blob != null);
@@ -2271,31 +2272,51 @@
             blob.length();
             fail("FAIL - should not be able to access large Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
         try {
             blob.getBytes(2,3);
             fail("FAIL - should not be able to access large Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
         try {
             blob.getBinaryStream();
             fail("FAIL - should not be able to access large Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
         try {
             blob.position("foo".getBytes("US-ASCII"),2);
             fail("FAIL - should not be able to access large Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
         try {
             blob.position(blob,2);
             fail("FAIL - should not be able to access large Blob after commit");
         } catch (SQLException e) {
-            checkException(BLOB_ACCESSED_AFTER_COMMIT, e);
+            if (usingEmbedded()) {
+                checkException(INVALID_BLOB, e);
+            } else {
+                checkException(INVALID_LOCATOR, e);
+            }
         }
     }
 
@@ -3199,5 +3220,6 @@
     private static final String BLOB_ACCESSED_AFTER_COMMIT = "XJ073";
     private static final String NO_CURRENT_CONNECTION = "08003";
     private static final String INVALID_BLOB = "XJ215";
+    private static final String INVALID_LOCATOR = "XJ217";
 
 }



Mime
View raw message