jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r783386 - /jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java
Date Wed, 10 Jun 2009 14:59:35 GMT
Author: thomasm
Date: Wed Jun 10 14:59:35 2009
New Revision: 783386

URL: http://svn.apache.org/viewvc?rev=783386&view=rev
Log:
JCR-2128 DerbyDataStore to handle proper close of the embedded database - fix test case

Modified:
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java?rev=783386&r1=783385&r2=783386&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/data/DBDataStoreTest.java
Wed Jun 10 14:59:35 2009
@@ -19,8 +19,6 @@
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.InputStream;
-import java.sql.DriverManager;
-import java.sql.SQLException;
 import java.util.Random;
 
 import junit.framework.TestCase;
@@ -56,13 +54,10 @@
     }
 
     protected void tearDown() {
-        store.close();
 
         try {
-            // TODO: This should automatically be done by DbDataStore.close()
-            DriverManager.getConnection(
-                    "jdbc:derby:target/test-db-datastore/db;shutdown=true");
-        } catch (SQLException expected) {
+            store.close();
+        } catch (DataStoreException expected) {
         }
     }
 
@@ -78,7 +73,7 @@
             try {
                 assertNotNull(stream);
                 for (int j = 0; j < data.length; j++) {
-                    assertEquals(((int) data[j]) & 0xff, stream.read());
+                    assertEquals((data[j]) & 0xff, stream.read());
                 }
                 assertEquals(-1, stream.read());
             } finally {
@@ -98,7 +93,7 @@
         // verify the contents of all the streams, reading them in parallel
         for (int i = 0; i < data.length; i++) {
             for (int j = 0; j < streams.length; j++) {
-                assertEquals(((int) data[i]) & 0xff, streams[j].read());
+                assertEquals((data[i]) & 0xff, streams[j].read());
             }
         }
 



Mime
View raw message