jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1519535 - in /jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system: NativeCommand.java SystemSampler.java
Date Tue, 03 Sep 2013 00:46:24 GMT
Author: sebb
Date: Tue Sep  3 00:46:23 2013
New Revision: 1519535

URL: http://svn.apache.org/r1519535
Log:
Oops, fix compilation failures caused by changes to SystemCommand

Modified:
    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java
    jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java

Modified: jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java?rev=1519535&r1=1519534&r2=1519535&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java
(original)
+++ jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/NativeCommand.java
Tue Sep  3 00:46:23 2013
@@ -19,6 +19,7 @@
 package org.apache.jmeter.protocol.system;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Map;
 
 /**
@@ -43,8 +44,9 @@ public class NativeCommand extends  org.
      * @param stdin File name that will contain data to be input to process
      * @param stdout File name that will contain out stream
      * @param stderr File name that will contain err stream
+     * @throws IOException if any of the files are not accessible
      */
-    public NativeCommand(File directory, Map<String, String> env, String stdin, String
stdout, String stderr) {
+    public NativeCommand(File directory, Map<String, String> env, String stdin, String
stdout, String stderr) throws IOException {
         super(directory, 0L, POLL_INTERVAL, env, stdin, stdout, stderr);
     }
 

Modified: jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java?rev=1519535&r1=1519534&r2=1519535&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
(original)
+++ jmeter/trunk/src/protocol/native/org/apache/jmeter/protocol/system/SystemSampler.java
Tue Sep  3 00:46:23 2013
@@ -149,10 +149,10 @@ public class SystemSampler extends Abstr
         results.setSamplerData("Working Directory:"+directory.getAbsolutePath()+
                 "\nEnvironment:"+env+
                 "\nExecuting:" + cmdLine.toString());
-        
-        SystemCommand nativeCommand = new SystemCommand(directory, getTimeout(), POLL_INTERVAL,
env, getStdin(), getStdout(), getStderr());
-        
+
+        SystemCommand nativeCommand = null;
         try {
+            nativeCommand = new SystemCommand(directory, getTimeout(), POLL_INTERVAL, env,
getStdin(), getStdout(), getStderr());
             results.sampleStart();
             int returnCode = nativeCommand.run(cmds);
             results.sampleEnd();
@@ -181,7 +181,9 @@ public class SystemSampler extends Abstr
             results.setResponseMessage("System Sampler Interupted whilst executing System
Call: " + ie);
         }
 
-        results.setResponseData(nativeCommand.getOutResult().getBytes()); // default charset
is deliberate here
+        if (nativeCommand != null) {
+            results.setResponseData(nativeCommand.getOutResult().getBytes()); // default
charset is deliberate here
+        }
             
         return results;
     }



Mime
View raw message