geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jensde...@apache.org
Subject [geode] branch develop updated: GEODE-4097: Adding a test for this change (#1211)
Date Sat, 30 Dec 2017 00:06:35 GMT
This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new b100f08  GEODE-4097: Adding a test for this change (#1211)
b100f08 is described below

commit b100f0827a1997cdbf4295fc09269125ec827832
Author: Jens Deppe <jdeppe@pivotal.io>
AuthorDate: Fri Dec 29 16:06:29 2017 -0800

    GEODE-4097: Adding a test for this change (#1211)
---
 .../internal/cli/commands/StartMemberUtilsTest.java  | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/StartMemberUtilsTest.java
b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/StartMemberUtilsTest.java
index d84f788..1fea694 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/StartMemberUtilsTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/StartMemberUtilsTest.java
@@ -28,9 +28,11 @@ import java.nio.file.Paths;
 import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TemporaryFolder;
 
+import org.apache.geode.internal.GemFireVersion;
 import org.apache.geode.internal.util.IOUtils;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 
@@ -40,6 +42,9 @@ public class StartMemberUtilsTest {
   @Rule
   public TemporaryFolder temporaryFolder = new TemporaryFolder();
 
+  @Rule
+  public RestoreSystemProperties restorer = new RestoreSystemProperties();
+
   @Test
   public void workingDirDefaultsToMemberName() {
     String workingDir = StartMemberUtils.resolveWorkingDir(null, "server1");
@@ -81,6 +86,21 @@ public class StartMemberUtilsTest {
     assertEquals(expectedPid, actualPid);
   }
 
+  @Test
+  public void testGeodeOnClasspathIsFirst() {
+    String currentClasspath = System.getProperty("java.class.path");
+    String customGeodeCore = "/custom/geode-core-" + GemFireVersion.getGemFireVersion() +
".jar";
+    System.setProperty("java.class.path", currentClasspath + ":" + customGeodeCore);
+
+    String[] otherJars = new String[] {"/other/one.jar", "/other/two.jar"};
+
+    String gemfireClasspath = StartMemberUtils.toClasspath(true, otherJars);
+    assertThat(gemfireClasspath).startsWith(customGeodeCore);
+
+    gemfireClasspath = StartMemberUtils.toClasspath(false, otherJars);
+    assertThat(gemfireClasspath).startsWith(customGeodeCore);
+  }
+
   private void writePid(final File pidFile, final int pid) throws IOException {
     final FileWriter fileWriter = new FileWriter(pidFile, false);
     fileWriter.write(String.valueOf(pid));

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message