@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'echo' is not supported"); Object result = evaluator.evaluate(commandCall.getExpression()); Element element = commandCall.getElement(); if (result != null) { element.appendText(result.toString()); } else { Element child = new Element("em"); child.appendText("null"); element.appendChild(child); } } }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'run' is not supported");
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'echo' is not supported"); Object result = evaluator.evaluate(commandCall.getExpression()); Element element = commandCall.getElement(); if (result != null) { element.appendText(result.toString()); } else { Element child = new Element("em"); child.appendText("null"); element.appendChild(child); } } }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'run' is not supported");
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'assertEquals' is not supported"); Element element = commandCall.getElement(); Object actual = evaluator.evaluate(commandCall.getExpression()); String expected = element.getText(); if (comparator.compare(actual, expected) == 0) { resultRecorder.record(Result.SUCCESS); announceSuccess(element); } else { resultRecorder.record(Result.FAILURE); announceFailure(element, expected, actual); } }
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside an 'assertEquals' is not supported"); Element element = commandCall.getElement(); Object actual = evaluator.evaluate(commandCall.getExpression()); String expected = element.getText(); if (comparator.compare(actual, expected) == 0) { resultRecorder.record(Result.SUCCESS); announceSuccess(element); } else { resultRecorder.record(Result.FAILURE); announceFailure(element, expected, actual); } }
@Override public void setUp(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside a 'set' is not supported"); evaluator.setVariable(commandCall.getExpression(), commandCall.getElement().getText()); announceSetCompleted(commandCall.getElement(), commandCall.getExpression()); }
@Override public void setUp(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { Check.isFalse(commandCall.hasChildCommands(), "Nesting commands inside a 'set' is not supported"); evaluator.setVariable(commandCall.getExpression(), commandCall.getElement().getText()); announceSetCompleted(commandCall.getElement(), commandCall.getExpression()); }