marmotta-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sschaff...@apache.org
Subject git commit: towards better Sesame compliance (now repository init/shutdownt tests are working)
Date Wed, 04 Sep 2013 10:37:37 GMT
Updated Branches:
  refs/heads/develop 8a2fe2bec -> 35c45b5fa


towards better Sesame compliance (now repository init/shutdownt tests are working)


Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/35c45b5f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/35c45b5f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/35c45b5f

Branch: refs/heads/develop
Commit: 35c45b5fa9c8c41348c5367fbf57f5e94a4e0556
Parents: 8a2fe2b
Author: Sebastian Schaffert <sschaffert@apache.org>
Authored: Wed Sep 4 12:37:38 2013 +0200
Committer: Sebastian Schaffert <sschaffert@apache.org>
Committed: Wed Sep 4 12:37:38 2013 +0200

----------------------------------------------------------------------
 .../marmotta/kiwi/sail/KiWiValueFactory.java    |  9 +++++++++
 .../kiwi/test/junit/KiWiDatabaseRunner.java     |  4 ++--
 .../sesame/repository/KiWiRepositoryTest.java   | 20 ++++++++------------
 libraries/kiwi/pom.xml                          |  4 ----
 4 files changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/35c45b5f/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
index 17015c4..0f7e264 100644
--- a/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
+++ b/libraries/kiwi/kiwi-triplestore/src/main/java/org/apache/marmotta/kiwi/sail/KiWiValueFactory.java
@@ -815,9 +815,18 @@ public class KiWiValueFactory implements ValueFactory {
     }
 
     public void close() {
+
         for(KiWiConnection con : pooledConnections) {
             try {
                 if(!con.isClosed()) {
+                    if(batchCommit && nodeBatch.size() > 0) {
+                        try {
+                            flushBatch(con);
+                        } catch (SQLException e) {
+                            log.error("error while flushing node batch",e);
+                        }
+                    }
+
                     con.commit();
                     con.close();
                 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/35c45b5f/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
index e7f6571..443a8e4 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java
@@ -142,7 +142,7 @@ public class KiWiDatabaseRunner extends Suite {
     
     public static KiWiConfiguration createKiWiConfig(String database, KiWiDialect dialect)
{
         final KiWiConfiguration config;
-        if(System.getProperty(database.toLowerCase()+".url") != null) {
+        if(!(dialect instanceof H2Dialect) && System.getProperty(database.toLowerCase()+".url")
!= null) {
             config = new KiWiConfiguration(
                     database,
                     System.getProperty(database.toLowerCase()+".url"),
@@ -152,7 +152,7 @@ public class KiWiDatabaseRunner extends Suite {
         } else if (dialect instanceof H2Dialect) {
             config = new KiWiConfiguration(
                     "default-H2", 
-                    "jdbc:h2:mem:kiwitest;MVCC=true;DB_CLOSE_ON_EXIT=TRUE", 
+                    "jdbc:h2:mem:kiwitest;MVCC=true;DB_CLOSE_ON_EXIT=TRUE;DB_CLOSE_DELAY=-1",
                     "kiwi", "kiwi", 
                     dialect);
         } else {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/35c45b5f/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
----------------------------------------------------------------------
diff --git a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
index b466474..f9a776b 100644
--- a/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
+++ b/libraries/kiwi/kiwi-triplestore/src/test/java/org/apache/marmotta/kiwi/test/sesame/repository/KiWiRepositoryTest.java
@@ -42,6 +42,8 @@ public class KiWiRepositoryTest extends RepositoryTest {
 
     private final KiWiConfiguration config;
 
+    private KiWiStore store;
+
     public KiWiRepositoryTest(KiWiConfiguration config) {
         this.config = config;
     }
@@ -51,19 +53,13 @@ public class KiWiRepositoryTest extends RepositoryTest {
      */
     @Override
     protected Repository createRepository() throws Exception {
-        Sail store = new SailWrapper(new KiWiStore(config)) {
-            @Override
-            public void shutDown() throws SailException {
-                try {
-                    ((KiWiStore)getBaseSail()).getPersistence().dropDatabase();
-                } catch (SQLException e) {
-                    fail("SQL exception while deleting database");
-                }
-
-                super.shutDown();
-            }
-        };
+        store = new KiWiStore(config);
         return new SailRepository(store);
     }
 
+    @Override
+    public void tearDown() throws Exception {
+        store.getPersistence().dropDatabase();
+        super.tearDown();
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/35c45b5f/libraries/kiwi/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/kiwi/pom.xml b/libraries/kiwi/pom.xml
index ade2610..323b311 100644
--- a/libraries/kiwi/pom.xml
+++ b/libraries/kiwi/pom.xml
@@ -64,10 +64,6 @@
                     <version>2.13</version>
                     <configuration>
                         <systemPropertyVariables>
-                            <h2.url>jdbc:h2:mem:test;MVCC=true;DB_CLOSE_ON_EXIT=TRUE</h2.url>
-                            <h2.user>sa</h2.user>
-                            <h2.pass />
-
                             <!-- enable or pass on command line for testing local PostgreSQL
-->
                             <postgresql.url>jdbc:postgresql://localhost:5433/kiwitest?prepareThreshold=3</postgresql.url>
                             <postgresql.user>lmf</postgresql.user>


Mime
View raw message