MARMOTTA-489, MARMOTTA-490: Improved Test-Logging for the KiWiDatabaseRunner


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

Branch: refs/heads/ldp
Commit: 9730c3c6abb90e9f9a8a6e6914236e3d7dfbd561
Parents: c766776
Author: Jakob Frank <[email protected]>
Authored: Tue Apr 15 10:29:14 2014 +0200
Committer: Jakob Frank <[email protected]>
Committed: Mon Jun 2 09:29:35 2014 +0200

----------------------------------------------------------------------
 .../apache/marmotta/kiwi/test/junit/KiWiDatabaseRunner.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/marmotta/blob/9730c3c6/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 25afcd9..0fd3998 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
@@ -271,14 +271,17 @@ public class KiWiDatabaseRunner extends Suite {
         private class CheckDBRule implements MethodRule {
 
             private final AssumptionViolatedException assume;
+            private final KiWiConfiguration dbConfig;
 
             public CheckDBRule(KiWiConfiguration dbConfig) {
+                this.dbConfig = dbConfig;
                 AssumptionViolatedException ex = null;
                 try {
                     DBConnectionChecker.checkDatabaseAvailability(dbConfig);
                 } catch (AssumptionViolatedException ave) {
                     ex = ave;
                 }
+                // Cache the result.
                 this.assume = ex;
             }
             
@@ -289,7 +292,11 @@ public class KiWiDatabaseRunner extends Suite {
                     @Override
                     public void evaluate() throws Throwable {
                         if (assume != null) {
-                            logger.info("{} skipped because database is not 
available", testName(method));
+                            if (logger.isDebugEnabled()) {
+                                logger.info("{} skipped because database {} 
({}) is not available", testName(method), dbConfig.getName(), 
dbConfig.getJdbcUrl());
+                            } else {
+                                logger.info("{} skipped because database {} is 
not available", testName(method), dbConfig.getName());
+                            }
                             throw assume;
                         }
                         base.evaluate();

Reply via email to