[logback-dev] svn commit: r1943 - in logback/trunk: logback-access/src/test/java/ch/qos/logback/access/db logback-classic/src/test/java/ch/qos/logback/classic/db

noreply.ceki at qos.ch noreply.ceki at qos.ch
Tue Nov 4 20:09:40 CET 2008


Author: ceki
Date: Tue Nov  4 20:09:40 2008
New Revision: 1943

Modified:
   logback/trunk/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java

Log:
Since Orion (Ceki's computer) now defaults to JDK 1.6, and the MS SQL JDK Driver v4 does not 
run on older JDKs we make JDK 1.6 a requirement for running the DBAppenderIntegration tests. 

Modified: logback/trunk/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java
==============================================================================
--- logback/trunk/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java	(original)
+++ logback/trunk/logback-access/src/test/java/ch/qos/logback/access/db/DBAppenderIntegrationTest.java	Tue Nov  4 20:09:40 2008
@@ -21,6 +21,7 @@
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.joran.spi.JoranException;
 import ch.qos.logback.core.status.Status;
+import ch.qos.logback.core.testUtil.Env;
 import ch.qos.logback.core.util.StatusPrinter;
 
 public class DBAppenderIntegrationTest {
@@ -69,7 +70,10 @@
     
   }
   
-  static boolean isConformingHost() {
+  static boolean isConformingHostAndJDK16OrHigher() {
+    if(!Env.isJDK6OrHigher()) {
+      return false;
+    }
     for (String conformingHost : CONFORMING_HOST_LIST) {
       if (conformingHost.equalsIgnoreCase(LOCAL_HOST_NAME)) {
         return true;
@@ -81,7 +85,7 @@
   @Test
   public void sqlserver() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/sqlserver-with-driver.xml");
@@ -90,7 +94,7 @@
   @Test
   public void oracle10g() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/oracle10g-with-driver.xml");
@@ -100,7 +104,7 @@
   @Ignore
   public void oracle11g() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/oracle11g-with-driver.xml");
@@ -109,7 +113,7 @@
   @Test
   public void mysql() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/mysql-with-driver.xml");
@@ -118,7 +122,7 @@
   @Test
   public void postgres() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/postgresql-with-driver.xml");

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/db/DBAppenderIntegrationTest.java	Tue Nov  4 20:09:40 2008
@@ -18,6 +18,7 @@
 import ch.qos.logback.classic.joran.JoranConfigurator;
 import ch.qos.logback.core.joran.spi.JoranException;
 import ch.qos.logback.core.status.Status;
+import ch.qos.logback.core.testUtil.Env;
 import ch.qos.logback.core.util.StatusPrinter;
 
 public class DBAppenderIntegrationTest {
@@ -45,7 +46,7 @@
 
   @After
   public void tearDown() throws Exception {
-    lc.shutdownAndReset();
+    lc.reset();
   }
 
   public void doTest(String configFile) throws JoranException {
@@ -68,7 +69,10 @@
     
   }
   
-  static boolean isConformingHost() {
+  static boolean isConformingHostAndJDK16OrHigher() {
+    if(!Env.isJDK6OrHigher()) {
+      return false;
+    }
     for (String conformingHost : CONFORMING_HOST_LIST) {
       if (conformingHost.equalsIgnoreCase(LOCAL_HOST_NAME)) {
         return true;
@@ -80,7 +84,7 @@
   @Test
   public void sqlserver() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/sqlserver-with-driver.xml");
@@ -89,7 +93,7 @@
   @Test
   public void oracle10g() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/oracle10g-with-driver.xml");
@@ -99,7 +103,7 @@
   @Ignore
   public void oracle11g() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/oracle11g-with-driver.xml");
@@ -108,7 +112,7 @@
   @Test
   public void mysql() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/mysql-with-driver.xml");
@@ -117,7 +121,7 @@
   @Test
   public void postgres() throws Exception {
     // perform test only on conforming hosts
-    if (!isConformingHost()) {
+    if (!isConformingHostAndJDK16OrHigher()) {
       return;
     }
     doTest("src/test/input/integration/db/postgresql-with-driver.xml");


More information about the logback-dev mailing list