X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2FtestUtils%2FConfiguredTest.java;h=ead6ffd2c02a0fa1f563234d1fe42408ccb3842e;hp=711007a047eafe94703507f2ddac532650e8a8eb;hb=d6fca4581fb8a65e2f84f227cdf32b080a58ab10;hpb=402feee6f7743e0baf17c13f2dab8f25ece4f04b diff --git a/tests/club/wpia/gigi/testUtils/ConfiguredTest.java b/tests/club/wpia/gigi/testUtils/ConfiguredTest.java index 711007a0..ead6ffd2 100644 --- a/tests/club/wpia/gigi/testUtils/ConfiguredTest.java +++ b/tests/club/wpia/gigi/testUtils/ConfiguredTest.java @@ -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); @@ -120,6 +131,7 @@ public abstract class ConfiguredTest { mainProps.setProperty("name.www", testProps.getProperty("name.www")); mainProps.setProperty("name.static", testProps.getProperty("name.static")); mainProps.setProperty("name.api", testProps.getProperty("name.api")); + mainProps.setProperty("name.suffix", testProps.getProperty("name.suffix")); mainProps.setProperty("appName", "SomeCA"); mainProps.setProperty("appIdentifier", "someca"); @@ -237,7 +249,7 @@ public abstract class ConfiguredTest { public void verify(Domain d) { try { d.addPing(DomainPingType.EMAIL, "admin"); - TestMail testMail = getMailReceiver().receive(); + TestMail testMail = getMailReceiver().receive("admin@" + d.getSuffix()); testMail.verify(); assertTrue(d.isVerified()); } catch (GigiApiException e) {