protected ClientCache createClientCache(final boolean durable) {
    String gemfireClientName =
        DurableClientCacheIntegrationTest.class.getSimpleName().concat("Client");

    ClientCacheFactory clientCacheFactory =
        new ClientCacheFactory()
            .addPoolServer(SERVER_HOST, SERVER_PORT)
            .setPoolSubscriptionEnabled(true)
            .set("name", gemfireClientName)
            .set("mcast-port", "0")
            .set("log-level", "config");

    if (durable) {
      clientCacheFactory.set("durable-client-id", gemfireClientName.concat("Id"));
      clientCacheFactory.set("durable-client-timeout", "300");
    }

    ClientCache clientCache = clientCacheFactory.create();

    assertThat(clientCache, is(notNullValue()));

    ClientRegionFactory<String, Integer> clientRegionFactory =
        clientCache.createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);

    clientRegionFactory.setKeyConstraint(String.class);
    clientRegionFactory.setValueConstraint(Integer.class);

    if (durable) {
      clientRegionFactory.addCacheListener(
          new CacheListenerAdapter<String, Integer>() {
            @Override
            public void afterCreate(final EntryEvent<String, Integer> event) {
              System.out.printf(
                  "Created new entry in Region (%1$s) with key (%2$s) and value (%3$s)%n",
                  event.getRegion().getFullPath(), event.getKey(), event.getNewValue());
              regionCacheListenerEventValues.add(event.getNewValue());
            }

            @Override
            public void afterRegionLive(final RegionEvent<String, Integer> event) {
              System.out.printf("Region (%1$s) is live!%n", event.getRegion().getName());
            }
          });
    }

    Region<String, Integer> example = clientRegionFactory.create("Example");

    assertRegion(example, "Example", DataPolicy.NORMAL);

    return clientCache;
  }
  public static void createCacheClientFromXml(
      URL url, String poolName, String durableClientId, int timeout, Boolean addControlListener) {
    ClientCacheFactory ccf = new ClientCacheFactory();
    try {
      File cacheXmlFile = new File(url.toURI().getPath());
      ccf.set("cache-xml-file", cacheXmlFile.toURI().getPath());

    } catch (URISyntaxException e) {
      throw new ExceptionInInitializerError(e);
    }
    ccf.set("mcast-port", "0");
    ccf.set(DistributionConfig.DURABLE_CLIENT_ID_NAME, durableClientId);
    ccf.set(DistributionConfig.DURABLE_CLIENT_TIMEOUT_NAME, String.valueOf(timeout));
    cache = (Cache) ccf.create();
    pool = (PoolImpl) PoolManager.find(poolName);
  }