Github user kirklund commented on a diff in the pull request:

    https://github.com/apache/geode/pull/390#discussion_r102338898
  
    --- Diff: 
geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
 ---
    @@ -773,6 +755,73 @@ public void 
clientIsPreventedFromConnectingToLocatorAsServer() throws Exception
       }
     
     
    +  private void proxyRegionClientServerOp(RegionShortcut shortcut) throws 
Exception {
    +    // start server first
    +    final String REGION_NAME = "proxyRegionClientServerOp";
    +    PORT1 = initServerCache(false);
    +    // Create regions on servers.
    +    server1.invoke(new SerializableCallable() {
    +      @Override
    +      public Object call() throws Exception {
    +        Cache c = CacheFactory.getAnyInstance();
    +        assertNotNull(c);
    +        Region<Object, Object> r = 
c.createRegionFactory(shortcut).create(REGION_NAME);
    +        assertNotNull(r);
    +        return null;
    +      }
    +    });
    +
    +    String host = NetworkUtils.getServerHostName(server1.getHost());
    +
    +    Properties props = new Properties();
    +    props.setProperty(MCAST_PORT, "0");
    +    props.setProperty(LOCATORS, "");
    +    ClientCacheFactory ccf = new ClientCacheFactory(props);
    +    ccf.addPoolServer(host, PORT1);
    +
    +    ClientCache clientCache = ccf.create();
    +    Region<Object, Object> clientRegion =
    +        
clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY).create(REGION_NAME);
    +    assertNotNull(clientRegion);
    +
    +    // let us populate this region from client.
    +    for (int i = 0; i < 10; i++) {
    +      clientRegion.put(i, i * 10);
    +    }
    +    // Verify using gets
    +    for (int i = 0; i < 10; i++) {
    +      assertEquals(i * 10, clientRegion.get(i));
    +    }
    +    assertEquals(10, clientRegion.size());
    +    assertFalse(clientRegion.isEmpty());
    +    // delete all the entries from the server
    +    server1.invoke(new SerializableCallable() {
    +      @Override
    +      public Object call() throws Exception {
    +        Cache c = CacheFactory.getAnyInstance();
    --- End diff --
    
    I recommend naming variables with full words like "cache" and "region" -- 
we're trying to get away from the use of single-characters or abbreviations.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to