public void createRegion(String path) {
    DistributedSystem ds = null;
    try {
      boolean exceptionOccurred = false;
      File dir = new File("testingDirectoryForXML");
      dir.mkdir();
      dir.deleteOnExit();
      Properties props = new Properties();
      props.setProperty(MCAST_PORT, "0");
      props.setProperty(CACHE_XML_FILE,
          createTempFileFromResource(getClass(), path).getAbsolutePath());
      ds = DistributedSystem.connect(props);
      try {

        CacheFactory.create(ds);
      } catch (IllegalArgumentException ex) {
        exceptionOccurred = true;
        System.out.println(
            "ExpectedStrings: Received expected IllegalArgumentException:" + ex.getMessage());
      } catch (CacheXmlException ex) {
        exceptionOccurred = true;
        System.out
            .println("ExpectedStrings: Received expected CacheXmlException:" + ex.getMessage());
      } catch (Exception e) {
        e.printStackTrace();
        fail("test failed due to " + e);
      }

      if (!exceptionOccurred) {
        fail(" exception did not occur although was expected");
      }
    } finally {
      if (ds != null && ds.isConnected()) {
        ds.disconnect();
        ds = null;
      }
    }
  }
This test tests Illegal arguements being passed to create disk regions. The creation of the DWA
object should throw a relevant exception if the arguements specified are incorrect.
geode-core/src/integrationTest/java/org/apache/geode/internal/cache/DiskRegionIllegalCacheXMLvaluesJUnitTest.java