@Test
  public void testXmlFileIsDirectory() {
    File dir = new File(getName() + "dir");
    dir.mkdirs();
    dir.deleteOnExit();
    setXmlFile(dir);

    IgnoredException expectedException = addIgnoredException(
        String.format("Declarative XML file %s is not a file.", dir));
    try {
      getCache();
      fail("Should have thrown a CacheXmlException");

    } catch (CacheXmlException ex) {
      // pass...
    } finally {
      expectedException.remove();
    }
  }
Tests creating a cache with a XML file that is a directory
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java