@Test
  public void testNonExistentFile() {
    // System.out.println("testNonExistentFile - start: " + System.currentTimeMillis());
    File nonExistent = new File(getName() + ".xml");
    nonExistent.delete();
    // System.out.println("testNonExistentFile - deleted: " + System.currentTimeMillis());
    setXmlFile(nonExistent);
    // System.out.println("testNonExistentFile - set: " + System.currentTimeMillis());

    IgnoredException expectedException = addIgnoredException(
        String.format("Declarative Cache XML file/resource %s does not exist.",
            nonExistent.getPath()));
    try {
      getCache();
      fail("Should have thrown a CacheXmlException");

    } catch (CacheXmlException ex) {
      // System.out.println("testNonExistentFile - caught: " + System.currentTimeMillis());
      // pass...
    } finally {
      expectedException.remove();
    }
  }
Tests creating a cache with a non-existent XML file
geode-core/src/distributedTest/java/org/apache/geode/cache30/CacheXml66DUnitTest.java