geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark...@apache.org
Subject incubator-geode git commit: GEODE-33 - Minor fixes after review comments.
Date Fri, 08 Jul 2016 00:18:57 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-33 18ca99583 -> 13d8dde6d


GEODE-33 - Minor fixes after review comments.


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/13d8dde6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/13d8dde6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/13d8dde6

Branch: refs/heads/feature/GEODE-33
Commit: 13d8dde6d11ff9381543b895693743878516c5ae
Parents: 18ca995
Author: William Markito <wmarkito@pivotal.io>
Authored: Thu Jul 7 17:19:24 2016 -0700
Committer: William Markito <wmarkito@pivotal.io>
Committed: Thu Jul 7 17:19:24 2016 -0700

----------------------------------------------------------------------
 geode-examples/README.md                        |  4 ++-
 .../geode/examples/replicated/BaseClient.java   |  8 +++---
 .../geode/examples/replicated/Consumer.java     |  8 ++----
 .../geode/examples/replicated/ConsumerTest.java | 27 ++++++++++++--------
 .../geode/examples/replicated/ProducerTest.java | 19 ++++++--------
 .../examples/replicated/ReplicatedTest.java     |  2 +-
 6 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/README.md
----------------------------------------------------------------------
diff --git a/geode-examples/README.md b/geode-examples/README.md
index fccffc9..1d4eafb 100644
--- a/geode-examples/README.md
+++ b/geode-examples/README.md
@@ -30,6 +30,8 @@ All examples:
 ### Intermediate
 
 *  PDX & Serialization
+*  Lucene Indexing
+*  OQL Indexing
 *  Functions
 *  CacheLoader & CacheWriter
 *  Listeners
@@ -53,7 +55,7 @@ All examples:
 *  Resource manager
 *  PDX Advanced
 
-### Use cases & integrations
+### Use cases, integrations and external examples
 
 This section has self-contained little projects that illustrate a use case or an integration
with other projects.
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/BaseClient.java
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/BaseClient.java
b/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/BaseClient.java
index 45349ac..9a86224 100644
--- a/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/BaseClient.java
+++ b/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/BaseClient.java
@@ -16,13 +16,13 @@
  */
 package org.apache.geode.examples.replicated;
 
+import java.util.logging.Logger;
+
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.ClientCache;
 import com.gemstone.gemfire.cache.client.ClientCacheFactory;
 import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 
