geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/ResumeGatewaySenderCommandDUnitTest.java
@Test
  public void testResumeGatewaySender_Group() {
    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));

    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));

    vm3.invoke(() -> startSender("ln"));
    vm4.invoke(() -> startSender("ln"));
    vm5.invoke(() -> startSender("ln"));

    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    vm5.invoke(() -> verifySenderState("ln", true, false));

    vm3.invoke(() -> pauseSender("ln"));
    vm4.invoke(() -> pauseSender("ln"));
    vm5.invoke(() -> pauseSender("ln"));

    vm3.invoke(() -> verifySenderState("ln", true, true));
    vm4.invoke(() -> verifySenderState("ln", true, true));
    vm5.invoke(() -> verifySenderState("ln", true, true));

    pause(10000);
    String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
        + "=ln --" + CliStrings.GROUP + "=SenderGroup1";
    CommandResult cmdResult = executeCommand(command);

    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info("testResumeGatewaySender 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("testResumeGatewaySender failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    vm5.invoke(() -> verifySenderState("ln", true, 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 testResumeGatewaySender_Group() {
    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm3.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm4.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm5.invoke(() -> createSender("ln", 2, false, 100, 400, false, false, null, true));
    vm3.invoke(() -> startSender("ln"));
    vm4.invoke(() -> startSender("ln"));
    vm5.invoke(() -> startSender("ln"));
    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    vm5.invoke(() -> verifySenderState("ln", true, false));
    vm3.invoke(() -> pauseSender("ln"));
    vm4.invoke(() -> pauseSender("ln"));
    vm5.invoke(() -> pauseSender("ln"));
    vm3.invoke(() -> verifySenderState("ln", true, true));
    vm4.invoke(() -> verifySenderState("ln", true, true));
    vm5.invoke(() -> verifySenderState("ln", true, true));
    pause(10000);
    String command = CliStrings.RESUME_GATEWAYSENDER + " --" + CliStrings.RESUME_GATEWAYSENDER__ID
        + "=ln --" + CliStrings.GROUP + "=SenderGroup1";
    CommandResult cmdResult = executeCommand(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info("testResumeGatewaySender 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("testResumeGatewaySender failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    vm5.invoke(() -> verifySenderState("ln", true, false));
  }
@ Test public void testResumeGatewaySender_Group ( ) { Integer dsIdPort = vm1 . invoke ( ( ) -> createFirstLocatorWithDSId ( 1 ) ) ; propsSetUp ( dsIdPort ) ; vm2 . invoke ( ( ) -> createFirstRemoteLocator ( 2 , dsIdPort ) ) ; vm3 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup1" ) ) ; vm3 . invoke ( ( ) -> createSender ( "ln" , 2 , false , 100 , 400 , false , false , null , true ) ) ; vm4 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup1" ) ) ; vm4 . invoke ( ( ) -> createSender ( "ln" , 2 , false , 100 , 400 , false , false , null , true ) ) ; vm5 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup1" ) ) ; vm5 . invoke ( ( ) -> createSender ( "ln" , 2 , false , 100 , 400 , false , false , null , true ) ) ; vm3 . invoke ( ( ) -> startSender ( "ln" ) ) ; vm4 . invoke ( ( ) -> startSender ( "ln" ) ) ; vm5 . invoke ( ( ) -> startSender ( "ln" ) ) ; vm3 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm4 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm5 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm3 . invoke ( ( ) -> pauseSender ( "ln" ) ) ; vm4 . invoke ( ( ) -> pauseSender ( "ln" ) ) ; vm5 . invoke ( ( ) -> pauseSender ( "ln" ) ) ; vm3 . invoke ( ( ) -> verifySenderState ( "ln" , true , true ) ) ; vm4 . invoke ( ( ) -> verifySenderState ( "ln" , true , true ) ) ; vm5 . invoke ( ( ) -> verifySenderState ( "ln" , true , true ) ) ; pause ( 10000 ) ; String command = CliStrings . RESUME_GATEWAYSENDER + " --" + CliStrings . RESUME_GATEWAYSENDER__ID + "=ln --" + CliStrings . GROUP + "=SenderGroup1" ; CommandResult cmdResult = executeCommand ( command ) ; if ( cmdResult != null ) { String strCmdResult = commandResultToString ( cmdResult ) ; getLogWriter ( ) . info ( "testResumeGatewaySender 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 ( "testResumeGatewaySender failed as did not get CommandResult" ) ; } vm3 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm4 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm5 . invoke ( ( ) -> verifySenderState ( "ln" , true , 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