geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [10/37] incubator-geode git commit: GEODE-214: improve Azul support
Date Tue, 01 Sep 2015 16:48:48 GMT
GEODE-214: improve Azul support

- isTenured now looks for "GenPauseless Old Gen" for azul.
- Azul jvm version no longer logged as unsupported.
- Fatal log message about jvm version not being supported
  is now a warning since we continue to run.
- Fixed a bug in ReflectionSingleObjectSizer in how it calculated
  the size of a field. It was calling Field.getClass instead of Field.getType.
  Field.getClass always returns an instance of Field.class which the sizer
  always says is an objref size. getType will return a primitive class
  for primitive fields which is what we want.
- Improved ObjectSizerJUnitTest.
- The object header size and reference size are now correctly computed
  for azul.
- Added some java 8 support to the ObjectSizer.
- Fix tests that are unintentionally spawning processes that use the
  default mcast-port. This fixes intermittent failures caused by finding
  another member of the wrong GemFire version.


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

Branch: refs/heads/feature/GEODE-77
Commit: 57c5247df2401a2149104e0d7f65c4aea0993008
Parents: abb11d3
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Tue Jun 2 10:45:30 2015 -0700
Committer: Kirk Lund <klund@pivotal.io>
Committed: Wed Aug 19 16:08:04 2015 -0700

----------------------------------------------------------------------
 .../gemfire/internal/SharedLibrary.java         | 20 ++++++-
 .../cache/MinimumSystemRequirements.java        |  4 +-
 .../cache/control/HeapMemoryMonitor.java        |  1 +
 .../gemfire/internal/lang/SystemUtils.java      | 35 ++++++++++--
 .../size/ReflectionSingleObjectSizer.java       |  4 +-
 .../LocatorLauncherRemoteFileJUnitTest.java     |  8 +--
 .../LocatorLauncherRemoteJUnitTest.java         | 57 ++++++++------------
 .../ServerLauncherLocalJUnitTest.java           | 47 ++++++++++------
 .../ServerLauncherRemoteFileJUnitTest.java      |  2 -
 .../ServerLauncherWithSpringJUnitTest.java      |  2 +
 .../internal/size/ObjectSizerJUnitTest.java     | 14 ++++-
 11 files changed, 126 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SharedLibrary.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SharedLibrary.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SharedLibrary.java
index 59ab34e..fd923ad 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SharedLibrary.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/SharedLibrary.java
@@ -8,6 +8,7 @@
 package com.gemstone.gemfire.internal;
 
 import com.gemstone.gemfire.InternalGemFireError;
+import com.gemstone.gemfire.internal.lang.SystemUtils;
 import com.gemstone.gemfire.pdx.internal.unsafe.UnsafeWrapper;
 
 import java.io.File;
