public class Eval extends Object
${expression1} some text ${expression2}
If you pass a single expression, with its braces, the result will be the result object from the Jexl engine,
for example eval'ing ${['a','b']}
will return a Java array of String.
If you pass several expressions, the result object's toString() results will be concatenated along with other plain text
in the input String.Modifier and Type | Class and Description |
---|---|
static class |
Eval.MapContextWKeys |
static class |
Eval.MyVar |
Modifier and Type | Field and Description |
---|---|
Map<String,ServiceResult> |
importsNamespace |
org.apache.commons.jexl2.JexlContext |
jc |
org.apache.commons.jexl2.JexlEngine |
jexl |
static Kit |
KIT |
RunOptions |
runOptions |
Map<String,ServiceResult> |
serviceResultsMap |
static Tools |
TOOLS |
Constructor and Description |
---|
Eval() |
Modifier and Type | Method and Description |
---|---|
void |
addToEvalReport(EvalResult result) |
protected static String |
dumpContext(org.apache.commons.jexl2.JexlContext jc) |
EvalResult |
eval(String logname,
String inputJexlExpression,
Map<String,Object> vars)
You may pass in a Jexl 2 expression, e.g.
|
protected static int |
findMatchingCloseBrace(String in,
int start) |
List<EvalResult> |
getEvalReport() |
static void |
main(String[] args) |
boolean |
popLastEvalReportItemIfUnused(EvalResult result) |
void |
resetContext() |
EvalResult |
setCurrentTestIDLabel(String val)
The current test label is the title of a block of evals in the Eval Report for this session.
|
public Map<String,ServiceResult> serviceResultsMap
public Map<String,ServiceResult> importsNamespace
public org.apache.commons.jexl2.JexlEngine jexl
public org.apache.commons.jexl2.JexlContext jc
public static Tools TOOLS
public static Kit KIT
public RunOptions runOptions
public List<EvalResult> getEvalReport()
public boolean popLastEvalReportItemIfUnused(EvalResult result)
public void addToEvalReport(EvalResult result)
public EvalResult setCurrentTestIDLabel(String val)
<test loop="${expression}" ...
, RestReplay
calls setCurrentTestIDLabel(testID) which gets logged in the report as testID (preflight)
If no evals occur in the evaluation of the expression, then RestReplay can remove the header
line by calling popLastEvalReportItemIfUnused(token) where token is the value returned by
this call.val
- becomes the testIDLabel.public void resetContext()
public EvalResult eval(String logname, String inputJexlExpression, Map<String,Object> vars)
protected static int findMatchingCloseBrace(String in, int start)
protected static String dumpContext(org.apache.commons.jexl2.JexlContext jc)
public static void main(String[] args)
Copyright © 2016. All rights reserved.