@Test
  public void testIndexCreationFromXMLForLocalScope() throws Exception {
    InternalDistributedSystem.getAnyInstance().disconnect();
    File file = new File("persistData0");
    file.mkdir();

    Properties props = new Properties();
    props.setProperty(NAME, "test");
    props.setProperty(MCAST_PORT, "0");
    props.setProperty(CACHE_XML_FILE,
        getClass().getResource("index-creation-without-eviction.xml").toURI().getPath());
    DistributedSystem ds = DistributedSystem.connect(props);
    Cache cache = CacheFactory.create(ds);
    Region localRegion = cache.getRegion("localRegion");
    for (int i = 0; i < 100; i++) {
      Portfolio pf = new Portfolio(i);
      localRegion.put("" + i, pf);
    }
    QueryService qs = cache.getQueryService();
    Index ind = qs.getIndex(localRegion, "localIndex");
    assertNotNull("Index localIndex should have been created ", ind);
    // verify that a query on the creation time works as expected
    SelectResults results = (SelectResults) qs
        .newQuery("<trace>SELECT * FROM " + localRegion.getFullPath() + " Where ID > 0").execute();
    assertEquals("OQL index results did not match", 99, results.size());
    ds.disconnect();
    FileUtils.deleteDirectory(file);
  }
Test for bug 46872, make sure we recover the index correctly if the cache.xml changes for a
persistent region.
geode-core/src/integrationTest/java/org/apache/geode/cache/query/functional/IndexCreationJUnitTest.java