You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2012/09/09 22:43:33 UTC

svn commit: r1382575 - in /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http: proxy/Proxy.java sampler/SoapSampler.java sampler/WebServiceSampler.java

Author: pmouawad
Date: Sun Sep  9 20:43:33 2012
New Revision: 1382575

URL: http://svn.apache.org/viewvc?rev=1382575&view=rev
Log:
Use BufferedOutputStream

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java?rev=1382575&r1=1382574&r2=1382575&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/Proxy.java Sun Sep  9 20:43:33 2012
@@ -406,7 +406,7 @@ public class Proxy extends Thread {
         final String certPath = certFile.getAbsolutePath();
         if (certFile.exists() && certFile.canRead()) {
             try {
-                in = new FileInputStream(certFile);
+                in = new BufferedInputStream(new FileInputStream(certFile));
                 log.info("Opened Keystore file: "+certPath);
             } catch (FileNotFoundException e) {
                 log.error("No server cert file found: "+certPath, e);

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java?rev=1382575&r1=1382574&r2=1382575&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/SoapSampler.java Sun Sep  9 20:43:33 2012
@@ -18,6 +18,7 @@
 
 package org.apache.jmeter.protocol.http.sampler;
 
+import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
@@ -180,7 +181,7 @@ public class SoapSampler extends HTTPSam
                 public void writeRequest(OutputStream out) throws IOException {
                     InputStream in = null;
                     try{
-                        in = new FileInputStream(xmlFile);
+                        in = new BufferedInputStream(new FileInputStream(xmlFile));
                         IOUtils.copy(in, out);
                         out.flush();
                     } finally {

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java?rev=1382575&r1=1382574&r2=1382575&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/WebServiceSampler.java Sun Sep  9 20:43:33 2012
@@ -18,10 +18,12 @@
 
 package org.apache.jmeter.protocol.http.sampler;
 
+import java.io.BufferedInputStream;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.net.MalformedURLException;
@@ -42,6 +44,7 @@ import org.apache.jmeter.samplers.Sample
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.io.TextFile;
 import org.apache.jorphan.logging.LoggingManager;
+import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 import org.apache.soap.Envelope;
 import org.apache.soap.SOAPException;
@@ -416,12 +419,12 @@ public class WebServiceSampler extends H
                 TextFile tfile = new TextFile(file);
                 fileContents = tfile.getText();
             }
-            FileInputStream fileInputStream = null;
+            InputStream fileInputStream = null;
             try {
-                fileInputStream = new FileInputStream(file);
+                fileInputStream = new BufferedInputStream(new FileInputStream(file));
                 doc = XDB.parse(fileInputStream);
             } finally {
-                IOUtils.closeQuietly(fileInputStream);
+                JOrphanUtils.closeQuietly(fileInputStream);
             }
         } else {// must be a "here" document
             fileContents = getXmlData();