org.apache.geode.cache30

## Class CacheXmlTestCase

- java.lang.Object
- - org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase
  - - org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase
    - - org.apache.geode.cache30.CacheXmlTestCase

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

      public class CacheXmlTestCase
      extends org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties` | `restoreSystemProperties`
    `org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder` | `temporaryFolder`
    `org.apache.geode.test.junit.rules.serializable.SerializableTestName` | `testName`

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

      `cache`

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

      `system, testNameForDistributedTestCase`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CacheXmlTestCase()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.io.File` | `copyResourceToDirectory(java.io.File directory, java.lang.String fileName)`
    `protected java.io.File` | `findFile(java.lang.String fileName)` Finds an XML file with the given name.
    `java.util.Properties` | `getDistributedSystemProperties()`
    `protected java.lang.String` | `getGemFireVersion()` The version of GemFire tested by this class.
    `protected boolean` | `getUseSchema()`
    `void` | `postSetUp()`
    `void` | `postTearDownCacheTestCase()`
    `void` | `preTearDownCacheTestCase()`
    `protected void` | `setXmlFile(java.io.File xmlFile)` Sets the file used by this test to initialize the cache
    `protected void` | `testXml(org.apache.geode.internal.cache.xmlcache.CacheCreation creation)` Uses the `CacheXmlGenerator` to generate an XML file from the given `CacheCreation`.
    `protected void` | `testXml(org.apache.geode.internal.cache.xmlcache.CacheCreation creation, boolean checkSame)`

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

      `addExceptionTag1, basicGetCache, beginCacheXml, closeAllCache, closeCache, createExpiryRootRegion, createLonerCache, createRegion, createRegion, createRootRegion, createRootRegion, finishCacheXml, finishCacheXml, getCache, getCache, getCache, getCache, getCache, getClientCache, getClientCache, getDiskDir, getDiskDirs, getGemfireCache, getRootRegion, getRootRegion, hasCache, preTearDown, removeExceptionTag1`

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

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

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

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

    - ### Methods inherited from interface org.apache.geode.test.dunit.internal.DistributedTestFixture

      `getName, postTearDown, postTearDownAssertions, preSetUp, preTearDownAssertions`

- - ### Field Detail

    - #### restoreSystemProperties

          public org.apache.geode.test.dunit.rules.DistributedRestoreSystemProperties restoreSystemProperties

    - #### temporaryFolder

          public org.apache.geode.test.junit.rules.serializable.SerializableTemporaryFolder temporaryFolder

    - #### testName

          public org.apache.geode.test.junit.rules.serializable.SerializableTestName testName

  - ### Constructor Detail

    - #### CacheXmlTestCase

          public CacheXmlTestCase()

  - ### Method Detail

    - #### 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`

    - #### preTearDownCacheTestCase

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

      Specified by:
        `preTearDownCacheTestCase` in interface `org.apache.geode.test.dunit.cache.internal.CacheTestFixture`
      Overrides:
        `preTearDownCacheTestCase` in class `org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase`
      Throws:
        `java.lang.Exception`

    - #### postTearDownCacheTestCase

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

      Specified by:
        `postTearDownCacheTestCase` in interface `org.apache.geode.test.dunit.cache.internal.CacheTestFixture`
      Overrides:
        `postTearDownCacheTestCase` in class `org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase`
      Throws:
        `java.lang.Exception`

    - #### getGemFireVersion

          protected java.lang.String getGemFireVersion()

      The version of GemFire tested by this class. This method should be overridden by subclasses.
      See Also:
        `CacheXml.VERSION_3_0`

    - #### getUseSchema

          protected boolean getUseSchema()

    - #### setXmlFile

          protected void setXmlFile(java.io.File xmlFile)

      Sets the file used by this test to initialize the cache

    - #### findFile

          protected java.io.File findFile(java.lang.String fileName)
                                   throws java.io.IOException

      Finds an XML file with the given name. Looks in $JTESTS.
      Throws:
        `java.io.IOException`

    - #### copyResourceToDirectory

          protected java.io.File copyResourceToDirectory(java.io.File directory,
                                                         java.lang.String fileName)
                                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getDistributedSystemProperties

          public java.util.Properties getDistributedSystemProperties()

      Specified by:
        `getDistributedSystemProperties` in interface `org.apache.geode.test.dunit.internal.DistributedTestFixture`
      Overrides:
        `getDistributedSystemProperties` in class `org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase`

    - #### testXml

          protected void testXml(org.apache.geode.internal.cache.xmlcache.CacheCreation creation)
                          throws java.io.IOException

      Uses the `CacheXmlGenerator` to generate an XML file from the given `CacheCreation`. It then creates a `Cache` from the XML and asserts that it is the same as the cache described in the `CacheCreation`.
      Throws:
        `java.io.IOException`

    - #### testXml

          protected void testXml(org.apache.geode.internal.cache.xmlcache.CacheCreation creation,
                                 boolean checkSame)
                          throws java.io.IOException

      Throws:
        `java.io.IOException`