You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ud...@apache.org on 2018/04/23 22:01:54 UTC
[geode] 01/01: GEODE-5129 Amend DistributedTestRule to honor the
vmCount parameter when < 4 hosts
This is an automated email from the ASF dual-hosted git repository.
udo pushed a commit to branch feature/GEODE-5129
in repository https://gitbox.apache.org/repos/asf/geode.git
commit 25833bb6e2fa8a6e1c59086290e219f0de10cb87
Author: Udo Kohlmeyer <uk...@pivotal.io>
AuthorDate: Mon Apr 23 15:01:37 2018 -0700
GEODE-5129 Amend DistributedTestRule to honor the vmCount parameter when < 4 hosts
---
.../org/apache/geode/test/dunit/rules/DistributedTestRule.java | 1 +
.../org/apache/geode/test/dunit/standalone/DUnitLauncher.java | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
index 1b7394e..d7b02b0 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/rules/DistributedTestRule.java
@@ -111,6 +111,7 @@ public class DistributedTestRule extends AbstractDistributedTestRule {
}
DistributedTestRule(final Builder builder) {
+ super(builder.vmCount);
vmCount = builder.vmCount;
}
diff --git a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
index fa723d5..a61b609 100644
--- a/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
+++ b/geode-core/src/test/java/org/apache/geode/test/dunit/standalone/DUnitLauncher.java
@@ -98,7 +98,7 @@ public class DUnitLauncher {
/**
* Number of VMs to use during initialization.
*/
- public static final int NUM_VMS = 4;
+ public static int NUM_VMS = 4;
/**
* VM ID for the VM to use for the debugger.
@@ -167,6 +167,14 @@ public class DUnitLauncher {
}
/**
+ * Launch DUnit. If the unit test was launched through the hydra framework, leave the test alone.
+ */
+ public static void launchIfNeeded(int vmCount) {
+ NUM_VMS = vmCount;
+ launchIfNeeded();
+ }
+
+ /**
* Test it see if the eclise dunit environment is launched.
*/
public static boolean isLaunched() {
--
To stop receiving notification emails like this one, please contact
udo@apache.org.