jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1380323 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java
Date Mon, 03 Sep 2012 19:48:00 GMT
Author: pmouawad
Date: Mon Sep  3 19:47:59 2012
New Revision: 1380323

URL: http://svn.apache.org/viewvc?rev=1380323&view=rev
Log:
Reuse method in JOrphanUtils

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java?rev=1380323&r1=1380322&r2=1380323&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/XMLAssertion.java Mon Sep  3
19:47:59 2012
@@ -25,6 +25,7 @@ import java.io.StringReader;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.testelement.AbstractTestElement;
 import org.apache.jorphan.logging.LoggingManager;
+import org.apache.jorphan.util.JOrphanUtils;
 import org.apache.log.Logger;
 import org.jdom.JDOMException;
 import org.jdom.input.SAXBuilder;
@@ -89,23 +90,9 @@ public class XMLAssertion extends Abstra
     private byte[] getResultBody(byte[] resultData) {
         for (int i = 0; i < (resultData.length - 1); i++) {
             if (resultData[i] == NEW_LINE && resultData[i + 1] == NEW_LINE) {
-                return getByteArraySlice(resultData, (i + 2), resultData.length - 1);
+                return JOrphanUtils.getByteArraySlice(resultData, (i + 2), resultData.length
- 1);
             }
         }
         return resultData;
     }
-
-    /**
-     * Return a slice of a byte array
-     */
-    private byte[] getByteArraySlice(byte[] array, int begin, int end) {
-        byte[] slice = new byte[(end - begin + 1)];
-        int count = 0;
-        for (int i = begin; i <= end; i++) {
-            slice[count] = array[i];
-            count++;
-        }
-
-        return slice;
-    }
 }



Mime
View raw message