You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2016/08/25 18:27:00 UTC

[1/7] incubator-geode git commit: GEODE-1813: Don't pass fixed partition attributes to BucketRegionQueue

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-1817 1cc598809 -> 67de9b94e


GEODE-1813: Don't pass fixed partition attributes to BucketRegionQueue

The BucketRegionQueue should not inherit the fixed partition attributes
from the parent region.


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

Branch: refs/heads/feature/GEODE-1817
Commit: f253ad2f1e7c725a6497c434e9f8a23028bda8de
Parents: 3726973
Author: Dan Smith <up...@apache.org>
Authored: Mon Aug 22 18:04:20 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Wed Aug 24 09:32:52 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/PartitionedRegion.java       | 13 +++--
 .../cache/wan/AsyncEventQueueTestBase.java      | 55 ++++++++++++++++++++
 .../asyncqueue/AsyncEventListenerDUnitTest.java | 29 +++++++++++
 3 files changed, 93 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f253ad2f/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
index df9ceba..175a284 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java
@@ -660,18 +660,23 @@ public class PartitionedRegion extends LocalRegion implements
     this.partitionListeners = this.partitionAttributes.getPartitionListeners(); 
 
     this.colocatedWithRegion = ColocationHelper.getColocatedRegion(this);
-    if (colocatedWithRegion != null) {
-      //In colocation chain, child region inherita the fixed partitin attributes from parent region.
-      this.fixedPAttrs = colocatedWithRegion.getFixedPartitionAttributesImpl();
-      this.fixedPASet = colocatedWithRegion.fixedPASet;
+
+    if(colocatedWithRegion != null) {
       synchronized (colocatedWithRegion.colocatedByList) {
         colocatedWithRegion.colocatedByList.add(this);
       }
     }
+
+    if (colocatedWithRegion != null && !internalRegionArgs.isUsedForParallelGatewaySenderQueue()) {
+      //In a colocation chain, the child region inherits the fixed partition attributes from parent region.
+      this.fixedPAttrs = colocatedWithRegion.getFixedPartitionAttributesImpl();
+      this.fixedPASet = colocatedWithRegion.fixedPASet;
+    }
     else {
       this.fixedPAttrs = this.partitionAttributes.getFixedPartitionAttributes();
       this.fixedPASet = 0;
     }
+
     if (logger.isDebugEnabled()) {
       logger.debug("Partitioned Region {} constructed {}", regionname, (this.haveCacheLoader ? "with a cache loader" : ""));
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f253ad2f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
index d7739c5..c66ef0b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/AsyncEventQueueTestBase.java
@@ -53,6 +53,9 @@ import com.gemstone.gemfire.cache.Declarable;
 import com.gemstone.gemfire.cache.DiskStore;
 import com.gemstone.gemfire.cache.DiskStoreFactory;
 import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.EntryOperation;
+import com.gemstone.gemfire.cache.FixedPartitionAttributes;
+import com.gemstone.gemfire.cache.FixedPartitionResolver;
 import com.gemstone.gemfire.cache.LoaderHelper;
 import com.gemstone.gemfire.cache.PartitionAttributesFactory;
 import com.gemstone.gemfire.cache.Region;
@@ -628,6 +631,31 @@ public class AsyncEventQueueTestBase extends JUnit4DistributedTestCase {
     }
   }
 
+  public static void createFixedPartitionedRegionWithAsyncEventQueue(
+    String regionName, String asyncEventQueueId, String partitionName, final List<String> allPartitions, boolean offHeap) {
+    IgnoredException exp = IgnoredException.addIgnoredException(ForceReattemptException.class
+      .getName());
+    IgnoredException exp1 = IgnoredException.addIgnoredException(PartitionOfflineException.class
+      .getName());
+    try {
+      AttributesFactory fact = new AttributesFactory();
+
+      PartitionAttributesFactory pfact = new PartitionAttributesFactory();
+      pfact.setTotalNumBuckets(16);
+      pfact.addFixedPartitionAttributes(FixedPartitionAttributes.createFixedPartition(partitionName,true));
+      pfact.setPartitionResolver(new MyFixedPartitionResolver(allPartitions));
+      fact.setPartitionAttributes(pfact.create());
+      fact.setOffHeap(offHeap);
+      Region r = cache.createRegionFactory(fact.create())
+        .addAsyncEventQueueId(asyncEventQueueId).create(regionName);
+      assertNotNull(r);
+    }
+    finally {
+      exp.remove();
+      exp1.remove();
+    }
+  }
+
   public static void createColocatedPartitionedRegionWithAsyncEventQueue(
       String regionName, String asyncEventQueueId, Integer totalNumBuckets,
       String colocatedWith) {
@@ -1616,6 +1644,33 @@ public class AsyncEventQueueTestBase extends JUnit4DistributedTestCase {
   public boolean isOffHeap() {
     return false;
   }
+
+  private static class MyFixedPartitionResolver implements FixedPartitionResolver {
+
+    private final List<String> allPartitions;
+
+    public MyFixedPartitionResolver(final List<String> allPartitions) {
+      this.allPartitions = allPartitions;
+    }
+
+    @Override
+    public String getPartitionName(final EntryOperation opDetails, @Deprecated final Set targetPartitions) {
+      int hash =  Math.abs(opDetails.getKey().hashCode() % allPartitions.size());
+      return allPartitions.get(hash);
+    }
+
+    @Override public Object getRoutingObject(final EntryOperation opDetails) {
+      return opDetails.getKey();
+    }
+
+    @Override public String getName() {
+      return getClass().getName();
+    }
+
+    @Override public void close() {
+
+    }
+  }
 }
 
 class MyAsyncEventListener_CacheLoader implements AsyncEventListener {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f253ad2f/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
index f090402..4c78bdc 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/wan/asyncqueue/AsyncEventListenerDUnitTest.java
@@ -20,6 +20,7 @@ import static com.gemstone.gemfire.distributed.ConfigurationProperties.*;
 import static org.junit.Assert.*;
 import static org.mockito.Matchers.any;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -135,6 +136,34 @@ public class AsyncEventListenerDUnitTest extends AsyncEventQueueTestBase {
     assertEquals("Size of AsyncEventQueue is incorrect", 1000, vm2size);
   }
 
+  @Test
+  public void testParallelAsyncEventQueueWithFixedPartition() {
+    Integer lnPort = (Integer)vm0.invoke(() -> AsyncEventQueueTestBase.createFirstLocatorWithDSId( 1 ));
+
+    vm1.invoke(createCacheRunnable(lnPort));
+    vm2.invoke(createCacheRunnable(lnPort));
+
+    vm1.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      true, 100, 100, false, false, null, false ));
+    vm2.invoke(() -> AsyncEventQueueTestBase.createAsyncEventQueue( "ln",
+      true, 100, 100, false, false, null, false ));
+
+    List<String> allPartitions = Arrays.asList("part1", "part2");
+    vm1.invoke(() -> AsyncEventQueueTestBase.createFixedPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", "part1", allPartitions, isOffHeap()));
+    vm2.invoke(() -> AsyncEventQueueTestBase.createFixedPartitionedRegionWithAsyncEventQueue( getTestMethodName() + "_PR", "ln", "part2", allPartitions, isOffHeap()));
+
+    vm1.invoke(() -> AsyncEventQueueTestBase.doPuts( getTestMethodName() + "_PR",
+      256 ));
+
+    vm1.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+    vm2.invoke(() -> AsyncEventQueueTestBase.waitForAsyncQueueToGetEmpty( "ln" ));
+
+    int vm1size = (Integer)vm1.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
+    int vm2size = (Integer)vm2.invoke(() -> AsyncEventQueueTestBase.getAsyncEventListenerMapSize( "ln"));
+
+    assertEquals(vm1size + vm2size, 256);
+  }
+
   protected SerializableRunnableIF pauseAsyncEventQueueRunnable() {
     return () -> AsyncEventQueueTestBase.pauseAsyncEventQueue( "ln" );
   }


[4/7] incubator-geode git commit: GEODE-838 Test now uses port 0 for cacheServer

Posted by je...@apache.org.
GEODE-838 Test now uses port 0 for cacheServer


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

Branch: refs/heads/feature/GEODE-1817
Commit: 7454c3fd35d4e818ca3a83e5b8def8503ea30717
Parents: fb39f88
Author: Hitesh Khamesra <hi...@yahoo.com>
Authored: Wed Aug 24 10:22:44 2016 -0700
Committer: Hitesh Khamesra <hi...@yahoo.com>
Committed: Wed Aug 24 10:26:51 2016 -0700

----------------------------------------------------------------------
 .../security/ClientAuthenticationTestCase.java  | 33 ++++++++++----------
 1 file changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7454c3fd/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationTestCase.java b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationTestCase.java
index d7c75c7..7e6d022 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationTestCase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/security/ClientAuthenticationTestCase.java
@@ -453,17 +453,16 @@ public abstract class ClientAuthenticationTestCase extends JUnit4DistributedTest
 
     // Try to connect client1 with no credentials
     // Verify that the creation of region throws security exception
-    server1.invoke(() -> createCacheServer(locPort1, locString, port1, authenticator, extraProps, javaProps));
-
+    final int p = server1.invoke(() -> createCacheServer(locPort1, locString, 0, authenticator, extraProps, javaProps));
     if (gen.classCode().equals(CredentialGenerator.ClassCode.SSL)) {
       // For SSL the exception may not come since the server can close socket
       // before handshake message is sent from client. However exception
       // should come in any region operations.
-      client1.invoke(() -> createCacheClient(null, null, null, port1, port2, zeroConns, multiUser, NOFORCE_AUTHREQ_EXCEPTION));
+      client1.invoke(() -> createCacheClient(null, null, null, p, port2, zeroConns, multiUser, NOFORCE_AUTHREQ_EXCEPTION));
       client1.invoke(() -> doPuts(2, OTHER_EXCEPTION));
 
     } else {
-      client1.invoke(() -> createCacheClient(null, null, null, port1, port2, zeroConns, multiUser, AUTHREQ_EXCEPTION));
+      client1.invoke(() -> createCacheClient(null, null, null, p, port2, zeroConns, multiUser, AUTHREQ_EXCEPTION));
     }
 
     // Now try to connect client2 with invalid credentials
@@ -472,23 +471,23 @@ public abstract class ClientAuthenticationTestCase extends JUnit4DistributedTest
     javaProps2 = gen.getJavaProperties();
     getLogWriter().info("testCredentialsForNotifications: For second client invalid credentials: " + credentials2 + " : " + javaProps2);
 
-    createClient2WithException(multiUser, authInit, port1, port2, credentials2, javaProps2, zeroConns);
+    createClient2WithException(multiUser, authInit, p, port2, credentials2, javaProps2, zeroConns);
 
     // Now try to connect client2 with invalid auth-init method
     // Trying to create the region on client with valid credentials should
     // throw a security exception
-    client2.invoke(() -> createCacheClient("com.gemstone.none", credentials1, javaProps1, port1, port2, zeroConns, multiUser, SECURITY_EXCEPTION));
+    client2.invoke(() -> createCacheClient("com.gemstone.none", credentials1, javaProps1, p, port2, zeroConns, multiUser, SECURITY_EXCEPTION));
 
     // Try connection with null auth-init on clients.
     // Skip this test for a scheme which does not have an authInit in the
     // first place (e.g. SSL).
     if (authInit != null && authInit.length() > 0) {
-      server1.invoke(() -> createCacheServer(locPort1, locString, port1, authenticator, extraProps, javaProps));
-      server2.invoke(() -> createCacheServer(locPort2, locString, port2, authenticator, extraProps, javaProps));
-      client1.invoke(() -> createCacheClient(null, credentials1, javaProps1, port1, port2, 0, multiUser, AUTHREQ_EXCEPTION));
+      final int p1 = server1.invoke(() -> createCacheServer(locPort1, locString, 0, authenticator, extraProps, javaProps));
+      final int p2 = server2.invoke(() -> createCacheServer(locPort2, locString, 0, authenticator, extraProps, javaProps));
+      client1.invoke(() -> createCacheClient(null, credentials1, javaProps1, p1, p2, 0, multiUser, AUTHREQ_EXCEPTION));
 
-      createClient2AuthReqException(multiUser, port1, port2, credentials2, javaProps2, zeroConns);
-      createClient2AuthReqException(multiUser, port1, port2, credentials2, javaProps2, zeroConns);
+      createClient2AuthReqException(multiUser, p1, p2, credentials2, javaProps2, zeroConns);
+      createClient2AuthReqException(multiUser, p1, p2, credentials2, javaProps2, zeroConns);
 
     } else {
       getLogWriter().info("testCredentialsForNotifications: Skipping null authInit for scheme [" + gen.classCode() + "] which has no authInit");
@@ -499,11 +498,11 @@ public abstract class ClientAuthenticationTestCase extends JUnit4DistributedTest
     // If the scheme does not have an authenticator in the first place (e.g.
     // SSL) then skip it since this test is useless.
     if (authenticator != null && authenticator.length() > 0) {
-      server1.invoke(() -> createCacheServer(locPort1, locString, port1, null, extraProps, javaProps));
-      server2.invoke(() -> createCacheServer(locPort2, locString, port2, null, extraProps, javaProps));
+      final int p1 = server1.invoke(() -> createCacheServer(locPort1, locString, 0, null, extraProps, javaProps));
+      final int p2 = server2.invoke(() -> createCacheServer(locPort2, locString, 0, null, extraProps, javaProps));
 
-      createClient1NoException(multiUser, authInit, port1, port2, credentials1, javaProps1);
-      createClient2NoException(multiUser, authInit, port1, port2, credentials2, javaProps2, zeroConns);
+      createClient1NoException(multiUser, authInit, p1, p2, credentials1, javaProps1);
+      createClient2NoException(multiUser, authInit, p1, p2, credentials2, javaProps2, zeroConns);
 
       // Register interest on all keys on second client
       client2.invoke(() -> registerAllInterest());
@@ -515,8 +514,8 @@ public abstract class ClientAuthenticationTestCase extends JUnit4DistributedTest
       client2.invoke(() -> doLocalGets(4));
 
       // Now also try with valid credentials on client2
-      createClient1NoException(multiUser, authInit, port1, port2, credentials2, javaProps2);
-      createClient2NoException(multiUser, authInit, port1, port2, credentials1, javaProps1, zeroConns);
+      createClient1NoException(multiUser, authInit, p1, p2, credentials2, javaProps2);
+      createClient2NoException(multiUser, authInit, p1, p2, credentials1, javaProps1, zeroConns);
 
       // Register interest on all keys on second client
       client2.invoke(() -> registerAllInterest());


[2/7] incubator-geode git commit: GEODE-1699: Making accessor VM a proxy in LuceneQuery tests

Posted by je...@apache.org.
GEODE-1699: Making accessor VM a proxy in LuceneQuery tests

The P2P lucene query tests were creating an accessor VM that was
actually a datastore. That caused some of the tests that thought they
were pausing the dispatcher for the AEQ to still have an active
dispatcher on the accessor.


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

Branch: refs/heads/feature/GEODE-1817
Commit: fb39f889ac1cb891f39aae281419e723e5b615c0
Parents: f253ad2
Author: Dan Smith <up...@apache.org>
Authored: Tue Aug 23 15:50:35 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Wed Aug 24 09:33:26 2016 -0700

----------------------------------------------------------------------
 .../gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java      | 5 ++++-
 .../cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java    | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fb39f889/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
index 702ac1f..3af44ef 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRDUnitTest.java
@@ -35,6 +35,9 @@ public class LuceneQueriesPeerPRDUnitTest extends LuceneQueriesPRBase {
   }
 
   @Override protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    initDataStore(createIndex);
+    createIndex.run();
+    getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY)
+        .setPartitionAttributes(getPartitionAttributes())
+        .create(REGION_NAME);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fb39f889/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
index d509cb2..f44f547 100644
--- a/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
+++ b/geode-lucene/src/test/java/com/gemstone/gemfire/cache/lucene/LuceneQueriesPeerPRRedundancyDUnitTest.java
@@ -52,7 +52,10 @@ public class LuceneQueriesPeerPRRedundancyDUnitTest extends LuceneQueriesPRBase
   }
 
   @Override protected void initAccessor(final SerializableRunnableIF createIndex) throws Exception {
-    initDataStore(createIndex);
+    createIndex.run();
+    Region region = getCache().createRegionFactory(RegionShortcut.PARTITION_PROXY_REDUNDANT)
+        .setPartitionAttributes(getPartitionAttributes())
+        .create(REGION_NAME);
   }
 
   @Test


[6/7] incubator-geode git commit: GEODE-1809: Refactor GemFireVersion

Posted by je...@apache.org.
GEODE-1809: Refactor GemFireVersion

Clean up dead / broken / unused code and reduce the visible
API methods.  Store the version info as a Map to allow it to be
extended more easily. Move scm info into utilities.gradle.


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

Branch: refs/heads/feature/GEODE-1817
Commit: 93985f96fe5eca16ad301aa09f1719bc213b6034
Parents: 98531a1
Author: Anthony Baker <ab...@apache.org>
Authored: Tue Aug 23 14:32:16 2016 -0700
Committer: Anthony Baker <ab...@apache.org>
Committed: Thu Aug 25 10:00:52 2016 -0700

----------------------------------------------------------------------
 build.gradle                                    |   1 -
 geode-core/build.gradle                         |  33 -
 .../distributed/internal/StartupMessage.java    |  14 -
 .../gemfire/internal/GemFireVersion.java        | 726 +++++--------------
 .../gemstone/gemfire/internal/SystemAdmin.java  |  10 +-
 .../internal/GemFireVersionJUnitTest.java       |  75 +-
 .../gemfire/internal/VersionJUnitTest.java      |  50 ++
 gradle/utilities.gradle                         |  43 ++
 8 files changed, 275 insertions(+), 677 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index eac68d0..e112eb7 100755
--- a/build.gradle
+++ b/build.gradle
@@ -22,7 +22,6 @@ buildscript {
 
   dependencies {
     classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.2.0"
-    classpath "org.ajoberstar:gradle-git:1.3.2"
     classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
     classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1'
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/build.gradle
----------------------------------------------------------------------
diff --git a/geode-core/build.gradle b/geode-core/build.gradle
index 1d5ad4a..ea1fce2 100755
--- a/geode-core/build.gradle
+++ b/geode-core/build.gradle
@@ -133,39 +133,6 @@ sourceSets {
   }
 }
 
-ext.readScmInfo = {
-  try {
-    def git = org.ajoberstar.grgit.Grgit.open(currentDir: projectDir)
-    try {
-      return [
-        'Source-Repository': git.branch.getCurrent().name,
-        'Source-Revision'  : git.head().id,
-        'Source-Date'      : git.head().getDate().format('yyyy-MM-dd HH:mm:ss Z')
-      ] as Properties
-    } finally {
-      git.close()
-    }
-  } catch (IllegalArgumentException e) {
-    // if we're building from the source distribution, we don't have git so
-    // use cached info written during the assembly process
-    def buildInfo = file "$rootDir/.buildinfo"
-    if (buildInfo.exists()) {
-      def props = new Properties()
-      new FileInputStream(buildInfo).withStream { fis ->
-        props.load(fis)
-      }
-      return props
-    }
-
-    logger.warn( '***** Unable to find Git workspace. Using default version information *****' )
-    return [
-      'Source-Repository': 'UNKNOWN',
-      'Source-Revision'  : 'UNKNOWN',
-      'Source-Date'      : new Date().format('yyyy-MM-dd HH:mm:ss Z')
-    ] as Properties
-  }
-}
-
 // Creates the version properties file and writes it to the classes dir
 task createVersionPropertiesFile {
   def propertiesFile = file(generatedResources + "/com/gemstone/gemfire/internal/GemFireVersion.properties");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessage.java
index 82f5c88..7b6d853 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessage.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/distributed/internal/StartupMessage.java
@@ -178,20 +178,6 @@ public final class StartupMessage extends HighPriorityDistributionMessage implem
 
     String myVersion = GemFireVersion.getGemFireVersion();
     String theirVersion = this.version;
-    int myMajorVersion = GemFireVersion.getMajorVersion(myVersion);
-    int theirMajorVersion = GemFireVersion.getMajorVersion(theirVersion);
-    int myMinorVersion = GemFireVersion.getMinorVersion(myVersion);
-    int theirMinorVersion = GemFireVersion.getMinorVersion(theirVersion);
-    // fix for bug 43608
-    if (myMajorVersion != theirMajorVersion || myMinorVersion != theirMinorVersion) {
-      // now don't reject at this level since it will be handled at
-      // JGroups/Connection handshake level
-      /*
-      rejectionMessage = 
-          LocalizedStrings.StartupMessage_REJECTED_NEW_SYSTEM_NODE_0_WITH_PRODUCT_VERSION_1_BECAUSE_THE_EXISTING_DISTRIBUTED_SYSTEM_NODE_2_HAS_A_PRODUCT_VERSION_OF_3
-          .toLocalizedString(new Object[] {getSender(), this.version, dm.getId(), GemFireVersion.getGemFireVersion()});
-      */
-    }
     if (dm.getTransport().isMcastEnabled() != isMcastEnabled) {
       rejectionMessage =
         LocalizedStrings.StartupMessage_REJECTED_NEW_SYSTEM_NODE_0_BECAUSE_ISMCASTENABLED_1_DOES_NOT_MATCH_THE_DISTRIBUTED_SYSTEM_IT_IS_ATTEMPTING_TO_JOIN

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java
index baf03b1..9bd3d4f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/GemFireVersion.java
@@ -16,335 +16,101 @@
  */
 package com.gemstone.gemfire.internal;
 
+import java.io.File;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 
-import java.io.*;
-import java.net.*;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
 /**
  * This class provides build and version information about GemFire.
  * It gathers this information from the resource property file
  * for this class.
  */
 public class GemFireVersion {
-
   private static String RESOURCE_NAME = "GemFireVersion.properties";
-  
-  /** The singleton instance */
-  private static GemFireVersion instance;
-
-  /** Constant for the GemFire version Resource Property entry */
-  private static final String PRODUCT_NAME = "Product-Name";
-
-  /** Constant for the GemFire version Resource Property entry */
-  private static final String GEMFIRE_VERSION = "Product-Version";
-
-  /** Constant for the source code date Resource Property entry */
-  private static final String SOURCE_DATE = "Source-Date";
-
-  /** Constant for the source code revision Resource Property entry */
-  private static final String SOURCE_REVISION = "Source-Revision";
-
-  /** Constant for the source code repository Resource Property entry */
-  private static final String SOURCE_REPOSITORY = "Source-Repository";
-
-  /** Constant for the build date Resource Property entry */
-  private static final String BUILD_DATE = "Build-Date";
-
-  /** Constant for the build id Resource Property entry */
-  private static final String BUILD_ID = "Build-Id";
-
-  /** Constant for the build Java version Resource Property entry */
-  private static final String BUILD_PLATFORM = "Build-Platform";
-
-  /** Constant for the build Java version Resource Property entry */
-  private static final String BUILD_JAVA_VERSION = "Build-Java-Version";
-
-  ////////////////////  Instance Fields  ////////////////////
-
-  /** Error message to display instead of the version information */
-  private String error = null;
-
-  /** The name of this product */
-  private String productName;
-
-  /** This product's version */
-  private String gemfireVersion;
-
-  /** The version of GemFire native code library */
-  private String nativeVersion;
-
-  /** The date that the source code for GemFire was last updated */  
-  private String sourceDate;
 
-  /** The revision of the source code used to build GemFire */  
-  private String sourceRevision;
-
-  /** The repository in which the source code for GemFire resides */  
-  private String sourceRepository;
-
-  /** The date on which GemFire was built */
-  private String buildDate;
-
-  /** The ID of the GemFire build */
-  private String buildId;
-
-  /** The platform on which GemFire was built */
-  private String buildPlatform;
-
-  /** The version of Java that was used to build GemFire */
-  private String buildJavaVersion;
+  /** The singleton instance */
+  private static VersionDescription description;
 
-  ////////////////////  Static Methods  ////////////////////
+  private GemFireVersion() {
+  }
 
-  /**
-   * Returns (or creates) the singleton instance of this class
-   */
-  private static GemFireVersion getInstance() {
-    if (instance == null) {
-      instance = new GemFireVersion();
+  private static synchronized VersionDescription getDescription() {
+    if (description == null) {
+      String name = GemFireVersion.class.getPackage().getName()
+          .replace('.', '/') + "/" + RESOURCE_NAME;
+      description = new VersionDescription(name);
     }
-
-    return instance;
+    return description;
+  }
+  
+  public static void main(String[] args) {
+    System.out.println(asString());
   }
 
-  /**
-   * Returns the name of this product
-   */
   public static String getProductName() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.productName;
-    }
+    return getDescription().getProperty(VersionDescription.PRODUCT_NAME);
   }
 
-  /**
-   * Returns the version of GemFire being used
-   */
   public static String getGemFireVersion() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.gemfireVersion;
-    }
-  }
-
-  private static String stripSpaces(String s) {
-    StringBuffer result = new StringBuffer(s);
-    while (result.charAt(0) == ' ') {
-      result.deleteCharAt(0);
-    }
-    while (result.charAt(result.length()-1) == ' ') {
-      result.deleteCharAt(result.length()-1);
-    }
-    return result.toString();
-  }
-  
-  /**
-   * Returns the version of GemFire native code library being used
-   */
-  public static String getNativeCodeVersion() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.nativeVersion;
-    }
-  }
-  public static String getJavaCodeVersion() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      StringBuffer result = new StringBuffer(80);
-      result.append(GemFireVersion.getGemFireVersion())
-        .append(' ')
-        .append(GemFireVersion.getBuildId())
-        .append(' ')
-        .append(GemFireVersion.getBuildDate())
-        .append(" javac ")
-        .append(GemFireVersion.getBuildJavaVersion());
-      return result.toString();
-    }
+    return getDescription().getProperty(VersionDescription.GEMFIRE_VERSION);
   }
 
