geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From upthewatersp...@apache.org
Subject geode git commit: GEODE-3329: Changed logging output of modify_war script
Date Thu, 17 Aug 2017 21:11:18 GMT
Repository: geode
Updated Branches:
  refs/heads/develop 7cbbf67f3 -> 04c446aef


GEODE-3329: Changed logging output of modify_war script

Changed the modify_war script so that its output and error streams write to a log file instead
of to standard out.


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

Branch: refs/heads/develop
Commit: 04c446aef2b12befe91a31a69ad8c4f2116d5c26
Parents: 7cbbf67
Author: David Anuta <david.r.anuta@gmail.com>
Authored: Fri Jul 28 10:49:36 2017 -0700
Committer: Dan Smith <upthewaterspout@apache.org>
Committed: Thu Aug 17 14:03:15 2017 -0700

----------------------------------------------------------------------
 .../geode/session/tests/GenericAppServerContainer.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/04c446ae/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerContainer.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerContainer.java
b/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerContainer.java
index 0694e6f..7a2cfaf 100644
--- a/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerContainer.java
+++ b/geode-assembly/src/test/java/org/apache/geode/session/tests/GenericAppServerContainer.java
@@ -39,6 +39,7 @@ import org.junit.Assume;
  */
 public class GenericAppServerContainer extends ServerContainer {
   private final File modifyWarScript;
+  private final File modifyWarScriptLog;
 
   private static final String DEFAULT_GENERIC_APPSERVER_WAR_DIR = "/tmp/cargo_wars/";
 
@@ -58,6 +59,10 @@ public class GenericAppServerContainer extends ServerContainer {
     modifyWarScript = new File(install.getModulePath() + "/bin/modify_war");
     modifyWarScript.setExecutable(true);
 
+    // Setup modify_war script logging file
+    modifyWarScriptLog = new File(logDir + "/warScript.log");
+    modifyWarScriptLog.createNewFile();
+
     // Ignore tests that are running on windows, since they can't run the modify war script
     Assume.assumeFalse(System.getProperty("os.name").toLowerCase().contains("win"));
 
@@ -116,7 +121,7 @@ public class GenericAppServerContainer extends ServerContainer {
    * {@link #buildCommand()}
    *
    * The modified WAR file is sent to {@link #warFile}.
-   * 
+   *
    * @throws IOException If the command executed returns with a non-zero exit code.
    */
   private void modifyWarFile() throws IOException, InterruptedException {
@@ -126,6 +131,9 @@ public class GenericAppServerContainer extends ServerContainer {
     builder.inheritIO();
     // Setup the environment builder with the command
     builder.command(buildCommand());
+    // Redirect the command line logging to a file
+    builder.redirectError(modifyWarScriptLog);
+    builder.redirectOutput(modifyWarScriptLog);
     logger.info("Running command: " + String.join(" ", builder.command()));
 
     // Run the command


Mime
View raw message