You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2008/05/29 14:13:21 UTC

svn commit: r661311 - in /jakarta/jmeter/trunk: src/components/org/apache/jmeter/assertions/SizeAssertion.java xdocs/changes.xml

Author: sebb
Date: Thu May 29 05:13:21 2008
New Revision: 661311

URL: http://svn.apache.org/viewvc?rev=661311&view=rev
Log:
Bug 45093 - SizeAssertion did not call getBytes()

Modified:
    jakarta/jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java?rev=661311&r1=661310&r2=661311&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java (original)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/assertions/SizeAssertion.java Thu May 29 05:13:21 2008
@@ -32,11 +32,10 @@
 /**
  * Checks if the results of a Sample matches a particular size.
  * 
- * author <a href="mailto:wolfram.rittmeyer@web.de">Wolfram Rittmeyer</a>
  */
 public class SizeAssertion extends AbstractTestElement implements Serializable, Assertion {
 
-	private String comparatorErrorMessage = "ERROR!";
+	private transient String comparatorErrorMessage;// Only used for communication with compareSize()
 
 	// * Static int to signify the type of logical comparitor to assert
 	public final static int EQUAL = 1;
@@ -56,8 +55,6 @@
 
 	private static final String OPERATOR_KEY = "SizeAssertion.operator"; // $NON-NLS-1$
 
-	byte[] resultData;
-
 	/**
 	 * Returns the result of the Assertion. 
 	 * Here it checks the Sample responseData length.
@@ -65,8 +62,7 @@
 	public AssertionResult getResult(SampleResult response) {
 		AssertionResult result = new AssertionResult(getName());
 		result.setFailure(false);
-		resultData = response.getResponseData();
-		long resultSize = resultData.length;
+		long resultSize = response.getBytes();
 		// is the Sample the correct size?
 		if (!(compareSize(resultSize))) {
 			result.setFailure(true);
@@ -159,6 +155,10 @@
 			result = (resultSize <= getAllowedSize());
 			comparatorErrorMessage = JMeterUtils.getResString("size_assertion_comparator_error_lessequal"); //$NON-NLS-1$
 			break;
+		default:
+		    result = false;
+			comparatorErrorMessage = "ERROR - invalid condition";
+			break;
 		}
 		return result;
 	}

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=661311&r1=661310&r2=661311&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Thu May 29 05:13:21 2008
@@ -31,6 +31,11 @@
 <!--  ===================  -->
 
 <h2>Version 2.3.2A</h2>
+<h3>Bug fixes</h3>
+<ul>
+<li>Bug 45093 - SizeAssertion did not call getBytes()</li>
+</ul>
+
 <h3>Improvements</h3>
 <ul>
 <li>Bugs 44808, 39641 - Proxy support for binary requests</li>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org