]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/SystemCall.java
Introduce filtered resources
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / tasks / SystemCall.java
index 95154ef0f6fcccdf312b1dc910b6052600ba97d5..2e5b14116a6a7675e69f72cacfa7a198765c84d5 100644 (file)
@@ -202,6 +202,15 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable {
 
        }
 
+       public String asCommand() {
+               return createCommandLine().toString();
+       }
+
+       @Override
+       public String toString() {
+               return asCommand();
+       }
+
        /**
         * Build a command line based on the properties. Can be overridden by
         * specific command wrappers.
@@ -281,13 +290,15 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable {
                                stdOutputStream != null ? stdOutputStream
                                                : new LogOutputStream() {
                                                        protected void processLine(String line, int level) {
-                                                               log(stdOutLogLevel, line);
+                                                               if (line != null && !line.trim().equals(""))
+                                                                       log(stdOutLogLevel, line);
                                                                if (stdOutWriter != null)
                                                                        appendLineToFile(stdOutWriter, line);
                                                        }
                                                }, new LogOutputStream() {
                                        protected void processLine(String line, int level) {
-                                               log(stdErrLogLevel, line);
+                                               if (line != null && !line.trim().equals(""))
+                                                       log(stdErrLogLevel, line);
                                                if (stdErrWriter != null)
                                                        appendLineToFile(stdErrWriter, line);
                                        }
@@ -301,20 +312,19 @@ public class SystemCall extends TreeSRelatedHelper implements Runnable {
                return new ExecuteResultHandler() {
 
                        public void onProcessComplete(int exitValue) {
+                               String msg = "System call '" + commandLine
+                                               + "' properly completed.";
                                if (log.isDebugEnabled())
-                                       log
-                                                       .debug("Process " + commandLine
-                                                                       + " properly completed.");
+                                       log.debug(msg);
                                if (testResult != null) {
                                        forwardPath(testResult, null);
                                        testResult.addResultPart(new SimpleResultPart(
-                                                       TestStatus.PASSED, "Process " + commandLine
-                                                                       + " properly completed."));
+                                                       TestStatus.PASSED, msg));
                                }
                        }
 
                        public void onProcessFailed(ExecuteException e) {
-                               String msg = "Process " + commandLine + " failed.";
+                               String msg = "System call '" + commandLine + "' failed.";
                                if (testResult != null) {
                                        forwardPath(testResult, null);
                                        testResult.addResultPart(new SimpleResultPart(