geode-wan/src/test/java/org/apache/geode/internal/cache/wan/wancommand/CreateAndDestroyGatewaySenderCommandsDUnitTest.java
@Test
  public void testCreateDestroyGatewaySender_Group_Scenario2() {
    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
    propsSetUp(dsIdPort);

    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));

    int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
    String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
        + "=ln" + " --" + CliStrings.GROUP + "=SenderGroup1" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__PARALLEL + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__MANUALSTART + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__SOCKETBUFFERSIZE + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__SOCKETREADTIMEOUT + "=" + socketReadTimeout + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ENABLEBATCHCONFLATION + "=true" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__BATCHSIZE + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__BATCHTIMEINTERVAL + "=5000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ENABLEPERSISTENCE + "=true" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__DISKSYNCHRONOUS + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__MAXQUEUEMEMORY + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD + "=100" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=2" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
    CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info(
          "testCreateDestroyGatewaySender_Group_Scenario2 stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());
      TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
      List<String> status = resultData.retrieveAllValues("Status");
      assertEquals(2, status.size());
      for (String stat : status) {
        assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
      }
    } else {
      fail("testCreateDestroyGatewaySender_Group_Scenario2 failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    doDestroyAndVerifyGatewaySender("ln", "SenderGroup1", null,
        "testCreateDestroyGatewaySender_Group_Scenario2", Arrays.asList(vm3, vm4), 2, false);
  }
/**
   * GatewaySender with given attribute values on given group. Only 2 of 3 members are part of the
   * group.
   */
GatewaySender with given attribute values on given group. Only 2 of 3 members are part of the
group.
GatewaySender with given attribute values on given group . Only 2 of 3 members are part of the group .
@Test
  public void testCreateDestroyGatewaySender_Group_Scenario2() {
    Integer dsIdPort = vm1.invoke(() -> createFirstLocatorWithDSId(1));
    propsSetUp(dsIdPort);
    vm2.invoke(() -> createFirstRemoteLocator(2, dsIdPort));
    vm3.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm4.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup1"));
    vm5.invoke(() -> createCacheWithGroups(dsIdPort, "SenderGroup2"));
    int socketReadTimeout = GatewaySender.MINIMUM_SOCKET_READ_TIMEOUT + 1000;
    String command = CliStrings.CREATE_GATEWAYSENDER + " --" + CliStrings.CREATE_GATEWAYSENDER__ID
        + "=ln" + " --" + CliStrings.GROUP + "=SenderGroup1" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__PARALLEL + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__MANUALSTART + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__SOCKETBUFFERSIZE + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__SOCKETREADTIMEOUT + "=" + socketReadTimeout + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ENABLEBATCHCONFLATION + "=true" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__BATCHSIZE + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__BATCHTIMEINTERVAL + "=5000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ENABLEPERSISTENCE + "=true" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__DISKSYNCHRONOUS + "=false" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__MAXQUEUEMEMORY + "=1000" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ALERTTHRESHOLD + "=100" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=2" + " --"
        + CliStrings.CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD";
    CommandResult cmdResult = executeCommandWithIgnoredExceptions(command);
    if (cmdResult != null) {
      String strCmdResult = commandResultToString(cmdResult);
      getLogWriter().info(
          "testCreateDestroyGatewaySender_Group_Scenario2 stringResult : " + strCmdResult + ">>>>");
      assertEquals(Result.Status.OK, cmdResult.getStatus());
      TabularResultData resultData = (TabularResultData) cmdResult.getResultData();
      List<String> status = resultData.retrieveAllValues("Status");
      assertEquals(2, status.size());
      for (String stat : status) {
        assertTrue("GatewaySender creation failed with: " + stat, !stat.contains("ERROR:"));
      }
    } else {
      fail("testCreateDestroyGatewaySender_Group_Scenario2 failed as did not get CommandResult");
    }
    vm3.invoke(() -> verifySenderState("ln", true, false));
    vm4.invoke(() -> verifySenderState("ln", true, false));
    doDestroyAndVerifyGatewaySender("ln", "SenderGroup1", null,
        "testCreateDestroyGatewaySender_Group_Scenario2", Arrays.asList(vm3, vm4), 2, false);
  }
