QueryTestUtils (Apache Geode 1.8.0)
Date: 2018-11-29

org.apache.geode.cache.query

## Class QueryTestUtils

- java.lang.Object
- - org.apache.geode.cache.query.QueryTestUtils

- All Implemented Interfaces:
    java.io.Serializable

      public class QueryTestUtils
      extends java.lang.Object
      implements java.io.Serializable

  Utility class for testing supported queries
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.util.HashMap<java.lang.String,java.lang.String>` | `bindQueries`
    `java.util.HashMap<java.lang.String,java.lang.String>` | `queries`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryTestUtils()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeCache()`
    `static void` | `closeCacheInVM(org.apache.geode.test.dunit.VM vm)`
    `void` | `closeServer(org.apache.geode.test.dunit.VM server)`
    `void` | `createCache(java.util.Properties prop)`
    `static void` | `createCacheInVM(org.apache.geode.test.dunit.VM vm, java.util.Properties props)`
    `Index` | `createHashIndex(java.lang.String name, java.lang.String field, java.lang.String region)`
    `void` | `createHashIndex(org.apache.geode.test.dunit.VM vm, java.lang.String name, java.lang.String field, java.lang.String region)`
    `Index` | `createIndex(java.lang.String name, java.lang.String field, java.lang.String region)`
    `void` | `createIndex(org.apache.geode.test.dunit.VM vm, java.lang.String name, java.lang.String field, java.lang.String region)`
    `void` | `createLocalRegion(java.lang.String name)`
    `void` | `createLocalRegion(java.lang.String name, org.apache.geode.test.dunit.VM vm)`
    `void` | `createPartitionRegion(java.lang.String name, java.lang.Class constraint)`
    `void` | `createPartitionRegion(java.lang.String name, java.lang.Class constraint, org.apache.geode.test.dunit.VM vm)`
    `void` | `createReplicateRegion(java.lang.String name)`
    `void` | `createReplicateRegion(java.lang.String name, org.apache.geode.test.dunit.VM vm)`
    `static java.io.File` | `createRootDiskStoreInVM(org.apache.geode.test.dunit.VM vm, java.lang.String rootDiskStoreName)`
    `void` | `createServer(org.apache.geode.test.dunit.VM server, java.util.Properties prop)`
    `void` | `createSubRegion(java.lang.String rootName, java.lang.String name, RegionAttributes regionAttributes, org.apache.geode.test.dunit.VM vm)`
    `static java.io.File` | `createTestRootDiskStore(java.lang.String testName)`
    `java.lang.Object[]` | `executeQueries(java.lang.String[] qarr)` Executes queries corresponding to the keys passed using array
    `java.lang.Object[]` | `executeQueriesWithDistinct(java.lang.String[] qarr)` Execute queries by adding a DISTINCT clause if not present
    `void` | `executeQueriesWithDistinct(org.apache.geode.test.dunit.VM vm, java.lang.String[] qarr)` Execute queries by adding a DISTINCT clause if not present
    `java.lang.Object[]` | `executeQueriesWithoutDistinct(java.lang.String[] qarr)` Execute queries by removing any DISTINCT clause if present
    `void` | `executeQueriesWithoutDistinct(org.apache.geode.test.dunit.VM vm, java.lang.String[] qarr)` Execute queries by removing any DISTINCT clause if present
    `Cache` | `getCache()`
    `static QueryTestUtils` | `getInstance()`
    `static QueryService` | `getQueryService()`
    `Region` | `getRegion(java.lang.String regionName)`
    `void` | `initializeBindQueryMap()`
    `void` | `initializeQueryMap()`
    `void` | `populateRegion(java.lang.String regionName, java.util.Map<?,?> entries)`
    `static void` | `populateRegion(org.apache.geode.test.dunit.VM vm, java.lang.String regionName, java.util.Map<?,?> entries)`
    `void` | `removeIndex(java.lang.String name, java.lang.String region)`
    `static void` | `setCache(Cache cache)`

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

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

