Github user jinmeiliao commented on a diff in the pull request:

    https://github.com/apache/geode/pull/327#discussion_r95420944
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAlterDestroyRegionCommandsDUnitTest.java
 ---
    @@ -833,6 +833,120 @@ private void regionAlterManipulatePlugInsTest() {
         });
       }
     
    +  @Test
    +  public void testAlterRegionResetCacheListeners() throws IOException {
    +    setUpJmxManagerOnVm0ThenConnect(null);
    +
    +    CommandResult cmdResult = executeCommand(CliStrings.LIST_REGION);
    +    assertEquals(Result.Status.OK, cmdResult.getStatus());
    +    assertTrue(commandResultToString(cmdResult).contains("No Regions 
Found"));
    +
    +    Host.getHost(0).getVM(0).invoke(() -> {
    +      Cache cache = getCache();
    +      
cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true)
    +          .create(alterRegionName);
    +    });
    +
    +    this.alterVm1 = Host.getHost(0).getVM(1);
    +    this.alterVm1Name = "VM" + this.alterVm1.getPid();
    +    this.alterVm1.invoke(() -> {
    +      Properties localProps = new Properties();
    +      localProps.setProperty(NAME, alterVm1Name);
    +      localProps.setProperty(GROUPS, "Group1");
    +      getSystem(localProps);
    +      Cache cache = getCache();
    +
    +      // Setup queues and gateway senders to be used by all tests
    +      
cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true)
    +          .create(alterRegionName);
    +      AsyncEventListener listener = new AsyncEventListener() {
    +        @Override
    +        public void close() {
    +          // Nothing to do
    +        }
    +
    +        @Override
    +        public boolean processEvents(List<AsyncEvent> events) {
    +          return true;
    +        }
    +      };
    +    });
    +
    +    this.alterVm2 = Host.getHost(0).getVM(2);
    +    this.alterVm2Name = "VM" + this.alterVm2.getPid();
    +    this.alterVm2.invoke(() -> {
    +      Properties localProps = new Properties();
    +      localProps.setProperty(NAME, alterVm2Name);
    +      localProps.setProperty(GROUPS, "Group1,Group2");
    +      getSystem(localProps);
    +      Cache cache = getCache();
    +
    +      
cache.createRegionFactory(RegionShortcut.PARTITION).setStatisticsEnabled(true)
    +          .create(alterRegionName);
    +    });
    +
    +    deployJarFilesForRegionAlter();
    +    regionAlterResetCacheListenersTest();
    --- End diff --
    
    since this method is only called by this test, move the body of the 
function to this test and delete the private function.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to