]> WPIA git - gigi.git/blobdiff - tests/club/wpia/gigi/testUtils/ConfiguredTest.java
upd: allow clean testcase setup and teardown
[gigi.git] / tests / club / wpia / gigi / testUtils / ConfiguredTest.java
index 711007a047eafe94703507f2ddac532650e8a8eb..483f25e1d80a99deb37029e538ce4840ae7f61fc 100644 (file)
@@ -78,6 +78,15 @@ public abstract class ConfiguredTest {
     public static Properties initEnvironment() throws IOException {
         TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
         if (envInited) {
+            try {
+                synchronized (ConfiguredTest.class) {
+                    if (l == null) {
+                        l = DatabaseConnection.newLink(false);
+                    }
+                }
+            } catch (InterruptedException e) {
+                throw new Error(e);
+            }
             return generateProps();
         }
         envInited = true;
@@ -94,7 +103,9 @@ public abstract class ConfiguredTest {
             DatabaseConnection.init(testProps);
             try {
                 synchronized (ConfiguredTest.class) {
-                    l = DatabaseConnection.newLink(false);
+                    if (l == null) {
+                        l = DatabaseConnection.newLink(false);
+                    }
                 }
             } catch (InterruptedException e) {
                 throw new Error(e);