@Test
  public void test006Pool() throws CacheException {
    final String name = getName();

    vm0.invoke("Create Cache Server", () -> {
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.DISTRIBUTED_ACK);
      factory.setConcurrencyChecksEnabled(false);
      factory.setCacheLoader(new CacheLoader<Object, Object>() {
        @Override
        public Object load(LoaderHelper helper) {
          return helper.getKey().toString();
        }

        @Override
        public void close() {

        }
      });
      createRegion(name, factory);
      startBridgeServer(0);
    });
    final int port = vm0.invoke(ConnectionPoolDUnitTest::getCacheServerPort);
    final String host0 = NetworkUtils.getServerHostName();
    vm1.invoke("Create region", () -> {
      getLonerSystem();
      getCache();
      validateDS();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);
      configureConnectionPool(factory, host0, new int[] {port}, true, -1, -1, null);
      createRegion(name, factory);
    });

    vm1.invoke("Get values", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      for (int i = 0; i < 10; i++) {
        Object value = region.get(i);
        assertThat(String.valueOf(i)).isEqualTo(value);
      }
    });

    vm1.invoke("Update values", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);

      for (int i = 0; i < 10; i++) {
        region.put(i, i);
      }
    });

    vm2.invoke("Create region", () -> {
      getLonerSystem();
      getCache();
      validateDS();
      RegionFactory<Object, Object> factory = getCache().createRegionFactory();
      factory.setScope(Scope.LOCAL);
      factory.setConcurrencyChecksEnabled(false);
      configureConnectionPool(factory, host0, new int[] {port}, true, -1, -1, null);
      createRegion(name, factory);
    });
    vm2.invoke("Validate values", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      for (int i = 0; i < 10; i++) {
        Object value = region.get(i);
        assertThat(value).isNotNull();
        assertThat(value).isInstanceOf(Integer.class);
        assertThat(i).isEqualTo(((Integer) value).intValue());
      }
    });

    vm1.invoke("Close Pool", () -> {
      Region<Object, Object> region = getRootRegion().getSubregion(name);
      String pName = region.getAttributes().getPoolName();
      PoolImpl p = (PoolImpl) PoolManager.find(pName);
      assertThat(p.isDestroyed()).isFalse();
      assertThat(1).isEqualTo(p.getAttachCount());
      try {
        p.destroy();
        fail("expected IllegalStateException");
      } catch (IllegalStateException ignored) {
      }
      region.localDestroyRegion();
      assertThat(p.isDestroyed()).isFalse();
      assertThat(p.getAttachCount()).isEqualTo(0);
    });
  }
Tests the basic operations of the {@link Pool}

@since GemFire 3.5
geode-core/src/distributedTest/java/org/apache/geode/cache/ConnectionPoolDUnitTest.java