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

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

    final DistributedMember vm1Member = vm3.invoke(this::getMember);
    pause(10000);
    String command =
        CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm1Member.getId();
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter()
          .info("testStopGatewayReceiver_onMember stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());
      assertTrue(strCmdResult.contains("stopped on member"));
    } else {
      fail("testStopGatewayReceiver failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifyReceiverState(false));
    vm4.invoke(() -> verifyReceiverState(true));
    vm5.invoke(() -> verifyReceiverState(true));
  }
/**
   * test to validate that the start gateway sender starts the gateway sender on a member
   */
test to validate that the start gateway sender starts the gateway sender on a member
test to validate that the start gateway sender starts the gateway sender on a member
@Test
  public void testStopGatewayReceiver_onMember() {
    VM puneLocator = Host.getLocator();
    int dsIdPort = puneLocator.invoke(this::getLocatorPort);
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createAndStartReceiver(dsIdPort));
    vm4.invoke(() -> createAndStartReceiver(dsIdPort));
    vm5.invoke(() -> createAndStartReceiver(dsIdPort));
    vm3.invoke(() -> verifyReceiverState(true));
    vm4.invoke(() -> verifyReceiverState(true));
    vm5.invoke(() -> verifyReceiverState(true));
    final DistributedMember vm1Member = vm3.invoke(this::getMember);
    pause(10000);
    String command =
        CliStrings.STOP_GATEWAYRECEIVER + " --" + CliStrings.MEMBER + "=" + vm1Member.getId();
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter()
          .info("testStopGatewayReceiver_onMember stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());
      assertTrue(strCmdResult.contains("stopped on member"));
    } else {
      fail("testStopGatewayReceiver failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifyReceiverState(false));
    vm4.invoke(() -> verifyReceiverState(true));
    vm5.invoke(() -> verifyReceiverState(true));
  }
@ Test public void testStopGatewayReceiver_onMember ( ) { VM puneLocator = Host . getLocator ( ) ; int dsIdPort = puneLocator . invoke ( this :: getLocatorPort ) ; propsSetUp ( dsIdPort ) ; vm2 . invoke ( ( ) -> createFirstRemoteLocator ( 2 , dsIdPort ) ) ; vm3 . invoke ( ( ) -> createAndStartReceiver ( dsIdPort ) ) ; vm4 . invoke ( ( ) -> createAndStartReceiver ( dsIdPort ) ) ; vm5 . invoke ( ( ) -> createAndStartReceiver ( dsIdPort ) ) ; vm3 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; vm4 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; vm5 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; final DistributedMember vm1Member = vm3 . invoke ( this :: getMember ) ; pause ( 10000 ) ; String command = CliStrings . STOP_GATEWAYRECEIVER + " --" + CliStrings . MEMBER + "=" + vm1Member . getId ( ) ; CommandResult cmdResult = executeCommand ( command ) ; if ( cmdResult != null ) { String strCmdResult = commandResultToString ( cmdResult ) ; getLogWriter ( ) . info ( "testStopGatewayReceiver_onMember stringResult : " + strCmdResult + ">>>>" ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; assertTrue ( strCmdResult . contains ( "stopped on member" ) ) ; } else { fail ( "testStopGatewayReceiver failed as did not get CommandResult" ) ; } vm3 . invoke ( ( ) -> verifyReceiverState ( false ) ) ; vm4 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; vm5 . invoke ( ( ) -> verifyReceiverState ( true ) ) ; }
test to validate that the start gateway sender starts the gateway sender on a member
test to validate that the start gateway sender starts the gateway sender on a member