jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1443164 - /jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java
Date Wed, 06 Feb 2013 19:44:46 GMT
Author: sebb
Date: Wed Feb  6 19:44:45 2013
New Revision: 1443164

URL: http://svn.apache.org/viewvc?rev=1443164&view=rev
Log:
Re-arrange order slightly to give better debug output

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

Modified: jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java?rev=1443164&r1=1443163&r2=1443164&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/assertions/ResponseAssertion.java Wed Feb
 6 19:44:45 2013
@@ -293,8 +293,6 @@ public class ResponseAssertion extends A
      * @return an instance of AssertionResult
      */
     private AssertionResult evaluateResponse(SampleResult response) {
-        boolean pass = true;
-        boolean notTest = (NOT & getTestType()) > 0;
         AssertionResult result = new AssertionResult(getName());
         String toCheck = ""; // The string to check (Url or data)
 
@@ -326,13 +324,7 @@ public class ResponseAssertion extends A
         result.setFailure(false);
         result.setError(false);
 
-        if (toCheck.length() == 0) {
-            if (notTest) {
-                return result;
-            }
-            return result.setResultForNull();
-        }
-
+        boolean notTest = (NOT & getTestType()) > 0;
         boolean contains = isContainsType(); // do it once outside loop
         boolean equals = isEqualsType();
         boolean substring = isSubstringType();
@@ -342,6 +334,17 @@ public class ResponseAssertion extends A
             log.debug("Type:" + (contains?"Contains":"Match") + (notTest? "(not)": ""));
         }
 
+        if (toCheck.length() == 0) {
+            if (notTest) { // Not should always succeed against an empty result
+                return result;
+            }
+            if (debugEnabled){
+                log.debug("Not checking empty response field in: "+response.getSampleLabel());
+            }
+            return result.setResultForNull();
+        }
+
+        boolean pass = true;
         try {
             // Get the Matcher for this thread
             Perl5Matcher localMatcher = JMeterUtils.getMatcher();



Mime
View raw message