ASF Bugzilla – Attachment 22527 Details for
Bug 45749
Response Assertion with rule Substring doesn't work with a string contains characters + or (
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to correcte the assertion substring with String contains regexp operators
patch_assertion_substring.txt (text/plain), 2.22 KB, created by
Milamber
on 2008-09-05 05:07:04 UTC
(
hide
)
Description:
Patch to correcte the assertion substring with String contains regexp operators
Filename:
MIME Type:
Creator:
Milamber
Created:
2008-09-05 05:07:04 UTC
Size:
2.22 KB
patch
obsolete
>Index: /Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/assertions/ResponseAssertion.java >=================================================================== >--- /Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/assertions/ResponseAssertion.java (revision 691010) >+++ //Workspaces-JMeter/Jmeter/src/components/org/apache/jmeter/assertions/ResponseAssertion.java (working copy) >@@ -312,6 +312,7 @@ > boolean contains = isContainsType(); // do it once outside loop > boolean equals = isEqualsType(); > boolean substring = isSubstringType(); >+ boolean matches = isMatchType(); > boolean debugEnabled = log.isDebugEnabled(); > if (debugEnabled){ > log.debug("Type:" + (contains?"Contains":"Match") + (not? "(not)": "")); >@@ -323,7 +324,10 @@ > PropertyIterator iter = getTestStrings().iterator(); > while (iter.hasNext()) { > String stringPattern = iter.next().getStringValue(); >- Pattern pattern = JMeterUtils.getPatternCache().getPattern(stringPattern, Perl5Compiler.READ_ONLY_MASK); >+ Pattern pattern = null; >+ if (contains || matches) { >+ pattern = JMeterUtils.getPatternCache().getPattern(stringPattern, Perl5Compiler.READ_ONLY_MASK); >+ } > boolean found; > if (contains) { > found = localMatcher.contains(toCheck, pattern); >@@ -336,7 +340,7 @@ > } > pass = not ? !found : found; > if (!pass) { >- if (debugEnabled){log.debug("Failed: "+pattern);} >+ if (debugEnabled){log.debug("Failed: "+stringPattern);} > result.setFailure(true); > result.setFailureMessage(getFailText(stringPattern,toCheck)); > break; >@@ -341,7 +345,7 @@ > result.setFailureMessage(getFailText(stringPattern,toCheck)); > break; > } >- if (debugEnabled){log.debug("Passed: "+pattern);} >+ if (debugEnabled){log.debug("Passed: "+stringPattern);} > } > } catch (MalformedCachePatternException e) { > result.setError(true); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45749
: 22527