-  /**
-   * Returns the date of the source code from which GemFire was built
-   */
   public static String getSourceDate() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.sourceDate;
-    }
+    return getDescription().getProperty(VersionDescription.SOURCE_DATE);
   }
 
-  /**
-   * Returns the revision of the source code on which GemFire was
-   * built.
-   *
-   * @since GemFire 4.0
-   */
-  public static String getSourceRevision() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.sourceRevision;
-    }
-  }
-
-  /**
-   * Returns the source code repository from which GemFire was built.
-   *
-   * @since GemFire 4.0
-   */
   public static String getSourceRepository() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.sourceRepository;
-    }
+    return getDescription().getProperty(VersionDescription.SOURCE_REPOSITORY);
   }
 
-  /**
-   * Returns the date on which GemFire was built
-   */
-  public static String getBuildDate() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.buildDate;
-    }
+  public static String getSourceRevision() {
+    return getDescription().getProperty(VersionDescription.SOURCE_REVISION);
   }
 
-  /**
-   * Returns the id of the GemFire build
-   */
   public static String getBuildId() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
+    return getDescription().getProperty(VersionDescription.BUILD_ID);
+  }
 
-    } else {
-      return v.buildId;
-    }
+  public static String getBuildDate() {
+    return getDescription().getProperty(VersionDescription.BUILD_DATE);
   }
 
