You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/05/05 17:43:08 UTC
[GitHub] [geode] DonalEvans commented on a change in pull request #5054: GEODE-8071: Use daemon threads in RebalanceCommand
DonalEvans commented on a change in pull request #5054:
URL: https://github.com/apache/geode/pull/5054#discussion_r420289186
##########
File path: geode-dunit/src/main/java/org/apache/geode/management/internal/cli/commands/RebalanceCommandDistributedTest.java
##########
@@ -35,40 +37,91 @@
import org.apache.geode.test.dunit.rules.MemberVM;
import org.apache.geode.test.junit.assertions.TabularResultModelAssert;
import org.apache.geode.test.junit.rules.GfshCommandRule;
+import org.apache.geode.test.junit.rules.MemberStarterRule;
+
+@RunWith(Parameterized.class)
+public class RebalanceCommandDistributedTest {
+ private static final String REGION_ONE_NAME = "region-1";
+ private static final String REGION_TWO_NAME = "region-2";
+ private static final String REGION_THREE_NAME = "region-3";
+
+ @Rule
+ public GfshCommandRule gfsh = new GfshCommandRule();
+
+ @Rule
+ public ClusterStartupRule cluster = new ClusterStartupRule();
-@SuppressWarnings("serial")
-public class RebalanceCommandDistributedTestBase {
+ protected MemberVM locator, server1, server2;
- @ClassRule
- public static ClusterStartupRule cluster = new ClusterStartupRule();
+ @Parameterized.Parameters(name = "ConnectionType:{0}")
+ public static GfshCommandRule.PortType[] connectionTypes() {
+ return new GfshCommandRule.PortType[] {http, jmxManager};
+ }
- @ClassRule
- public static GfshCommandRule gfsh = new GfshCommandRule();
+ @Parameterized.Parameter
+ public static GfshCommandRule.PortType portType;
- protected static MemberVM locator, server1, server2, server3;
+ private void setUpRegions() {
+ server1.invoke(() -> {
+ Cache cache = ClusterStartupRule.getCache();
+ assertThat(cache).isNotNull();
+ RegionFactory<String, String> dataRegionFactory =
+ cache.createRegionFactory(RegionShortcut.PARTITION);
+ Region<String, String> region = dataRegionFactory.create(REGION_ONE_NAME);
+ for (int i = 0; i < 10; i++) {
+ region.put("key" + (i + 200), "value" + (i + 200));
+ }
+ region = dataRegionFactory.create(REGION_TWO_NAME);
+ for (int i = 0; i < 100; i++) {
+ region.put("key" + (i + 200), "value" + (i + 200));
+ }
Review comment:
Could the ints added to the keys and values be cleared up a bit? There doesn't seem to be any reason to add 200 to them here, and if the number of entries is extracted to a constant, then it can be used in the invocation on server2 to prevent overwriting the existing data.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org