@@ -68,9 +69,19 @@ public class SharedLibrary {
       int scaleIndex = 0;
       int tmpReferenceSize = 0;
       int tmpObjectHeaderSize = 0;
+      if (SystemUtils.isAzulJVM()) {
+        tmpObjectHeaderSize = 8;
+        tmpReferenceSize = 8;
+      } else {
       if (unsafe != null) {
         // Use unsafe to figure out the size of an object reference since we might
         // be using compressed oops.
+        // Note: as of java 8 compressed oops do not imply a compressed object header.
+        // The object header is determined by UseCompressedClassPointers.
+        // UseCompressedClassPointers requires UseCompressedOops
+        // but UseCompressedOops does not require UseCompressedClassPointers.
+        // But it seems unlikely that someone would compress their oops
+        // not their class pointers. 
         scaleIndex = unsafe.arrayScaleIndex(Object[].class);
         if (scaleIndex == 4) {
           // compressed oops
@@ -85,8 +96,12 @@ public class SharedLibrary {
         }
       }
       if (scaleIndex == 0) {
-        // If our heap is > 32G then assume large oops. Otherwise assume compressed oops.
-        if (Runtime.getRuntime().maxMemory() > (32L*1024*1024*1024)) {
+        // If our heap is > 32G (64G on java 8) then assume large oops. Otherwise assume
compressed oops.
+        long SMALL_OOP_BOUNDARY = 32L;
+        if (SystemUtils.isJavaVersionAtLeast("1.8")) {
+          SMALL_OOP_BOUNDARY = 64L;
+        }
+        if (Runtime.getRuntime().maxMemory() > (SMALL_OOP_BOUNDARY*1024*1024*1024)) {
           tmpReferenceSize = 8;
           tmpObjectHeaderSize = 16;
         } else {
@@ -94,6 +109,7 @@ public class SharedLibrary {
           tmpObjectHeaderSize = 12;
         }
       }
+      }
       referenceSize = tmpReferenceSize;
       objectHeaderSize = tmpObjectHeaderSize;
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MinimumSystemRequirements.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MinimumSystemRequirements.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MinimumSystemRequirements.java
index d0a346f..12f6177 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MinimumSystemRequirements.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/MinimumSystemRequirements.java
@@ -58,7 +58,7 @@ public final class MinimumSystemRequirements {
     minimumSystemRequirementsMet &= checkJavaVersion();
 
     if (!minimumSystemRequirementsMet) {
-      logger.fatal(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_NOT_MET));
+      logger.warn(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_NOT_MET));
     }
 
     return minimumSystemRequirementsMet;
@@ -76,7 +76,7 @@ public final class MinimumSystemRequirements {
       return true;
     }
 
-    logger.fatal(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_JAVA_VERSION,
JAVA_VERSION));
+    logger.warn(LocalizedMessage.create(LocalizedStrings.MinimumSystemRequirements_JAVA_VERSION,
JAVA_VERSION));
     return false;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
index fda337b..d84a367 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
@@ -181,6 +181,7 @@ public class HeapMemoryMonitor implements NotificationListener, ResourceMonitor
         || name.equals("Old Space")       // BEA JRockit 1.5, 1.6 GC
         || name.equals("Tenured Gen")     // Hitachi 1.5 GC
         || name.equals("Java heap")       // IBM 1.5, 1.6 GC
+        || name.equals("GenPauseless Old Gen") // azul C4/GPGC collector
         
         // Allow an unknown pool name to monitor
         || (HEAP_POOL != null && name.equals(HEAP_POOL));

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/main/java/com/gemstone/gemfire/internal/lang/SystemUtils.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/lang/SystemUtils.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/lang/SystemUtils.java
index f4f111a..9912398 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/lang/SystemUtils.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/lang/SystemUtils.java
@@ -36,6 +36,7 @@ public class SystemUtils {
   public static final String APPLE_JVM_VENDOR_NAME = "Apple";
   public static final String IBM_JVM_NAME = "IBM";
   public static final String ORACLE_JVM_VENDOR_NAME = "Oracle";
+  public static final String AZUL_JVM_VENDOR_NAME = "Azul";
 
   // Operating System Names
   public static final String LINUX_OS_NAME = "Linux";
@@ -45,13 +46,30 @@ public class SystemUtils {
   /**
    * Utility method to determine whether the installed Java Runtime Environment (JRE) is
minimally at the specified,
    * expected version.  Typically, Java versions are of the form "1.6.0_31"...
+   * In the Azul JVM java.version does not have the "_NN" suffix. Instead it has the azul
product version
+   * as the suffix like so "-zing_NN.NN.N.N". So on azul we instead use the "java.specification.version"
sys prop
+   * and only compare the major and minor version numbers. All the stuff after the second
"." in expectedVersion
+   * is ignored.
    * 
-   * @param expectedVersion an int value specifying the minimum expected version of the Java
Runtime.
+   * @param expectedVersion an string value specifying the minimum expected version of the
Java Runtime.
    * @return a boolean value indicating if the Java Runtime meets the expected version requirement.
    * @see java.lang.System#getProperty(String) with "java.version".
    */
-  public static boolean isJavaVersionAtLeast(final String expectedVersion) {
-    String actualVersionDigits = StringUtils.getDigitsOnly(System.getProperty("java.version"));
+  public static boolean isJavaVersionAtLeast(String expectedVersion) {
+    String actualVersionDigits;
+    if (isAzulJVM()) {
+      actualVersionDigits = StringUtils.getDigitsOnly(System.getProperty("java.specification.version"));
+      int dotIdx = expectedVersion.indexOf('.');
+      if (dotIdx != -1) {
+        dotIdx = expectedVersion.indexOf('.', dotIdx+1);
+        if (dotIdx != -1) {
+          // strip off everything after the second dot.
+          expectedVersion = expectedVersion.substring(0, dotIdx);
+        }
+      }
+    } else {
+      actualVersionDigits = StringUtils.getDigitsOnly(System.getProperty("java.version"));
+    }
 
     String expectedVersionDigits = StringUtils.padEnding(StringUtils.getDigitsOnly(expectedVersion),
'0',
       actualVersionDigits.length());
@@ -86,6 +104,17 @@ public class SystemUtils {
     return isJvmVendor(ORACLE_JVM_VENDOR_NAME);
   }
 
+  /**
+   * Utility method to determine whether the Java application process is executing on the
Azul JVM.
+   *
+   * @return a boolean value indicating whether the Java application process is executing
and running 
+   * on the Azul JVM.
+   * @see #isJvmVendor(String)
+   */
+  public static boolean isAzulJVM() {
+    return isJvmVendor(AZUL_JVM_VENDOR_NAME);
+  }
+  
   // @see java.lang.System#getProperty(String) with 'java.vm.vendor'.
   private static boolean isJvmVendor(final String expectedJvmVendorName) {
     String jvmVendor = System.getProperty("java.vm.vendor");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/main/java/com/gemstone/gemfire/internal/size/ReflectionSingleObjectSizer.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/size/ReflectionSingleObjectSizer.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/size/ReflectionSingleObjectSizer.java
index 47b73a8..d3f3b24 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/size/ReflectionSingleObjectSizer.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/size/ReflectionSingleObjectSizer.java
@@ -109,7 +109,7 @@ public class ReflectionSingleObjectSizer implements SingleObjectSizer
{
       } while (clazz != null);
 
       if (lastField != null) {
-        size = lastFieldOffset + sizeType(lastField.getClass());
+        size = lastFieldOffset + sizeType(lastField.getType());
       } else {
         // class with no fields
         size = OBJECT_SIZE;
@@ -123,7 +123,7 @@ public class ReflectionSingleObjectSizer implements SingleObjectSizer
{
         Field[] fields = clazz.getDeclaredFields();
         for(Field field: fields) {
           if(!Modifier.isStatic(field.getModifiers())) {
-            size += sizeType(field.getClass());
+            size += sizeType(field.getType());
           }
         }
         clazz = clazz.getSuperclass();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteFileJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteFileJUnitTest.java
index b481461..0be4a8e 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteFileJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteFileJUnitTest.java
@@ -56,9 +56,7 @@ public class LocatorLauncherRemoteFileJUnitTest extends LocatorLauncherRemoteJUn
    * Override because FileProcessController cannot request status with PID
    */
   public void testStatusUsingPid() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -135,9 +133,7 @@ public class LocatorLauncherRemoteFileJUnitTest extends LocatorLauncherRemoteJUn
    * Override because FileProcessController cannot request stop with PID
    */
   public void testStopUsingPid() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
index 25aa23c..8977e47 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/LocatorLauncherRemoteJUnitTest.java
@@ -86,8 +86,13 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     assertTrue(this.temporaryFolder.getRoot().isDirectory() && this.temporaryFolder.getRoot().canWrite());
 
     // launch LocatorLauncherForkingProcess which then launches the GemFire Locator
-    List<String> command = new ArrayList<String>();
+    final List<String> jvmArguments = getJvmArguments();
+    
+    final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
+    for (String jvmArgument : jvmArguments) {
+      command.add(jvmArgument);
+    }
     command.add("-cp");
     command.add(System.getProperty("java.class.path"));
     command.add(LocatorLauncherRemoteDUnitTest.class.getName().concat("$").concat(LocatorLauncherForkingProcess.class.getSimpleName()));
@@ -129,9 +134,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
   @Test
   public void testStartCreatesPidFile() throws Throwable {
     // build and start the locator
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -200,9 +203,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     assertTrue(this.statusFile.exists());
     
     // build and start the locator
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -264,9 +265,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     writePid(this.pidFile, Integer.MAX_VALUE);
 
     // build and start the locator
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -323,9 +322,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     writePid(this.pidFile, otherPid);
 
     // build and start the locator
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -380,9 +377,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
   public void testStartUsingPortInUseFails() throws Throwable {
     this.socket = SocketCreator.getDefaultInstance().createServerSocket(this.locatorPort,
50, null, -1);
     
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -456,10 +451,8 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     assertFalse(this.socket.isClosed());
     
     // launch locator
-    final List<String> jvmArguments = new ArrayList<String>();
+    final List<String> jvmArguments = getJvmArguments();
     jvmArguments.add("-D" + DistributionLocator.TEST_OVERRIDE_DEFAULT_PORT_PROPERTY + "="
+ this.locatorPort);
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -533,9 +526,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     writePid(this.pidFile, realPid);
     
     // build and start the locator
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -606,9 +597,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
 
   @Test
   public void testStatusUsingPid() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -690,9 +679,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
   
   @Test
   public void testStatusUsingWorkingDirectory() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -817,9 +804,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
   
   @Test
   public void testStopUsingPid() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -893,9 +878,7 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
   
   @Test
   public void testStopUsingWorkingDirectory() throws Throwable {
-    final List<String> jvmArguments = new ArrayList<String>();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
-    jvmArguments.add("-Dgemfire.log-level=config");
+    final List<String> jvmArguments = getJvmArguments();
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -948,6 +931,12 @@ public class LocatorLauncherRemoteJUnitTest extends AbstractLocatorLauncherJUnit
     }
   }
 
+  public static List<String> getJvmArguments() {
+    final List<String> jvmArguments = new ArrayList<String>();
+    jvmArguments.add("-Dgemfire.log-level=config");
+    return jvmArguments;
+  }
+  
   /**
    * Used only by {@link LocatorLauncherRemoteJUnitTest#testRunningLocatorOutlivesForkingProcess}
    */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalJUnitTest.java
index 1addfc8..44849f8 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherLocalJUnitTest.java
@@ -121,7 +121,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     this.launcher = builder.build();
     assertNotNull(this.launcher);
@@ -173,7 +174,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -228,7 +230,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -273,7 +276,9 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
+    
     this.launcher = builder.build();
 
     // wait for server to start
@@ -328,7 +333,9 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
+
     this.launcher = builder.build();
 
     // wait for server to start
@@ -387,7 +394,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setForce(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertTrue(builder.getForce());
     this.launcher = builder.build();
@@ -466,7 +474,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
         .setServerPort(freeTCPPorts[1])
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     this.launcher = builder.build();
     this.launcher.start();
@@ -535,7 +544,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
         .setServerPort(this.serverPort)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     this.launcher = builder.build();
     this.launcher.start();
@@ -585,7 +595,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
     final Builder builder = new Builder()
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     this.launcher = builder.build();
     
@@ -663,7 +674,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -741,7 +753,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
         .setServerPort(freeTCPPort)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     this.launcher = builder.build();
     
@@ -801,7 +814,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
     
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -865,7 +879,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
     
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -930,7 +945,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertFalse(builder.getForce());
     this.launcher = builder.build();
@@ -983,7 +999,8 @@ public class ServerLauncherLocalJUnitTest extends AbstractServerLauncherJUnitTes
         .setDisableDefaultServer(true)
         .setMemberName(getUniqueName())
         .setRedirectOutput(true)
-        .set(DistributionConfig.LOG_LEVEL_NAME, "config");
+        .set(DistributionConfig.LOG_LEVEL_NAME, "config")
+        .set(DistributionConfig.MCAST_PORT_NAME, "0");
 
     assertFalse(builder.getForce());
     this.launcher = builder.build();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteFileJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteFileJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteFileJUnitTest.java
index 3b321ed..11cab25 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteFileJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherRemoteFileJUnitTest.java
@@ -57,7 +57,6 @@ public class ServerLauncherRemoteFileJUnitTest extends ServerLauncherRemoteJUnit
    */
   public void testStatusUsingPid() throws Throwable {
     final List<String> jvmArguments = getJvmArguments();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());
@@ -135,7 +134,6 @@ public class ServerLauncherRemoteFileJUnitTest extends ServerLauncherRemoteJUnit
    */
   public void testStopUsingPid() throws Throwable {
     final List<String> jvmArguments = getJvmArguments();
-    jvmArguments.add("-D" + getUniqueName() + "=true");
     
     final List<String> command = new ArrayList<String>();
     command.add(new File(new File(System.getProperty("java.home"), "bin"), "java").getCanonicalPath());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
index dbefdbd..4472ab6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/ServerLauncherWithSpringJUnitTest.java
@@ -15,6 +15,7 @@ import org.springframework.data.gemfire.support.SpringContextBootstrappingInitia
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.distributed.AbstractLauncher.Status;
 import com.gemstone.gemfire.distributed.ServerLauncher.Builder;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.process.ProcessType;
 import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 
@@ -47,6 +48,7 @@ public class ServerLauncherWithSpringJUnitTest extends AbstractServerLauncherJUn
       .setForce(true)
       .setMemberName(getUniqueName())
       .setSpringXmlLocation("spring/spring-gemfire-context.xml")
+      .set(DistributionConfig.MCAST_PORT_NAME, "0")
       .build();
 
     assertNotNull(this.launcher);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/57c5247d/gemfire-core/src/test/java/com/gemstone/gemfire/internal/size/ObjectSizerJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/size/ObjectSizerJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/size/ObjectSizerJUnitTest.java
index 3d6a731..7c63d90 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/size/ObjectSizerJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/size/ObjectSizerJUnitTest.java
@@ -27,8 +27,7 @@ public class ObjectSizerJUnitTest extends TestCase {
   }
 
   public void test() throws IllegalArgumentException, IllegalAccessException {
-    long size = ObjectGraphSizer.size(new Object());
-    assertEquals(OBJECT_SIZE, 8, size);
+    assertEquals(roundup(OBJECT_SIZE), ObjectGraphSizer.size(new Object()));
     
     assertEquals(roundup(OBJECT_SIZE + 4), ObjectGraphSizer.size(new TestObject1()));
     assertEquals(roundup(OBJECT_SIZE + 4), ObjectGraphSizer.size(new TestObject2()));
@@ -37,6 +36,7 @@ public class ObjectSizerJUnitTest extends TestCase {
     assertEquals(roundup(OBJECT_SIZE + REFERENCE_SIZE), ObjectGraphSizer.size(new TestObject4()));
     assertEquals(roundup(OBJECT_SIZE + REFERENCE_SIZE) + roundup(OBJECT_SIZE + 4), ObjectGraphSizer.size(new
TestObject5()));
     assertEquals(roundup(OBJECT_SIZE + REFERENCE_SIZE) + roundup(OBJECT_SIZE + REFERENCE_SIZE
* 4 + 4) + roundup(OBJECT_SIZE + 4), ObjectGraphSizer.size(new TestObject6()));
+    assertEquals(roundup(OBJECT_SIZE + 7), ObjectGraphSizer.size(new TestObject7()));
   }
   
   private static class TestObject1 {
@@ -67,4 +67,14 @@ public class ObjectSizerJUnitTest extends TestCase {
       array[2] = array[3];
     }
   }
+  
+  private static class TestObject7 {
+    byte b1;
+    byte b2;
+    byte b3;
+    byte b4;
+    byte b5;
+    byte b6;
+    byte b7;
+  }
 }
\ No newline at end of file


Mime
View raw message