-  /**
-   * Returns the platform on which GemFire was built
-   */
   public static String getBuildPlatform() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.buildPlatform;
-    }
+    return getDescription().getProperty(VersionDescription.BUILD_PLATFORM);
   }
 
-  /**
-   * Returns the version of Java used to build GemFire
-   */
   public static String getBuildJavaVersion() {
-    GemFireVersion v = getInstance();
-    if (v.error != null) {
-      return v.error;
-
-    } else {
-      return v.buildJavaVersion;
-    }
+    return getDescription().getProperty(VersionDescription.BUILD_JAVA_VERSION);
   }
 
-  ////////////////////  Constructors  ////////////////////
+  public static String getGemFireJarFileName() {
+    return "geode-core-" + GemFireVersion.getGemFireVersion() +".jar";
+  }
 
-  /**
-   * Private constructor that read the resource properties
-   * and extracts interesting pieces of information from it
-   */
-  private GemFireVersion() {
-    String name =
-      GemFireVersion.class.getPackage().getName().replace('.', '/');
-    name = name + "/" + RESOURCE_NAME;
-
-    InputStream is = ClassPathLoader.getLatest().getResourceAsStream(getClass(), name);
-    if (is == null) {
-      error = LocalizedStrings.GemFireVersion_COULD_NOT_FIND_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_0.toLocalizedString(RESOURCE_NAME);
-      return;
-    }
-    Properties props = new Properties();
-    try {
-      props.load(is);
-    } catch (Exception ex) {
-      error = LocalizedStrings.GemFireVersion_COULD_NOT_READ_PROPERTIES_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_0_BECAUSE_1.toLocalizedString(new Object[] {RESOURCE_NAME, ex});
-      return;
-    }
+  public static void print(PrintWriter pw) {
+    getDescription().print(pw);
+  }
+  
+  public static void print(PrintStream ps) {
+    print(new PrintWriter(ps, true));
+  }
 
-    this.nativeVersion = SmHelper.getNativeVersion();
-    this.productName = props.getProperty(PRODUCT_NAME);
-    if (this.productName == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {PRODUCT_NAME, RESOURCE_NAME});
-      return;
-    }
-    this.gemfireVersion = props.getProperty(GEMFIRE_VERSION);
-    if (this.gemfireVersion == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {GEMFIRE_VERSION, RESOURCE_NAME});
-      return;
-    }
-    this.sourceDate = props.getProperty(SOURCE_DATE);
-    if (this.sourceDate == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_DATE, RESOURCE_NAME});
-      return;
-    }
-    this.sourceRevision = props.getProperty(SOURCE_REVISION);
-    if (this.sourceRevision == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_REVISION, RESOURCE_NAME});
-      return;
-    }
-    this.sourceRepository = props.getProperty(SOURCE_REPOSITORY);
-    if (this.sourceRepository == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_REPOSITORY, RESOURCE_NAME});
-      return;
-    }
-    this.buildDate = props.getProperty(BUILD_DATE);
-    if (this.buildDate == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_DATE, RESOURCE_NAME});
-      return;
-    }
-    this.buildId = props.getProperty(BUILD_ID);
-    if (this.buildId == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_ID, RESOURCE_NAME});
-      return;
-    }
-    this.buildPlatform = props.getProperty(BUILD_PLATFORM);
-    if (this.buildPlatform == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_PLATFORM, RESOURCE_NAME});
-      return;
-    }
-    this.buildJavaVersion = props.getProperty(BUILD_JAVA_VERSION);
-    if (this.buildJavaVersion == null) {
-      error = LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_JAVA_VERSION, RESOURCE_NAME});
-      return;
-    }
+  public static String asString() {
+    StringWriter sw = new StringWriter(256);
+    PrintWriter pw = new PrintWriter(sw);
+    print(pw);
+    pw.flush();
+    return sw.toString();
   }
 
   /** Public method that returns the URL of the gemfire jar file */
