Fixed Hazelcast itnegration tests, removing unusefull thread sleeps, but more important permitting the co existence of 2 Brokers in the same JVM

This commit is contained in:
andsel
2016-07-22 12:09:10 +02:00
parent 7886bf7103
commit fedd2965cc
8 changed files with 60 additions and 71 deletions
@@ -36,6 +36,11 @@ public class IntegrationUtils {
return currentDir + File.separator + DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME;
}
static String localClusterMapDBPath(int port) {
String currentDir = System.getProperty("user.dir");
return currentDir + File.separator + port + DEFAULT_MOQUETTE_STORE_MAP_DB_FILENAME;
}
public static Properties prepareTestProperties() {
Properties testProperties = new Properties();
testProperties.put(PERSISTENT_STORE_PROPERTY_NAME, IntegrationUtils.localMapDBPath());
@@ -43,6 +48,13 @@ public class IntegrationUtils {
return testProperties;
}
public static Properties prepareTestClusterProperties(int port) {
Properties testProperties = new Properties();
testProperties.put(PERSISTENT_STORE_PROPERTY_NAME, IntegrationUtils.localClusterMapDBPath(port));
testProperties.put(PORT_PROPERTY_NAME, Integer.toString(port));
return testProperties;
}
public static void cleanPersistenceFile(IConfig config) {
String fileName = config.getProperty(PERSISTENT_STORE_PROPERTY_NAME);
cleanPersistenceFile(fileName);