@Test
  public void testAllOpsObjectModWithFailover() throws Exception {
    OperationWithAction[] allOps = allOps();

    TestPostCredentialGenerator tgen = new TestPostCredentialGenerator();

    CredentialGenerator credentialGenerator = new DummyCredentialGenerator();
    credentialGenerator.init();
    Properties extraProps = credentialGenerator.getSystemProperties();
    Properties javaProps = credentialGenerator.getJavaProperties();
    String authInit = credentialGenerator.getAuthInit();
    String authenticator = credentialGenerator.getAuthenticator();

    System.out.println("testPutsGetsObjectModWithFailover: Using authinit: " + authInit);
    System.out.println("testPutsGetsObjectModWithFailover: Using authenticator: " + authenticator);
    System.out.println(
        "testPutsGetsObjectModWithFailover: Using pre-operation accessor: " + PRE_ACCESSOR_CREATE);
    System.out.println("testPutsGetsObjectModWithFailover: Using post-operation accessor: "
        + POST_ACCESSOR_CREATE);

    // Start servers with all required properties
    Properties serverProps =
        buildProperties(authenticator, extraProps, PRE_ACCESSOR_CREATE, POST_ACCESSOR_CREATE);

    // Get ports for the servers
    int[] portsList = AvailablePortHelper.getRandomAvailableTCPPorts(2);
    int port1 = 0; // portsList[0];
    int port2 = portsList[1];

    // Perform all the ops on the clients
    List<OperationWithAction> opBlock = new ArrayList();
    Random rnd = new Random();

    for (int opNum = 0; opNum < allOps.length; ++opNum) {
      // Start client with valid credentials as specified in OperationWithAction
      OperationWithAction currentOp = allOps[opNum];
      if (currentOp.equals(OperationWithAction.OPBLOCK_END)
          || currentOp.equals(OperationWithAction.OPBLOCK_NO_FAILOVER)) {
        // End of current operation block; execute all the operations on the servers with failover
        if (opBlock.size() > 0) {
          // Start the first server and execute the operation block
          port1 = server1.invoke("createCacheServer",
              () -> createCacheServer(serverProps, javaProps));
          server2.invoke("closeCache", () -> closeCache());
          executeOpBlock(opBlock, port1, port2, authInit, extraProps, null, tgen, rnd);
          if (!currentOp.equals(OperationWithAction.OPBLOCK_NO_FAILOVER)) {
            // Failover to the second server and run the block again
            port2 = server2.invoke("createCacheServer",
                () -> createCacheServer(serverProps, javaProps));
            server1.invoke("closeCache", () -> closeCache());
            executeOpBlock(opBlock, port1, port2, authInit, extraProps, null, tgen, rnd);
          }
          opBlock.clear();
        }

      } else {
        currentOp.setOpNum(opNum);
        opBlock.add(currentOp);
      }
    }
  }
Tests for authorization callback that modify objects and callbacks from client to server.

The scheme of these tests is thus: A user name terminating in integer 'i' can get values
terminating with 'i', '2*i', '3*i' and so on. So 'gemfire1' can get 'value1', 'value2', ...;
'gemfire2' can get 'value2', 'value4', ... and so on. On the server side this is done by adding
the index 'i' to the object in the pre-processing phase, and checked by comparing against the
user name index during the post-processing phase.

This enables testing of object and callback modification both in pre-processing and
post-processing phases.

@since GemFire 5.5
geode-cq/src/distributedTest/java/org/apache/geode/security/ClientAuthzObjectModDUnitTest.java