@@ -385,293 +151,141 @@ public class GemFireVersion {
     return csLoc;
   }
   
-  public static String getGemFireJarFileName() {
-    return "geode-core-" + GemFireVersion.getGemFireVersion() +".jar";
-  }
+  static class VersionDescription {
+    /** Constant for the GemFire version Resource Property entry */
+    static final String PRODUCT_NAME = "Product-Name";
 
-  private final static String VER_FILE_NAME = "GemFireVersion.properties";
-  private final static String JAR_VER_NAME = "gemfire-core-jar";
-
-    public static void createVersionFile() {
-        String jarVersion = stripSpaces(GemFireVersion.getJavaCodeVersion());
-        File libDir = SystemAdmin.findGemFireLibDir();
-        if (libDir == null) {
-          throw new RuntimeException(LocalizedStrings.GemFireVersion_COULD_NOT_DETERMINE_PRODUCT_LIB_DIRECTORY.toLocalizedString());
-        }
-        File versionPropFile = new File(libDir, VER_FILE_NAME);
-        Properties props = new Properties();
-        props.setProperty(JAR_VER_NAME, jarVersion);
-        try {
-          FileOutputStream out = new FileOutputStream(versionPropFile);
-          props.store(out, "Expected versions for this product build as of");
-          out.close();
-        } catch (IOException ex) {
-          throw new RuntimeException(LocalizedStrings.GemFireVersion_COULD_NOT_WRITE_0_BECAUSE_1.toLocalizedString(new Object[] {versionPropFile, ex.toString()}));
-        }
-        System.out.println("Created \"" + versionPropFile + "\"");
-    }
-  /**
-   * Encodes all available version information into a string and then
-   * returns that string.
-   */
-  public static String asString() {
-    StringWriter sw = new StringWriter(256);
-    PrintWriter pw = new PrintWriter(sw);
-    print(pw);
-    pw.flush();
-    return sw.toString();
-  }
-    /**
-     * Prints all available version information (excluding source code
-     * information) to the given <code>PrintWriter</code> in a
-     * standard format.
-     */
-    public static void print(PrintWriter pw) {
-      print(pw, true);
+    /** Constant for the GemFire version Resource Property entry */
+    static final String GEMFIRE_VERSION = "Product-Version";
+
+    /** Constant for the source code date Resource Property entry */
+    static final String SOURCE_DATE = "Source-Date";
+
+    /** Constant for the source code revision Resource Property entry */
+    static final String SOURCE_REVISION = "Source-Revision";
+
+    /** Constant for the source code repository Resource Property entry */
+    static final String SOURCE_REPOSITORY = "Source-Repository";
+
+    /** Constant for the build date Resource Property entry */
+    static final String BUILD_DATE = "Build-Date";
+
+    /** Constant for the build id Resource Property entry */
+    static final String BUILD_ID = "Build-Id";
+
+    /** Constant for the build Java version Resource Property entry */
+    static final String BUILD_PLATFORM = "Build-Platform";
+
+    /** Constant for the build Java version Resource Property entry */
+    static final String BUILD_JAVA_VERSION = "Build-Java-Version";
+
+    /** the version properties */
+    private final Properties description;
+
+    /** Error message to display instead of the version information */
+    private final String error;
+
+    public VersionDescription(String name) {
+      InputStream is = ClassPathLoader.getLatest().getResourceAsStream(getClass(), name);
+      if (is == null) {
+        error = LocalizedStrings.GemFireVersion_COULD_NOT_FIND_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_0.toLocalizedString(RESOURCE_NAME);
+        description = null;
+        return;
+      }
+
+      description = new Properties();
+      try {
+        description.load(is);
+      } catch (Exception ex) {
+        error = LocalizedStrings.GemFireVersion_COULD_NOT_READ_PROPERTIES_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_0_BECAUSE_1.toLocalizedString(new Object[] {RESOURCE_NAME, ex});
+        return;
+      }
+      error = validate();
     }
 
-    /**
-     * Prints all available version information to the given
-     * <code>PrintWriter</code> in a standard format.
-     *
-     * @param printSourceInfo
-     *        Should information about the source code be printed?
-     */
-    public static void print(PrintWriter pw, 
-                             boolean printSourceInfo) {
-        String jarVersion = stripSpaces(GemFireVersion.getJavaCodeVersion());
-        pw.println("Java version:   " + jarVersion);
-        String libVersion = stripSpaces(GemFireVersion.getNativeCodeVersion());
-        pw.println("Native version: " + libVersion);
-        File libDir = SystemAdmin.findGemFireLibDir();
-        if (libDir != null) {
-          File versionPropFile = new File(libDir, VER_FILE_NAME);
-          if (versionPropFile.exists()) {
-            try {
-              Properties props = new Properties();
-              FileInputStream inStream = new FileInputStream(versionPropFile);
-              try {
-                props.load(inStream);
-              }
-              finally {
-                inStream.close();
-              }
-              String expectedJarVersion = props.getProperty(JAR_VER_NAME);
-              if (expectedJarVersion != null) {
-                if (!expectedJarVersion.equals(jarVersion)) {
-                  pw.println(LocalizedStrings.GemFireVersion_WARNING_EXPECTED_JAVA_VERSION_0.toLocalizedString(expectedJarVersion));
-                }
-              }
-            } catch (IOException ex) {
-              pw.println(LocalizedStrings.GemFireVersion_WARNING_FAILED_TO_READ_0_BECAUSE_1.toLocalizedString(new Object[] {versionPropFile, ex}));
-            }
-//           } else {
-//             pw.println(LocalizedStrings.GemFireVersion_WARNING_COULD_NOT_FIND_0.toLocalizedString(versionPropFile));
-          }
-//         } else {
-//           pw.println(LocalizedStrings.GemFireVersion_WARNING_COULD_NOT_DETERMINE_THE_PRODUCTS_LIB_DIRECTORY.toLocalizedString());
-        }
-	
-        if (printSourceInfo) {
-          String sourceRevision = GemFireVersion.getSourceRevision();
-          pw.println("Source revision: " + sourceRevision);
-
-          String sourceRepository =
-            GemFireVersion.getSourceRepository();
-          pw.println("Source repository: " + sourceRepository);
-        }
-
-	InetAddress host = null;
-	try {
-	    host = SocketCreator.getLocalHost();
-	} 
-	catch (VirtualMachineError err) {
-	   SystemFailure.initiateFailure(err);
-	   // If this ever returns, rethrow the error.  We're poisoned
-	   // now, so don't let this thread continue.
-	   throw err;
-	}
-	catch (Throwable t) {
-	     // Whenever you catch Error or Throwable, you must also
-	     // catch VirtualMachineError (see above).  However, there is
-	     // _still_ a possibility that you are dealing with a cascading
-	     // error condition, so you also need to check to see if the JVM
-	     // is still usable:
-	     SystemFailure.checkFailure();
-	}
-        int cpuCount = Runtime.getRuntime().availableProcessors();
-        pw.println(LocalizedStrings.GemFireVersion_RUNNING_ON_0.toLocalizedString(
-                   host
-                   + ", " + cpuCount + " cpu(s)"
-                   + ", " + System.getProperty("os.arch")
-                   + " " + System.getProperty("os.name")
-                   + " " + System.getProperty("os.version")
-                   ));
+    public String getProperty(String key) {
+      if (error != null) {
+        return error;
+      }
+      return description.getProperty(key);
     }
-	
-    /**
-     * Prints all available version information (excluding information
-     * about the source code) to the given <code>PrintStream</code> in
-     * a standard format.
-     */
-    public static void print(PrintStream ps) {
-	print(ps, true);
+    
+    public String getNativeCodeVersion() {
+      return SmHelper.getNativeVersion();
     }
+    
+    private void print(PrintWriter pw) {
+      for (Entry<?,?> props : description.entrySet()) {
+        pw.println(props.getKey() + ": " + props.getValue());
+      }
 
-    /**
-     * Prints all available version information to the given
-     * <code>PrintStream</code> in a standard format.
-     *
-     * @param printSourceInfo
-     *        Should information about the source code be printed?
-     */
-    public static void print(PrintStream ps,
-                             boolean printSourceInfo) {
-	PrintWriter pw = new PrintWriter(ps);
-	print(pw, printSourceInfo);
-	pw.flush();
+      // not stored in the description map
+      pw.println("Native version: " + getNativeCodeVersion());
+      printHostInfo(pw);
+    }
+
+    private void printHostInfo(PrintWriter pw)
+        throws InternalGemFireError, Error, VirtualMachineError {
+      try {
+        StringBuffer sb = new StringBuffer(SocketCreator.getLocalHost().toString())
+            .append(", ")
+            .append(Runtime.getRuntime().availableProcessors()).append(" cpu(s), ")
+            .append(System.getProperty("os.arch")).append(' ')
+            .append(System.getProperty("os.name")).append(' ')
+            .append(System.getProperty("os.version")).append(' ');
+        pw.println(LocalizedStrings.GemFireVersion_RUNNING_ON_0.toLocalizedString(sb.toString()));
+      } catch (VirtualMachineError err) {
+        SystemFailure.initiateFailure(err);
+        // If this ever returns, rethrow the error. We're poisoned
+        // now, so don't let this thread continue.
+        throw err;
+      } catch (Throwable t) {
+        // Whenever you catch Error or Throwable, you must also
+        // catch VirtualMachineError (see above). However, there is
+        // _still_ a possibility that you are dealing with a cascading
+        // error condition, so you also need to check to see if the JVM
+        // is still usable:
+        SystemFailure.checkFailure();
+      }
     }
-    
-  ///////////////////////  Main Program  ////////////////////
 
-//  private static final PrintStream out = System.out;
-//  private static final PrintStream err = System.err;
+    private String validate() {
+      if (getProperty(PRODUCT_NAME) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {PRODUCT_NAME, RESOURCE_NAME});
+      }
 
-  /**
-   * Populates the gemfireVersion.properties file
-   */
-  public static void main(String[] args) {
-      print(System.out);
-  }
+      if (getProperty(GEMFIRE_VERSION) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {GEMFIRE_VERSION, RESOURCE_NAME});
+      }
 
-  private static final Pattern MAJOR_MINOR = Pattern.compile("(\\d+)\\.(\\d*)(.*)");
-  private static final Pattern RELEASE = Pattern.compile("\\.(\\d*)(.*)");
-  private static final Pattern MAJOR_MINOR_RELEASE = Pattern.compile("(\\d+)\\.(\\d*)\\.(\\d*)(.*)");
-  
-  public static int getMajorVersion(String v) {
-    int majorVersion = 0;
-    Matcher m = MAJOR_MINOR.matcher(v);
-    if (m.matches()) {
-      String digits = m.group(1);
-      if (digits != null && digits.length() > 0) {
-        majorVersion = Integer.decode(digits).intValue();
+      if (getProperty(SOURCE_DATE) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_DATE, RESOURCE_NAME});
       }
-    }
-    return majorVersion;
-  }
 
-  public static int getMinorVersion(String v) {
-    int minorVersion = 0;
-    Matcher m = MAJOR_MINOR.matcher(v);
-    if (m.matches()) {
-      String digits = m.group(2);
-      if (digits != null && digits.length() > 0) {
-        minorVersion = Integer.decode(digits).intValue();
+      if (getProperty(SOURCE_REVISION) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_REVISION, RESOURCE_NAME});
       }
-    }
-    return minorVersion;
-  }
 
-  public static int getRelease(String v) {
-    int release = 0;
-    Matcher m = MAJOR_MINOR.matcher(v);
-    if (m.matches()) {
-      String others = m.group(3);
-      Matcher r = RELEASE.matcher(others);
-      if (r.matches()) {
-        String digits = r.group(1);
-        if (digits != null && digits.length() > 0) {
-          try {
-            release = Integer.decode(digits).intValue();
-          } catch (NumberFormatException e) {
-            release = 0;
-          }
-        }
+      if (getProperty(SOURCE_REPOSITORY) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {SOURCE_REPOSITORY, RESOURCE_NAME});
       }
-    }
-    return release;
-  }
-  
-  public static int getBuild(String v) {
-    int build = 0;
-    Matcher m = MAJOR_MINOR_RELEASE.matcher(v);
-    if (m.matches()) {
-      String buildStr = m.group(4);
-      Matcher b = RELEASE.matcher(buildStr);
-      if (b.matches()) {
-        String digits = b.group(1);
-        if (digits != null && digits.length() > 0) {
-          try {
-            build = Integer.decode(digits).intValue();
-          } catch (NumberFormatException e) {
-            build = 0;
-          }
-        }
+
+      if (getProperty(BUILD_DATE) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_DATE, RESOURCE_NAME});
       }
-    }
-    return build;
-  }
-  
-  /** 
-   * Compare version's sections major, minor, release one by one
-   * 
-   * @return >0: v1 is newer than v2
-   *          0: same
-   *          <0: v1 is older than v2
-   * @deprecated please use the {@link Version} class to read the version
-   * of the local member and compare versions for backwards compatibility 
-   * purposes. see also {@link SerializationVersions} for how to make backwards
-   * compatible messages.
-   */
-  public static int compareVersions(String v1, String v2) {
-    return compareVersions(v1, v2, true);
-  }
-  
-  /* 
-   * Compare version's sections major, minor, release one by one
-   * 
-   * @param v1 the first version
-   * @param v2 the second version
-   * @param includeBuild whether to also compare the build numbers
-   * 
-   * @return: >0: v1 is newer than v2
-   *          0: same
-   *          <0: v1 is older than v2
-   */
-  public static int compareVersions(String v1, String v2, boolean includeBuild) {
-    int major1, minor1, release1, build1;
-    int major2, minor2, release2, build2;
-    
-    if (v1 == null && v2 != null) return -1;
-    if (v1 != null && v2 == null) return 1;
-    if (v1 == null && v2 == null) return 0;
-    
-    major1 = getMajorVersion(v1);
-    major2 = getMajorVersion(v2);
-    
-    minor1 = getMinorVersion(v1);
-    minor2 = getMinorVersion(v2);
-    
-    release1 = getRelease(v1);
-    release2 = getRelease(v2);
 
-    if (major1 > major2) return 1;
-    if (major1 < major2) return -1;
-    
-    if (minor1 > minor2) return 1;
-    if (minor1 < minor2) return -1;
+      if (getProperty(BUILD_ID) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_ID, RESOURCE_NAME});
+      }
 
