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 2017/12/30 00:06:35 UTC
[geode] branch develop updated: GEODE-4097: Adding a test for this
change (#1211)
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 <jd...@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" <co...@geode.apache.org>'].