-import java.util.logging.Logger;
-
 
 public abstract class BaseClient {
 
@@ -34,8 +34,8 @@ public abstract class BaseClient {
   }
 
   private Region region;
-  private final String locatorHost = System.getProperty("locatorHost", "localhost");
-  private final int locatorPort = Integer.getInteger("locatorPort", 10334);
+  private final String locatorHost = System.getProperty("GEODE_LOCATOR_HOST", "localhost");
+  private final int locatorPort = Integer.getInteger("GEODE_LOCATOR_PORT", 10334);
   protected static final String REGION_NAME = "myRegion";
   static final int NUM_ENTRIES = 50;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/Consumer.java
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/Consumer.java
b/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/Consumer.java
index 7fa32b1..d4eca43 100644
--- a/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/Consumer.java
+++ b/geode-examples/replicated/src/main/java/org/apache/geode/examples/replicated/Consumer.java
@@ -18,14 +18,10 @@ package org.apache.geode.examples.replicated;
 
 import com.gemstone.gemfire.cache.client.ClientCache;
 
-/**
- * @author wmarkito
- * @date 5/31/16.
- */
 public class Consumer extends BaseClient {
 
   public static void main(String[] args) {
-    new Consumer().countEntries();
+    new Consumer().countEntriesOnServer();
   }
 
   public Consumer() {
@@ -35,7 +31,7 @@ public class Consumer extends BaseClient {
     this.clientCache = clientCache;
   }
 
-  public int countEntries() {
+  public int countEntriesOnServer() {
     int size = getRegion().keySetOnServer().size();
     logger.info(String.format("Done. %d entries available on the server(s).", size));
     return size;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ConsumerTest.java
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ConsumerTest.java
b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ConsumerTest.java
index 3231092..b9b4d30 100644
--- a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ConsumerTest.java
+++ b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ConsumerTest.java
@@ -17,19 +17,19 @@
 
 package org.apache.geode.examples.replicated;
 
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.NoAvailableLocatorsException;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import java.util.Set;
 
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import java.util.Set;
-
-import static org.mockito.Mockito.*;
-import static org.junit.Assert.*;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.NoAvailableLocatorsException;
 
 public class ConsumerTest {
 
@@ -52,15 +52,20 @@ public class ConsumerTest {
   }
 
   @Test
-  public void countEntriesOnARegion() throws Exception {
-    assertEquals(consumer.NUM_ENTRIES, consumer.countEntries());
+  public void numberOfEntriesOnServerShouldMatchConsumerEntries() throws Exception {
+    assertEquals(consumer.NUM_ENTRIES, consumer.countEntriesOnServer());
+  }
+
+  @Test
+  public void numberOfEntriesShouldBeGreaterThanZero() throws Exception {
+    assertTrue(consumer.NUM_ENTRIES > 0);
   }
 
   @Test
-  public void countEntriesOnARegionWithNoConnection() throws Exception {
+  public void countingEntriesWithoutConnectionShouldThrowNoAvailableLocatorsException() throws
Exception {
     consumer = new Consumer();
     expectedException.expect(NoAvailableLocatorsException.class);
-    assertEquals(consumer.NUM_ENTRIES, consumer.countEntries());
+    assertEquals(consumer.NUM_ENTRIES, consumer.countEntriesOnServer());
   }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ProducerTest.java
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ProducerTest.java
b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ProducerTest.java
index 85f8038..c3ccb80 100644
--- a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ProducerTest.java
+++ b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ProducerTest.java
@@ -16,8 +16,10 @@
  */
 package org.apache.geode.examples.replicated;
 
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.client.ClientCache;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.*;
+
+import java.util.Set;
 
 import org.junit.After;
 import org.junit.Before;
@@ -25,13 +27,8 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 
-import java.util.Set;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ClientCache;
 
 public class ProducerTest {
 
@@ -51,7 +48,7 @@ public class ProducerTest {
   }
 
   @Test
-  public void populateRegion() throws Exception {
+  public void populateRegionShouldReturnCorrectNumberOfEntries() throws Exception {
     producer = new Producer(clientCache);
     producer.setRegion(region);
 
@@ -60,7 +57,7 @@ public class ProducerTest {
   }
 
   @Test
-  public void populateWhenRegionDoesntExist() throws Exception {
+  public void populateWhenRegionDoesNotExistShouldThrowNullPointer() throws Exception {
     producer = new Producer(clientCache);
     expectedException.expect(NullPointerException.class);
     producer.populateRegion();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/13d8dde6/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ReplicatedTest.java
----------------------------------------------------------------------
diff --git a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ReplicatedTest.java
b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ReplicatedTest.java
index dc4e65f..1901221 100644
--- a/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ReplicatedTest.java
+++ b/geode-examples/replicated/src/test/java/org/apache/geode/examples/replicated/ReplicatedTest.java
@@ -73,7 +73,7 @@ public class ReplicatedTest {
   @Test
   public void checkIfScriptsExistsAndAreExecutable() throws IOException {
     assertTrue(shell.getFileFromClassLoader(startScriptFileName).map(x -> x.isFile()).orElse(false));
-    assertTrue(shell.getFileFromClassLoader(startScriptFileName).map(x -> x.isFile()).orElse(false));
+    assertTrue(shell.getFileFromClassLoader(stopScriptFileName).map(x -> x.isFile()).orElse(false));
   }
 
   @Test


Mime
View raw message