-    if (release1 > release2) return 1;
-    if (release1 < release2) return -1;
-    
-    if (includeBuild) {
-      build1 = getBuild(v1);
-      build2 = getBuild(v2);
-      
-      if (build1 > build2) return 1;
-      if (build1 < build2) return -1;
-    }
+      if (getProperty(BUILD_PLATFORM) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_PLATFORM, RESOURCE_NAME});
+      }
 
-    return 0;
+      if (getProperty(BUILD_JAVA_VERSION) == null) {
+        return LocalizedStrings.GemFireVersion_MISSING_PROPERTY_0_FROM_RESOURCE_COM_GEMSTONE_GEMFIRE_INTERNAL_1.toLocalizedString(new Object[] {BUILD_JAVA_VERSION, RESOURCE_NAME});
+      }
+      return null;
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
index e52950f..1757d5c 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/SystemAdmin.java
@@ -2080,16 +2080,8 @@ public class SystemAdmin {
           LocalizedStrings.SystemAdmin_GEMFIRE_PRODUCT_DIRECTORY_0
             .toLocalizedString(getProductDir()));
 
-        if (cmdLine.size() == 1 && "CREATE".equals(cmdLine.get(0))) {
-          GemFireVersion.createVersionFile();
+        GemFireVersion.print(System.out);
 
-        } else if (cmdLine.size() == 1 &&
-                   "FULL".equalsIgnoreCase(String.valueOf(cmdLine.get(0)))) {
-          GemFireVersion.print(System.out, true);
-
-        } else {
-          GemFireVersion.print(System.out, false);
-        }
       } else if (cmd.equalsIgnoreCase("help")) {
         if (cmdLine.size() > 1) {
           System.err.println( LocalizedStrings.SystemAdmin_ERROR_UNEXPECTED_COMMAND_LINE_ARGUMENTS_0.toLocalizedString(join(cmdLine)));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireVersionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireVersionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireVersionJUnitTest.java
index fc4ab1b..8369d1f 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireVersionJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/GemFireVersionJUnitTest.java
@@ -16,10 +16,7 @@
  */
 package com.gemstone.gemfire.internal;
 
-import static org.junit.Assert.*;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
+import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -40,67 +37,17 @@ public class GemFireVersionJUnitTest {
    */
   @Test
   public void testPrintInfo() {
-	  ByteArrayOutputStream baos = new ByteArrayOutputStream();
-	  PrintStream ps = new PrintStream(baos);
-    GemFireVersion.print(ps);
-    final String versionOutput = baos.toString();
+    final String versionOutput = GemFireVersion.asString();
     System.out.println(versionOutput);
-    assertTrue(versionOutput.contains("Java version:"));
-    assertTrue(versionOutput.contains("Native version:"));
-    assertTrue(versionOutput.contains("Source revision:"));
-    assertTrue(versionOutput.contains("Source repository:"));
-    assertTrue(versionOutput.contains("Running on:"));
-  }
-
-  @Test
-  public void testMajorMinorVersions() {
-    assertEquals(1, GemFireVersion.getMajorVersion("1.0.3"));
-    assertEquals(33, GemFireVersion.getMajorVersion("33.0.3"));
     
-    assertEquals(7, GemFireVersion.getMinorVersion("1.7.3"));
-    assertEquals(79, GemFireVersion.getMinorVersion("1.79.3"));
-    assertEquals(0, GemFireVersion.getMinorVersion("1.RC1"));
-    assertEquals(5, GemFireVersion.getMinorVersion("1.5Beta2"));
-
-    assertEquals(13, GemFireVersion.getBuild("7.0.2.13"));
-    assertEquals(0, GemFireVersion.getBuild("1.7.3"));
-    assertEquals(0, GemFireVersion.getBuild("1.79.3"));
-    assertEquals(0, GemFireVersion.getBuild("1.RC1"));
-    assertEquals(0, GemFireVersion.getBuild("1.5Beta2"));
-
-    assertTrue("7.0 should be < 7.0.2.14", GemFireVersion.compareVersions("7.0", "7.0.2.14", true) < 0);
-    assertTrue("7.0.0 should be < 7.0.2.14", GemFireVersion.compareVersions("7.0.0", "7.0.2.14", true) < 0);
-    assertTrue("7.0.2 should be < 7.0.2.14", GemFireVersion.compareVersions("7.0.2", "7.0.2.14", true) < 0);
-    assertTrue("7.0.3 should be > 7.0.2.14", GemFireVersion.compareVersions("7.0.3", "7.0.2.14", true) > 0);
-    assertTrue("7.0.1.15 should be < 7.0.2.14", GemFireVersion.compareVersions("7.0.1.15", "7.0.2.14", true) < 0);
-    assertTrue("7.0.2.13 should be < 7.0.2.14", GemFireVersion.compareVersions("7.0.2.13", "7.0.2.14", true) < 0);
-    assertTrue("7.0.2.14 should be > 7.0.2.13", GemFireVersion.compareVersions("7.0.2.14", "7.0.2.13", true) > 0);
-    assertTrue("7.0.2.14 should be == 7.0.2.14", GemFireVersion.compareVersions("7.0.2.14", "7.0.2.14", true) == 0);
-    assertTrue("7.0.2.12 should be < 7.0.2.13", GemFireVersion.compareVersions("7.0.2.12", "7.0.2.13", true) < 0);
-    assertTrue("7.0.2.13 should be == 7.0.2.13", GemFireVersion.compareVersions("7.0.2.13", "7.0.2.13", true) == 0);
-    assertTrue("7.0.2.15 should be > 7.0.2.13", GemFireVersion.compareVersions("7.0.2.14", "7.0.2.13", true) > 0);
-  }
-
-  @Test
-  public void testVersionClass() throws Exception {
-    compare(Version.GFE_662, Version.GFE_66);
-    compare(Version.GFE_6622, Version.GFE_662);
-    compare(Version.GFE_71, Version.GFE_70);
-    compare(Version.GFE_80, Version.GFE_70);
-    compare(Version.GFE_80, Version.GFE_71);
-    compare(Version.GFE_81, Version.GFE_70);
-    compare(Version.GFE_81, Version.GFE_71);
-    compare(Version.GFE_81, Version.GFE_80);
-  }
-  
-  private void compare(Version later, Version earlier) {
-    assertTrue(later.compareTo(earlier) > 0);
-    assertTrue(later.equals(later));
-    assertTrue(later.compareTo(later) == 0);
-    assertTrue(earlier.compareTo(later) < 0);
-
-    assertTrue(later.compareTo(earlier.ordinal()) > 0);
-    assertTrue(later.compareTo(later.ordinal()) == 0);
-    assertTrue(earlier.compareTo(later.ordinal()) < 0);
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.PRODUCT_NAME));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.GEMFIRE_VERSION));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.SOURCE_DATE));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.SOURCE_REVISION));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.SOURCE_REPOSITORY));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.BUILD_DATE));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.BUILD_ID));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.BUILD_PLATFORM));
+    assertTrue(versionOutput.contains(GemFireVersion.VersionDescription.BUILD_JAVA_VERSION));
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/geode-core/src/test/java/com/gemstone/gemfire/internal/VersionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/VersionJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/VersionJUnitTest.java
new file mode 100644
index 0000000..dcc7049
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/VersionJUnitTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.gemstone.gemfire.internal;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class VersionJUnitTest {
+  @Test
+  public void testVersionClass() throws Exception {
+    compare(Version.GFE_662, Version.GFE_66);
+    compare(Version.GFE_6622, Version.GFE_662);
+    compare(Version.GFE_71, Version.GFE_70);
+    compare(Version.GFE_80, Version.GFE_70);
+    compare(Version.GFE_80, Version.GFE_71);
+    compare(Version.GFE_81, Version.GFE_70);
+    compare(Version.GFE_81, Version.GFE_71);
+    compare(Version.GFE_81, Version.GFE_80);
+  }
+  
+  private void compare(Version later, Version earlier) {
+    assertTrue(later.compareTo(earlier) > 0);
+    assertTrue(later.equals(later));
+    assertTrue(later.compareTo(later) == 0);
+    assertTrue(earlier.compareTo(later) < 0);
+
+    assertTrue(later.compareTo(earlier.ordinal()) > 0);
+    assertTrue(later.compareTo(later.ordinal()) == 0);
+    assertTrue(earlier.compareTo(later.ordinal()) < 0);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/93985f96/gradle/utilities.gradle
----------------------------------------------------------------------
diff --git a/gradle/utilities.gradle b/gradle/utilities.gradle
index 5f597f6..d4d616f 100644
--- a/gradle/utilities.gradle
+++ b/gradle/utilities.gradle
@@ -14,6 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+buildscript {
+  repositories {
+    maven { url "https://plugins.gradle.org/m2/" }
+  }
+
+  dependencies {
+    classpath "org.ajoberstar:gradle-git:1.3.2"
+  }
+}
+
 allprojects {
   //These methods will be added to each individual project.
   //Use this for methods that access project variables (like project.name)
@@ -41,5 +51,38 @@ allprojects {
         signArchives.enabled = false
       }
     }
+
+    readScmInfo = {
+      try {
+        def git = org.ajoberstar.grgit.Grgit.open(currentDir: projectDir)
+        try {
+          return [
+            'Source-Repository': git.branch.getCurrent().name,
+            'Source-Revision'  : git.head().id,
+            'Source-Date'      : git.head().getDate().format('yyyy-MM-dd HH:mm:ss Z')
+          ] as Properties
+        } finally {
+          git.close()
+        }
+      } catch (IllegalArgumentException e) {
+        // if we're building from the source distribution, we don't have git so
+        // use cached info written during the assembly process
+        def buildInfo = file "$rootDir/.buildinfo"
+        if (buildInfo.exists()) {
+          def props = new Properties()
+          new FileInputStream(buildInfo).withStream { fis ->
+            props.load(fis)
+          }
+          return props
+        }
+
+        logger.warn( '***** Unable to find Git workspace. Using default version information *****' )
+        return [
+          'Source-Repository': 'UNKNOWN',
+          'Source-Revision'  : 'UNKNOWN',
+          'Source-Date'      : new Date().format('yyyy-MM-dd HH:mm:ss Z')
+        ] as Properties
+      }
+    }
   }
 }



