Lines 312-317
Link Here
|
312 |
boolean contains = isContainsType(); // do it once outside loop |
312 |
boolean contains = isContainsType(); // do it once outside loop |
313 |
boolean equals = isEqualsType(); |
313 |
boolean equals = isEqualsType(); |
314 |
boolean substring = isSubstringType(); |
314 |
boolean substring = isSubstringType(); |
|
|
315 |
boolean matches = isMatchType(); |
315 |
boolean debugEnabled = log.isDebugEnabled(); |
316 |
boolean debugEnabled = log.isDebugEnabled(); |
316 |
if (debugEnabled){ |
317 |
if (debugEnabled){ |
317 |
log.debug("Type:" + (contains?"Contains":"Match") + (not? "(not)": "")); |
318 |
log.debug("Type:" + (contains?"Contains":"Match") + (not? "(not)": "")); |
Lines 323-329
Link Here
|
323 |
PropertyIterator iter = getTestStrings().iterator(); |
324 |
PropertyIterator iter = getTestStrings().iterator(); |
324 |
while (iter.hasNext()) { |
325 |
while (iter.hasNext()) { |
325 |
String stringPattern = iter.next().getStringValue(); |
326 |
String stringPattern = iter.next().getStringValue(); |
326 |
Pattern pattern = JMeterUtils.getPatternCache().getPattern(stringPattern, Perl5Compiler.READ_ONLY_MASK); |
327 |
Pattern pattern = null; |
|
|
328 |
if (contains || matches) { |
329 |
pattern = JMeterUtils.getPatternCache().getPattern(stringPattern, Perl5Compiler.READ_ONLY_MASK); |
330 |
} |
327 |
boolean found; |
331 |
boolean found; |
328 |
if (contains) { |
332 |
if (contains) { |
329 |
found = localMatcher.contains(toCheck, pattern); |
333 |
found = localMatcher.contains(toCheck, pattern); |
Lines 336-342
Link Here
|
336 |
} |
340 |
} |
337 |
pass = not ? !found : found; |
341 |
pass = not ? !found : found; |
338 |
if (!pass) { |
342 |
if (!pass) { |
339 |
if (debugEnabled){log.debug("Failed: "+pattern);} |
343 |
if (debugEnabled){log.debug("Failed: "+stringPattern);} |
340 |
result.setFailure(true); |
344 |
result.setFailure(true); |
341 |
result.setFailureMessage(getFailText(stringPattern,toCheck)); |
345 |
result.setFailureMessage(getFailText(stringPattern,toCheck)); |
342 |
break; |
346 |
break; |
Lines 341-347
Link Here
|
341 |
result.setFailureMessage(getFailText(stringPattern,toCheck)); |
345 |
result.setFailureMessage(getFailText(stringPattern,toCheck)); |
342 |
break; |
346 |
break; |
343 |
} |
347 |
} |
344 |
if (debugEnabled){log.debug("Passed: "+pattern);} |
348 |
if (debugEnabled){log.debug("Passed: "+stringPattern);} |
345 |
} |
349 |
} |
346 |
} catch (MalformedCachePatternException e) { |
350 |
} catch (MalformedCachePatternException e) { |
347 |
result.setError(true); |
351 |
result.setError(true); |