geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/StopGatewayReceiverCommandDUnitTest.java
@Test
  public void testStopGatewayReceiver_Group() {
    VM puneLocator = Host.getLocator();
    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
    propsSetUp(dsIdPort);

    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm4.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm5.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm3.invoke(() -> verifyReceiverState(true));
    vm4.invoke(() -> verifyReceiverState(true));
    vm5.invoke(() -> verifyReceiverState(true));

    pause(10000);
    String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info("testStopGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());

      TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
      List<String> status = resultData.retrieveAllValues("Result");
      assertEquals(3, status.size());
      assertFalse(status.contains("Error"));
      assertTrue(status.contains("OK"));
    } else {
      fail("testStopGatewayReceiver_Group failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifyReceiverState(false));
    vm4.invoke(() -> verifyReceiverState(false));
    vm5.invoke(() -> verifyReceiverState(false));
  }
/**
   * test to validate that the start gateway sender starts the gateway sender on a group of members
   */
test to validate that the start gateway sender starts the gateway sender on a group of members
test to validate that the start gateway sender starts the gateway sender on a group of members
@Test
  public void testStopGatewayReceiver_Group() {
    VM puneLocator = Host.getLocator();
    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm4.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm5.invoke(() -> createAndStartReceiverWithGroup(dsIdPort, "RG1"));
    vm3.invoke(() -> verifyReceiverState(true));
    vm4.invoke(() -> verifyReceiverState(true));
    vm5.invoke(() -> verifyReceiverState(true));
    pause(10000);
    String command = CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.GROUP + "=RG1";
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info("testStopGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());
      TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
      List<String> status = resultData.retrieveAllValues("Result");
      assertEquals(3, status.size());
      assertFalse(status.contains("Error"));
      assertTrue(status.contains("OK"));
    } else {
      fail("testStopGatewayReceiver_Group failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifyReceiverState(false));
    vm4.invoke(() -> verifyReceiverState(false));
    vm5.invoke(() -> verifyReceiverState(false));
  }
@ Test public void testStopGatewayReceiver_Group ( ) { VM puneLocator = Host . getLocator ( ) ; int dsIdPort = puneLocator . invoke ( this :: getLocatorPort ) ; propsSetUp ( dsIdPort ) ; vm2 . invoke ( ( ) -> createFirstRemoteLocator ( 2 , dsIdPort ) ) ; vm3 . invoke ( ( ) -> createAndStartReceiverWithGroup ( dsIdPort , "RG1" ) ) ; vm4 . invoke ( ( ) -> createAndStartReceiverWithGroup ( dsIdPort , "RG1" ) ) ; vm5 . invoke ( ( ) -> createAndStartReceiverWithGroup ( dsIdPort , "RG1" ) ) ; vm3 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; vm4 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; vm5 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; pause ( 10000 ) ; String command = CliStrings . STOP_GATEWAYRECEIVER + " --" + CliStrings . GROUP + "=RG1" ; CommandResult cmdResult = executeCommand ( command ) ; if ( cmdResult != null ) { String strCmdResult = commandResultToString ( cmdResult ) ; getLogWriter ( ) . info ( "testStopGatewayReceiver_Group stringResult : " + strCmdResult + ">>>>" ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; TabularResultData resultData = ( TabularResultData ) cmdResult . getResultData ( ) ; List < String > status = resultData . retrieveAllValues ( "Result" ) ; assertEquals ( 3 , status . size ( ) ) ; assertFalse ( status . contains ( "Error" ) ) ; assertTrue ( status . contains ( "OK" ) ) ; } else { fail ( "testStopGatewayReceiver_Group failed as did not get CommandResult" ) ; } vm3 . invoke ( ( ) -> verifyReceiverState ( false ) ) ; vm4 . invoke ( ( ) -> verifyReceiverState ( false ) ) ; vm5 . invoke ( ( ) -> verifyReceiverState ( false ) ) ; }
test to validate that the start gateway sender starts the gateway sender on a group of members
test to validate that the start gateway sender starts the gateway sender on a group of members