This change allows executing of multiple ManagedTests in one JVM.
This is generally good to have clean code, but more practically it
enables re-running test cases multiple times. This is very useful for
debugging rarely occurring problems.
Change-Id: I0657c057f7504c51be32d2ed28bc8e33cd3a0b7c
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;
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);
String type = testProps.getProperty("type");
ter.destroy();
if (type.equals("local")) {
+ if (testProps.getProperty("withSigner", "false").equals("true")) {
+ try {
+ SimpleSigner.stopSigner();
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ inited = false;
return;
}
gigi.destroy();
} catch (InterruptedException e) {
e.printStackTrace();
}
+ inited = false;
}
public final String uniq = createUniqueName();