@Test
  public void testLocalLoaderNetSearch() throws CacheException {
    assertEquals(Scope.LOCAL, getRegionAttributes().getScope());

    final String name = getUniqueName();
    final Object key = getUniqueName();

    TestCacheLoader loader = new TestCacheLoader() {
      @Override
      public Object load2(LoaderHelper helper) throws CacheLoaderException {

        try {
          helper.netSearch(true);

        } catch (TimeoutException ex) {
          Assert.fail("Why did I timeout?", ex);
        }

        return null;
      }
    };

    AttributesFactory factory = new AttributesFactory(getRegionAttributes());
    factory.setCacheLoader(loader);
    Region region = createRegion(name, factory.create());
    assertEquals(Scope.LOCAL, region.getAttributes().getScope());

    try {
      region.get(key);
      fail("Should have thrown a CacheLoaderException");

    } catch (CacheLoaderException ex) {
      String expected =
          org.apache.geode.internal.cache.LoaderHelperImpl.NET_SEARCH_LOCAL;
      String message = ex.getMessage();
      assertTrue("Unexpected message \"" + message + "\"", message.indexOf(expected) != -1);
    }
  }
Tests that if a <code>CacheLoader</code> for a local region invokes
{@link LoaderHelper#netSearch}, a {@link CacheLoaderException} is thrown.
geode-core/src/distributedTest/java/org/apache/geode/cache30/LocalRegionDUnitTest.java