- - ### Field Detail

    - #### queries

          public java.util.HashMap<java.lang.String,java.lang.String> queries

    - #### bindQueries

          public java.util.HashMap<java.lang.String,java.lang.String> bindQueries

  - ### Constructor Detail

    - #### QueryTestUtils

          public QueryTestUtils()

  - ### Method Detail

    - #### getInstance

          public static QueryTestUtils getInstance()

    - #### initializeBindQueryMap

          public void initializeBindQueryMap()

    - #### initializeQueryMap

          public void initializeQueryMap()

    - #### getQueryService

          public static QueryService getQueryService()

    - #### createServer

          public void createServer(org.apache.geode.test.dunit.VM server,
                                   java.util.Properties prop)

    - #### createCache

          public void createCache(java.util.Properties prop)

    - #### setCache

          public static void setCache(Cache cache)

    - #### createPartitionRegion

          public void createPartitionRegion(java.lang.String name,
                                            java.lang.Class constraint,
                                            org.apache.geode.test.dunit.VM vm)

    - #### createPartitionRegion

          public void createPartitionRegion(java.lang.String name,
                                            java.lang.Class constraint)

    - #### createReplicateRegion

          public void createReplicateRegion(java.lang.String name,
                                            org.apache.geode.test.dunit.VM vm)

    - #### createReplicateRegion

          public void createReplicateRegion(java.lang.String name)

    - #### createHashIndex

          public void createHashIndex(org.apache.geode.test.dunit.VM vm,
                                      java.lang.String name,
                                      java.lang.String field,
                                      java.lang.String region)

    - #### createHashIndex

          public Index createHashIndex(java.lang.String name,
                                       java.lang.String field,
                                       java.lang.String region)

    - #### createIndex

          public void createIndex(org.apache.geode.test.dunit.VM vm,
                                  java.lang.String name,
                                  java.lang.String field,
                                  java.lang.String region)
                           throws CacheException

      Throws:
        `CacheException`

    - #### createIndex

          public Index createIndex(java.lang.String name,
                                   java.lang.String field,
                                   java.lang.String region)
                            throws CacheException

      Throws:
        `CacheException`

    - #### removeIndex

          public void removeIndex(java.lang.String name,
                                  java.lang.String region)

    - #### createLocalRegion

          public void createLocalRegion(java.lang.String name,
                                        org.apache.geode.test.dunit.VM vm)

    - #### createLocalRegion

          public void createLocalRegion(java.lang.String name)

    - #### createSubRegion

          public void createSubRegion(java.lang.String rootName,
                                      java.lang.String name,
                                      RegionAttributes regionAttributes,
                                      org.apache.geode.test.dunit.VM vm)

    - #### closeServer

          public void closeServer(org.apache.geode.test.dunit.VM server)

    - #### closeCache

          public void closeCache()

    - #### executeQueries

          public java.lang.Object[] executeQueries(java.lang.String[] qarr)
                                            throws java.lang.Exception

      Executes queries corresponding to the keys passed using array

      `String[] arr = {"1", "2", "3"};
      new QueryTestUtils().executeQueries(arr);`

      Parameters:
        `qarr` - Array of keys, queries in the values mapped are executed
      Returns:
        Object array containing SelectResults
      Throws:
        `java.lang.Exception`

    - #### executeQueriesWithoutDistinct

          public void executeQueriesWithoutDistinct(org.apache.geode.test.dunit.VM vm,
                                                    java.lang.String[] qarr)

      Execute queries by removing any DISTINCT clause if present

    - #### executeQueriesWithoutDistinct

          public java.lang.Object[] executeQueriesWithoutDistinct(java.lang.String[] qarr)

      Execute queries by removing any DISTINCT clause if present

    - #### executeQueriesWithDistinct

          public void executeQueriesWithDistinct(org.apache.geode.test.dunit.VM vm,
                                                 java.lang.String[] qarr)

      Execute queries by adding a DISTINCT clause if not present

    - #### executeQueriesWithDistinct

          public java.lang.Object[] executeQueriesWithDistinct(java.lang.String[] qarr)

      Execute queries by adding a DISTINCT clause if not present

    - #### getCache

          public Cache getCache()

    - #### createCacheInVM

          public static void createCacheInVM(org.apache.geode.test.dunit.VM vm,
                                             java.util.Properties props)

    - #### closeCacheInVM

          public static void closeCacheInVM(org.apache.geode.test.dunit.VM vm)

    - #### getRegion

          public Region getRegion(java.lang.String regionName)

    - #### populateRegion

          public void populateRegion(java.lang.String regionName,
                                     java.util.Map<?,?> entries)

    - #### populateRegion

          public static void populateRegion(org.apache.geode.test.dunit.VM vm,
                                            java.lang.String regionName,
                                            java.util.Map<?,?> entries)

    - #### createTestRootDiskStore

          public static java.io.File createTestRootDiskStore(java.lang.String testName)
                                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### createRootDiskStoreInVM

          public static java.io.File createRootDiskStoreInVM(org.apache.geode.test.dunit.VM vm,
                                                             java.lang.String rootDiskStoreName)