geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject geode git commit: GEODE-958: AgentUtilJunitTest doesn't require env var.
Date Tue, 10 Jan 2017 18:24:13 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 05d4e8fe8 -> a10a02693


GEODE-958: AgentUtilJunitTest doesn't require env var.

- AgentUtilJunitTest will now set the gemfire.home system property for AgentUtil to find the
pulse war
if no GEMFIRE enironment variable is set.


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

Branch: refs/heads/develop
Commit: a10a02693e7dda2905650a170141b5d73151e193
Parents: 05d4e8f
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Mon Jan 9 10:45:29 2017 -0800
Committer: Jinmei Liao <jiliao@pivotal.io>
Committed: Tue Jan 10 10:24:01 2017 -0800

----------------------------------------------------------------------
 .../geode/management/internal/AgentUtilJUnitTest.java | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a10a0269/geode-assembly/src/test/java/org/apache/geode/management/internal/AgentUtilJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/AgentUtilJUnitTest.java
b/geode-assembly/src/test/java/org/apache/geode/management/internal/AgentUtilJUnitTest.java
index 1a20655..33e274e 100644
--- a/geode-assembly/src/test/java/org/apache/geode/management/internal/AgentUtilJUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/AgentUtilJUnitTest.java
@@ -17,19 +17,33 @@ package org.apache.geode.management.internal;
 import org.apache.geode.internal.GemFireVersion;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 
 import static org.junit.Assert.assertNotNull;
 
+import java.io.File;
+import java.nio.file.Path;
+
 @Category(IntegrationTest.class)
 public class AgentUtilJUnitTest {
 
   private AgentUtil agentUtil;
   private String version;
 
+  @Rule
+  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
+
   @Before
   public void setUp() {
+    // GEODE-958: We need to set gemfire.home to tell AgentUtil where to find wars in case
the env
+    // variable GEMFIRE is not set
+    Path installDir = new File(".").getAbsoluteFile().toPath().resolve("build").resolve("install")
+        .resolve("apache-geode");
+    System.setProperty("gemfire.home", installDir.toString());
+
     version = GemFireVersion.getGemFireVersion();
     agentUtil = new AgentUtil(version);
   }


Mime
View raw message