This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch feature/GEODE_5027
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE_5027 by this 
push:
     new abf252d  GEODE-5027 Bump version to 1.6.0
abf252d is described below

commit abf252d4b87001e01ee986a5766b172fd55f6349
Author: Bruce Schuchardt <bschucha...@pivotal.io>
AuthorDate: Fri Apr 6 14:07:34 2018 -0700

    GEODE-5027 Bump version to 1.6.0
    
    Revising the new VersionJUnitTest method - the old one made no sense
---
 .../src/main/java/org/apache/geode/internal/Version.java     |  7 +++++++
 .../internal/cache/tier/sockets/CommandInitializer.java      |  3 +++
 .../java/org/apache/geode/internal/VersionJUnitTest.java     | 12 ++++++++----
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/Version.java 
b/geode-core/src/main/java/org/apache/geode/internal/Version.java
index 5c67838..f7a01e7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/Version.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/Version.java
@@ -20,6 +20,8 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
+import java.util.Arrays;
+import java.util.stream.Collectors;
 
 import org.apache.geode.cache.UnsupportedVersionException;
 import org.apache.geode.internal.cache.tier.sockets.CommandInitializer;
@@ -544,4 +546,9 @@ public class Version implements Comparable<Version> {
   public boolean isPre65() {
     return compareTo(Version.GFE_65) < 0;
   }
+
+  public static Iterable<? extends Version> getAllVersions() {
+    return Arrays.asList(VALUES).stream().filter(x -> x != null && x != 
TEST_VERSION)
+        .collect(Collectors.toList());
+  }
 }
diff --git 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CommandInitializer.java
 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CommandInitializer.java
index c0b7f99..8d2bb23 100644
--- 
a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CommandInitializer.java
+++ 
b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CommandInitializer.java
@@ -157,6 +157,8 @@ public class CommandInitializer {
   private static void initializeAllCommands() {
     ALL_COMMANDS = new LinkedHashMap<Version, Map<Integer, Command>>();
 
+    ALL_COMMANDS.put(Version.GFE_56, new HashMap<>());
+
     // Initialize the GFE 5.7 commands
     Map<Integer, Command> gfe57Commands = new HashMap<Integer, Command>();
     ALL_COMMANDS.put(Version.GFE_57, gfe57Commands);
@@ -293,6 +295,7 @@ public class CommandInitializer {
     gfe70Commands.put(MessageType.EXECUTE_FUNCTION, 
ExecuteFunction70.getCommand());
 
     ALL_COMMANDS.put(Version.GFE_701, gfe70Commands);
+    ALL_COMMANDS.put(Version.GFE_7099, gfe70Commands);
     ALL_COMMANDS.put(Version.GFE_71, gfe70Commands);
 
     Map<Integer, Command> gfe80Commands = new HashMap<Integer, Command>();
diff --git 
a/geode-core/src/test/java/org/apache/geode/internal/VersionJUnitTest.java 
b/geode-core/src/test/java/org/apache/geode/internal/VersionJUnitTest.java
index 48572fc..36897e8 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/VersionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/VersionJUnitTest.java
@@ -62,9 +62,13 @@ public class VersionJUnitTest {
   }
 
   @Test
-  public void testCommandMapContainsCurrentVersion() {
-    org.junit.Assert.assertNotNull(
-        "Please add a commnd set for the new version of Geode to 
CommandInitializer",
-        CommandInitializer.getCommands(Version.CURRENT));
+  public void testCommandMapContainsAllVersionsButCurrent() {
+    for (Version version : Version.getAllVersions()) {
+      if (version != Version.CURRENT) {
+        org.junit.Assert.assertNotNull(
+            "Please add a commnd set for " + version + " of Geode to 
CommandInitializer",
+            CommandInitializer.getCommands(version));
+      }
+    }
   }
 }

-- 
To stop receiving notification emails like this one, please contact
bschucha...@apache.org.

Reply via email to