@ Test public void testCreateDestroyGatewaySender_Group_Scenario2 ( ) { Integer dsIdPort = vm1 . invoke ( ( ) -> createFirstLocatorWithDSId ( 1 ) ) ; propsSetUp ( dsIdPort ) ; vm2 . invoke ( ( ) -> createFirstRemoteLocator ( 2 , dsIdPort ) ) ; vm3 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup1" ) ) ; vm4 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup1" ) ) ; vm5 . invoke ( ( ) -> createCacheWithGroups ( dsIdPort , "SenderGroup2" ) ) ; int socketReadTimeout = GatewaySender . MINIMUM_SOCKET_READ_TIMEOUT + 1000 ; String command = CliStrings . CREATE_GATEWAYSENDER + " --" + CliStrings . CREATE_GATEWAYSENDER__ID + "=ln" + " --" + CliStrings . GROUP + "=SenderGroup1" + " --" + CliStrings . CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID + "=2" + " --" + CliStrings . CREATE_GATEWAYSENDER__PARALLEL + "=false" + " --" + CliStrings . CREATE_GATEWAYSENDER__MANUALSTART + "=false" + " --" + CliStrings . CREATE_GATEWAYSENDER__SOCKETBUFFERSIZE + "=1000" + " --" + CliStrings . CREATE_GATEWAYSENDER__SOCKETREADTIMEOUT + "=" + socketReadTimeout + " --" + CliStrings . CREATE_GATEWAYSENDER__ENABLEBATCHCONFLATION + "=true" + " --" + CliStrings . CREATE_GATEWAYSENDER__BATCHSIZE + "=1000" + " --" + CliStrings . CREATE_GATEWAYSENDER__BATCHTIMEINTERVAL + "=5000" + " --" + CliStrings . CREATE_GATEWAYSENDER__ENABLEPERSISTENCE + "=true" + " --" + CliStrings . CREATE_GATEWAYSENDER__DISKSYNCHRONOUS + "=false" + " --" + CliStrings . CREATE_GATEWAYSENDER__MAXQUEUEMEMORY + "=1000" + " --" + CliStrings . CREATE_GATEWAYSENDER__ALERTTHRESHOLD + "=100" + " --" + CliStrings . CREATE_GATEWAYSENDER__DISPATCHERTHREADS + "=2" + " --" + CliStrings . CREATE_GATEWAYSENDER__ORDERPOLICY + "=THREAD" ; CommandResult cmdResult = executeCommandWithIgnoredExceptions ( command ) ; if ( cmdResult != null ) { String strCmdResult = commandResultToString ( cmdResult ) ; getLogWriter ( ) . info ( "testCreateDestroyGatewaySender_Group_Scenario2 stringResult : " + strCmdResult + ">>>>" ) ; assertEquals ( Result . Status . OK , cmdResult . getStatus ( ) ) ; TabularResultData resultData = ( TabularResultData ) cmdResult . getResultData ( ) ; List < String > status = resultData . retrieveAllValues ( "Status" ) ; assertEquals ( 2 , status . size ( ) ) ; for ( String stat : status ) { assertTrue ( "GatewaySender creation failed with: " + stat , ! stat . contains ( "ERROR:" ) ) ; } } else { fail ( "testCreateDestroyGatewaySender_Group_Scenario2 failed as did not get CommandResult" ) ; } vm3 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; vm4 . invoke ( ( ) -> verifySenderState ( "ln" , true , false ) ) ; doDestroyAndVerifyGatewaySender ( "ln" , "SenderGroup1" , null , "testCreateDestroyGatewaySender_Group_Scenario2" , Arrays . asList ( vm3 , vm4 ) , 2 , false ) ; }
GatewaySender with given attribute values on given group.
GatewaySender with given attribute values on given group .