@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { commandCall.getChildren().execute(evaluator, resultRecorder); if (!variableName.isEmpty()) { evaluator.setVariable(variableName, requestCommand.getActualResult()); } }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { // bypass normal execution if the modification required it. if (commandCall.bypassExecution()) { commandCall.getChildren().execute(evaluator, resultRecorder, fixture); return; } normalExecution(commandCall, evaluator, resultRecorder, fixture); }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { // bypass normal execution if the modification required it. if (commandCall.bypassExecution()) { commandCall.getChildren().execute(evaluator, resultRecorder, fixture); return; } normalExecution(commandCall, evaluator, resultRecorder, fixture); }
private void normalExecution(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { CommandCallList childCommands = commandCall.getChildren(); childCommands.setUp(evaluator, resultRecorder, fixture); evaluator.evaluate(commandCall.getExpression()); childCommands.execute(evaluator, resultRecorder, fixture); announceExecuteCompleted(commandCall.getElement()); childCommands.verify(evaluator, resultRecorder, fixture); }
private void normalExecution(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { CommandCallList childCommands = commandCall.getChildren(); childCommands.setUp(evaluator, resultRecorder, fixture); evaluator.evaluate(commandCall.getExpression()); childCommands.execute(evaluator, resultRecorder, fixture); announceExecuteCompleted(commandCall.getElement()); childCommands.verify(evaluator, resultRecorder, fixture); }
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { // Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'assertTrue' is not supported"); CommandCallList childCommands = commandCall.getChildren(); childCommands.setUp(evaluator, resultRecorder, fixture); childCommands.execute(evaluator, resultRecorder, fixture); childCommands.verify(evaluator, resultRecorder, fixture); String expression = commandCall.getExpression(); Object result = evaluator.evaluate(expression); if (result != null && result instanceof Boolean) { if ((Boolean) result) { processTrueResult(commandCall, resultRecorder); } else { processFalseResult(commandCall, resultRecorder); } } else { throw new InvalidExpressionException("Expression '" + expression + "' did not produce a boolean result (needed for assertTrue)."); } }
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { // Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'assertTrue' is not supported"); CommandCallList childCommands = commandCall.getChildren(); childCommands.setUp(evaluator, resultRecorder, fixture); childCommands.execute(evaluator, resultRecorder, fixture); childCommands.verify(evaluator, resultRecorder, fixture); String expression = commandCall.getExpression(); Object result = evaluator.evaluate(expression); if (result != null && result instanceof Boolean) { if ((Boolean) result) { processTrueResult(commandCall, resultRecorder); } else { processFalseResult(commandCall, resultRecorder); } } else { throw new InvalidExpressionException("Expression '" + expression + "' did not produce a boolean result (needed for assertTrue)."); } }