org.apache.geode.security

## Class ClientAuthorizationTestCase

- java.lang.Object
- - org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase
  - - org.apache.geode.security.ClientAuthorizationTestCase

- All Implemented Interfaces:
    java.io.Serializable, org.apache.geode.test.dunit.internal.DistributedTestFixture

      public abstract class ClientAuthorizationTestCase
      extends org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase

  Base class for tests for authorization from client to server. It contains utility functions for the authorization tests from client to server.
  Since:
    GemFire 5.5
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ClientAuthorizationTestCase.OperationWithAction` This class encapsulates an `OperationContext.OperationCode` with associated flags, the client to perform the operation, and the number of operations to perform.
    `protected static class` | `ClientAuthorizationTestCase.OpFlags` This class specifies flags that can be used to alter the behaviour of operations being performed by the `doOp` function.
    `protected static class` | `ClientAuthorizationTestCase.TestAuthzCredentialGenerator` Contains a `AuthzCredentialGenerator` and implements the `ClientAuthorizationTestCase.TestCredentialGenerator` interface.
    `protected static interface` | `ClientAuthorizationTestCase.TestCredentialGenerator` Simple interface to generate credentials with authorization based on key indices also.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.apache.geode.test.dunit.VM` | `client1`
    `protected static org.apache.geode.test.dunit.VM` | `client2`
    `java.lang.String` | `clientVersion`
    `protected static java.lang.String` | `regionName`
    `protected static org.apache.geode.test.dunit.VM` | `server1`
    `protected static org.apache.geode.test.dunit.VM` | `server2`
    `protected static java.lang.String` | `SUBREGION_NAME`

    - ### Fields inherited from class org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase

      `system, testNameForDistributedTestCase`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientAuthorizationTestCase()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static java.util.Properties` | `buildProperties(java.lang.String authenticator, java.lang.String accessor, boolean isAccessorPP, java.util.Properties extraAuthProps, java.util.Properties extraAuthzProps)`
    `protected java.lang.String[]` | `clientIgnoredExceptions()`
    `protected static int` | `createCacheServer(int serverPort, java.util.Properties authProps, java.util.Properties javaProps)`
    `protected static java.lang.Integer` | `createCacheServer(java.util.Properties authProps, java.util.Properties javaProps)`
    `protected static void` | `doOp(OperationContext.OperationCode op, int[] indices, int flagsI, int expectedResult)`
    `protected void` | `executeOpBlock(java.util.List<ClientAuthorizationTestCase.OperationWithAction> opBlock, int port1, int port2, java.lang.String authInit, java.util.Properties extraAuthProps, java.util.Properties extraAuthzProps, ClientAuthorizationTestCase.TestCredentialGenerator credentialGenerator, java.util.Random random)`
    `protected java.util.List<AuthzCredentialGenerator>` | `getDummyGeneratorCombos()`
    `protected static Region` | `getRegion()`
    `protected static Region` | `getSubregion()`
    `protected AuthzCredentialGenerator` | `getXmlAuthzGenerator()`
    `protected static java.lang.String` | `indicesToString(int[] indices)`
    `void` | `postSetUp()`
    `protected void` | `postSetUpClientAuthorizationTestBase()`
    `void` | `postTearDown()`
    `protected void` | `postTearDownClientAuthorizationTestBase()`
    `void` | `preSetUp()`
    `protected void` | `preSetUpClientAuthorizationTestBase()`
    `void` | `preTearDown()`
    `protected void` | `preTearDownClientAuthorizationTestBase()`
    `protected void` | `runOpsWithFailOver(ClientAuthorizationTestCase.OperationWithAction[] opCodes, java.lang.String testName)`
    `protected java.lang.String[]` | `serverIgnoredExceptions()`

    - ### Methods inherited from class org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase

      `basicGetSystem, cleanDiskDirs, cleanupAllVms, deleteBACKUPDiskStoreFile, destroyRegions, disconnectAllFromDS, disconnectFromDS, getBlackboard, getDistributedSystemProperties, getLonerSystem, getName, getSystem, getSystem, getSystemStatic, getTestClass, getTestMethodName, getUniqueName, initializeBlackboard, initializeDistributedTestCase, isConnectedToDS, nullSystem, postTearDownAssertions, preTearDownAssertions, setSystem, setUpDistributedTestCase, tearDownDistributedTestCase`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### server1

          protected static org.apache.geode.test.dunit.VM server1

    - #### server2

          protected static org.apache.geode.test.dunit.VM server2

    - #### client1

          protected static org.apache.geode.test.dunit.VM client1

    - #### client2

          protected static org.apache.geode.test.dunit.VM client2

    - #### clientVersion

          public java.lang.String clientVersion

    - #### regionName

          protected static final java.lang.String regionName

      See Also:
        Constant Field Values

    - #### SUBREGION_NAME

          protected static final java.lang.String SUBREGION_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClientAuthorizationTestCase

          public ClientAuthorizationTestCase()

  - ### Method Detail

    - #### preSetUp

          public final void preSetUp()
                              throws java.lang.Exception

      Specified by:
        `preSetUp` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `preSetUp` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`
      Throws:
        `java.lang.Exception`

    - #### postSetUp

          public final void postSetUp()
                               throws java.lang.Exception

      Specified by:
        `postSetUp` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `postSetUp` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`
      Throws:
        `java.lang.Exception`

    - #### serverIgnoredExceptions

          protected java.lang.String[] serverIgnoredExceptions()

    - #### clientIgnoredExceptions

          protected java.lang.String[] clientIgnoredExceptions()

    - #### preSetUpClientAuthorizationTestBase

          protected void preSetUpClientAuthorizationTestBase()
                                                      throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### postSetUpClientAuthorizationTestBase

          protected void postSetUpClientAuthorizationTestBase()
                                                       throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### preTearDown

          public final void preTearDown()
                                 throws java.lang.Exception

      Specified by:
        `preTearDown` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `preTearDown` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`
      Throws:
        `java.lang.Exception`

    - #### postTearDown

          public final void postTearDown()
                                  throws java.lang.Exception

      Specified by:
        `postTearDown` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `postTearDown` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`
      Throws:
        `java.lang.Exception`

    - #### preTearDownClientAuthorizationTestBase

          protected void preTearDownClientAuthorizationTestBase()
                                                         throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### postTearDownClientAuthorizationTestBase

          protected void postTearDownClientAuthorizationTestBase()
                                                          throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### buildProperties

          protected static java.util.Properties buildProperties(java.lang.String authenticator,
                                                                java.lang.String accessor,
                                                                boolean isAccessorPP,
                                                                java.util.Properties extraAuthProps,
                                                                java.util.Properties extraAuthzProps)

    - #### createCacheServer

          protected static java.lang.Integer createCacheServer(java.util.Properties authProps,
                                                               java.util.Properties javaProps)

    - #### createCacheServer

          protected static int createCacheServer(int serverPort,
                                                 java.util.Properties authProps,
                                                 java.util.Properties javaProps)

    - #### getRegion

          protected static Region getRegion()

    - #### getSubregion

          protected static Region getSubregion()

    - #### indicesToString

          protected static java.lang.String indicesToString(int[] indices)

    - #### doOp

          protected static void doOp(OperationContext.OperationCode op,
                                     int[] indices,
                                     int flagsI,
                                     int expectedResult)
                              throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`

    - #### executeOpBlock

          protected void executeOpBlock(java.util.List<ClientAuthorizationTestCase.OperationWithAction> opBlock,
                                        int port1,
                                        int port2,
                                        java.lang.String authInit,
                                        java.util.Properties extraAuthProps,
                                        java.util.Properties extraAuthzProps,
                                        ClientAuthorizationTestCase.TestCredentialGenerator credentialGenerator,
                                        java.util.Random random)
                                 throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`

    - #### getXmlAuthzGenerator

          protected AuthzCredentialGenerator getXmlAuthzGenerator()

    - #### getDummyGeneratorCombos

          protected java.util.List<AuthzCredentialGenerator> getDummyGeneratorCombos()

    - #### runOpsWithFailOver

          protected void runOpsWithFailOver(ClientAuthorizationTestCase.OperationWithAction[] opCodes,
                                            java.lang.String testName)
                                     throws java.lang.InterruptedException

      Throws:
        `java.lang.InterruptedException`