ASF Bugzilla – Attachment 35333 Details for
Bug 61534
Convert AssertionError to a failed assertion in the JSR223Assertion allowing users to use assert in their code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Catch AssertionError on assertions and use them to fill in the failure message
0001-Convert-AssertionErrors-to-normal-assertion-errors.patch (text/plain), 1.39 KB, created by
Felix Schumacher
on 2017-09-18 19:40:37 UTC
(
hide
)
Description:
Catch AssertionError on assertions and use them to fill in the failure message
Filename:
MIME Type:
Creator:
Felix Schumacher
Created:
2017-09-18 19:40:37 UTC
Size:
1.39 KB
patch
obsolete
>From 84feb76bd420aca390c6116e88d61192ae337a71 Mon Sep 17 00:00:00 2001 >From: Felix Schumacher <felix.schumacher@internetallee.de> >Date: Mon, 18 Sep 2017 20:45:22 +0200 >Subject: [PATCH] Convert AssertionErrors to 'normal' assertion errors. > >--- > src/components/org/apache/jmeter/assertions/JSR223Assertion.java | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > >diff --git a/src/components/org/apache/jmeter/assertions/JSR223Assertion.java b/src/components/org/apache/jmeter/assertions/JSR223Assertion.java >index 17f123c..0a62878 100644 >--- a/src/components/org/apache/jmeter/assertions/JSR223Assertion.java >+++ b/src/components/org/apache/jmeter/assertions/JSR223Assertion.java >@@ -44,7 +44,12 @@ public class JSR223Assertion extends JSR223TestElement implements Cloneable, Ass > Bindings bindings = scriptEngine.createBindings(); > bindings.put("SampleResult", response); > bindings.put("AssertionResult", result); >- processFileOrScript(scriptEngine, bindings); >+ try { >+ processFileOrScript(scriptEngine, bindings); >+ } catch (AssertionError ae) { >+ result.setFailure(true); >+ result.setFailureMessage(ae.toString()); >+ } > result.setError(false); > } catch (IOException | ScriptException e) { > log.error("Problem in JSR223 script: {}", getName(), e); >-- >2.7.4 >
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 61534
: 35333 |
35685