[5/7] incubator-geode git commit: GEODE-1816: Workaround to clear statics in CacheCreationJUnitTest

Posted by je...@apache.org.
GEODE-1816: Workaround to clear statics in CacheCreationJUnitTest

Working around the fact that other tests are leaving static thread
locals set, causing this test to fail. The actual fix is to remove the
static thread locals from the product.


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

Branch: refs/heads/feature/GEODE-1817
Commit: 98531a16f8844a1028e2e6de293eb080d8ea7a1d
Parents: 8c85ef9
Author: Dan Smith <up...@apache.org>
Authored: Wed Aug 24 16:57:10 2016 -0700
Committer: Dan Smith <up...@apache.org>
Committed: Wed Aug 24 16:57:10 2016 -0700

----------------------------------------------------------------------
 .../gemstone/gemfire/internal/cache/CacheServerLauncher.java  | 7 +++++++
 .../internal/cache/xmlcache/CacheCreationJUnitTest.java       | 2 ++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98531a16/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
index 17875bf..fcb0876 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheServerLauncher.java
@@ -615,6 +615,13 @@ public class CacheServerLauncher  {
     return disableDefaultServer.get();
   }
 
+  public static void clearStatics() {
+    disableDefaultServer.set(null);
+    serverPort.set(null);
+    serverBindAddress.set(null);
+  }
+
+
   /**
    * The method that does the work of being a cache server.  It is
    * invoked in the VM spawned by the {@link #start} method.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/98531a16/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
index e99a04b..d081e82 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreationJUnitTest.java
@@ -35,6 +35,7 @@ import org.mockito.MockitoAnnotations;
 
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.internal.cache.CacheServerImpl;
+import com.gemstone.gemfire.internal.cache.CacheServerLauncher;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
@@ -47,6 +48,7 @@ public class CacheCreationJUnitTest {
   @Before
   public void setUp() {
     MockitoAnnotations.initMocks(this);
+    CacheServerLauncher.clearStatics();
   }
 
   @Test


[7/7] incubator-geode git commit: Merge branch 'develop' into feature/GEODE-1817

Posted by je...@apache.org.
Merge branch 'develop' into feature/GEODE-1817


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

Branch: refs/heads/feature/GEODE-1817
Commit: 67de9b94e5f1555669d3a5dcad226d92c41b09a8
Parents: 1cc5988 93985f9
Author: Jens Deppe <jd...@pivotal.io>
Authored: Thu Aug 25 11:26:40 2016 -0700
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Thu Aug 25 11:26:40 2016 -0700

----------------------------------------------------------------------
 build.gradle                                    |   1 -
 geode-core/build.gradle                         |  33 -
 .../distributed/internal/StartupMessage.java    |  14 -
 .../gemfire/internal/GemFireVersion.java        | 726 +++++--------------
 .../gemstone/gemfire/internal/SystemAdmin.java  |  10 +-
 .../internal/cache/CacheServerLauncher.java     |   7 +
 .../internal/cache/PartitionedRegion.java       |  13 +-
 .../distributed/DistributedSystemDUnitTest.java |   6 +-
 .../internal/GemFireVersionJUnitTest.java       |  75 +-
 .../gemfire/internal/VersionJUnitTest.java      |  50 ++
 .../cache/wan/AsyncEventQueueTestBase.java      |  55 ++
 .../asyncqueue/AsyncEventListenerDUnitTest.java |  29 +
 .../cache/xmlcache/CacheCreationJUnitTest.java  |   2 +
 .../security/ClientAuthenticationTestCase.java  |  33 +-
 .../lucene/LuceneQueriesPeerPRDUnitTest.java    |   5 +-
 .../LuceneQueriesPeerPRRedundancyDUnitTest.java |   5 +-
 gradle/utilities.gradle                         |  43 ++
 17 files changed, 404 insertions(+), 703 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/67de9b94/build.gradle
----------------------------------------------------------------------


[3/7] incubator-geode git commit: GEODE-1198 Now test make sure ports are available for port range

Posted by je...@apache.org.
GEODE-1198 Now test make sure ports are available for port range


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

Branch: refs/heads/feature/GEODE-1817
Commit: 8c85ef959458aaa91a925132a68e3ce06ec95f89
Parents: 7454c3f
Author: Hitesh Khamesra <hi...@yahoo.com>
Authored: Wed Aug 24 10:24:44 2016 -0700
Committer: Hitesh Khamesra <hi...@yahoo.com>
Committed: Wed Aug 24 10:26:51 2016 -0700

----------------------------------------------------------------------
 .../gemfire/distributed/DistributedSystemDUnitTest.java        | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/8c85ef95/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
index 1be3b9f..c6fa5a2 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/distributed/DistributedSystemDUnitTest.java
@@ -361,10 +361,10 @@ public class DistributedSystemDUnitTest extends JUnit4DistributedTestCase {
   public void testConflictingUDPPort() throws Exception {
     final Properties config = new Properties();
     final int mcastPort = AvailablePort.getRandomAvailablePort(AvailablePort.MULTICAST);
-    final int[] socketPorts = AvailablePortHelper.getRandomAvailableTCPPorts(2, true);
-    final int unicastPort = socketPorts[0];
+    final int[] socketPorts = AvailablePortHelper.getRandomAvailableTCPPorts(1, true);
+    final int unicastPort = getPortRange(3);
     config.setProperty(MCAST_PORT, String.valueOf(mcastPort));
-    config.setProperty(START_LOCATOR, "localhost[" + socketPorts[1] + "]");
+    config.setProperty(START_LOCATOR, "localhost[" + socketPorts[0] + "]");
     config.setProperty(MEMBERSHIP_PORT_RANGE,
         ""+unicastPort+"-"+(unicastPort+2));
     InternalDistributedSystem system = (InternalDistributedSystem)DistributedSystem.connect(config);