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); }
public void appendChild(CommandCall commandNode) { children.append(commandNode); }
private Map<Integer, CommandCall> populateCommandCallByColumnMap(Table table, CommandCall tableCommandCall) { Map<Integer, CommandCall> commandCallByColumn = new HashMap<Integer, CommandCall>(); Row headerRow = table.getLastHeaderRow(); for (CommandCall childCall : tableCommandCall.getChildren().asCollection()) { int columnIndex = headerRow.getIndexOfCell(childCall.getElement()); if (columnIndex == -1) { throw new RuntimeException("Commands must be placed on <th> elements when using 'execute' or 'verifyRows' commands on a <table>."); } commandCallByColumn.put(columnIndex, childCall); } return commandCallByColumn; }
@Override public void verify(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { commandCall.getChildren().verify(evaluator, resultRecorder); cleanUp(); }
CommandCallList childrenCalls = commandCall.getChildren(); assert headerCells.length == childrenCalls.size(); long success = 0; for (CommandCall columnCommand : childrenCalls.asCollection()) { columnCommand.verify(evaluator, backgroundResultRecorder, fixture);
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { commandCall.getChildren().execute(evaluator, resultRecorder); if (!variableName.isEmpty()) { evaluator.setVariable(variableName, requestCommand.getActualResult()); } }
public boolean hasChildCommands() { return !children.isEmpty(); }
@Override public void setUp(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder) { stripCommandAttribute(commandCall.getElement()); variableName = commandCall.getExpression(); if (!variableName.isEmpty() && !variableName.startsWith("#")) { throw new RuntimeException(variableName + " should start with a #, to be a valid Concordion variable."); } commandCall.getChildren().setUp(evaluator, resultRecorder); }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { if (specificationDescriber != null) { resultRecorder.setSpecificationDescription(getSpecificationDescription(commandCall)); } try { announceBeforeOuterExampleEvent(commandCall.getElement(), (SummarizingResultRecorder) resultRecorder, fixture); commandCall.getChildren().processSequentially(evaluator, resultRecorder, fixture); } catch (FailFastException e) { // Ignore - it'll be re-thrown later if necessary. } finally { announceAfterOuterExampleEvent(commandCall.getElement(), (SummarizingResultRecorder) resultRecorder, fixture); } }
public void transferToParent(CommandCall parent) { if (getParent() != null) { getParent().getChildren().remove(this); } this.parent = parent; if (parent != null) { parent.appendChild(this); } }
private void reportSurplusRows(Fixture fixture) { for (Object surplusRow : actualRows) { evaluator.setVariable(loopVariableName, surplusRow); Row detailRow = tableSupport.addDetailRow(); announceSurplusRow(detailRow.getElement()); tableSupport.copyCommandCallsTo(detailRow); commandCall.getChildren().verify(evaluator, resultRecorder, fixture); } } }
CommandCallList childrenCalls = commandCall.getChildren(); assert headerCells.length == childrenCalls.size(); long success = 0; for (CommandCall columnCommand : childrenCalls.asCollection()) { columnCommand.verify(evaluator, backgroundResultRecorder, 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); }
public boolean hasChildCommands() { return !children.isEmpty(); }
@Override public void execute(CommandCall commandCall, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { if (specificationDescriber != null) { resultRecorder.setSpecificationDescription(getSpecificationDescription(commandCall)); } try { announceBeforeOuterExampleEvent(commandCall.getElement(), (SummarizingResultRecorder) resultRecorder, fixture); commandCall.getChildren().processSequentially(evaluator, resultRecorder, fixture); } catch (FailFastException e) { // Ignore - it'll be re-thrown later if necessary. } finally { announceAfterOuterExampleEvent(commandCall.getElement(), (SummarizingResultRecorder) resultRecorder, fixture); } }
public void transferToParent(CommandCall parent) { if (getParent() != null) { getParent().getChildren().remove(this); } this.parent = parent; if (parent != null) { parent.appendChild(this); } }
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 reportSurplusRows(Fixture fixture) { for (Object surplusRow : actualRows) { evaluator.setVariable(loopVariableName, surplusRow); Row detailRow = tableSupport.addDetailRow(); announceSurplusRow(detailRow.getElement()); tableSupport.copyCommandCallsTo(detailRow); commandCall.getChildren().verify(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 Map<Integer, CommandCall> populateCommandCallByColumnMap(Table table, CommandCall tableCommandCall) { Map<Integer, CommandCall> commandCallByColumn = new HashMap<Integer, CommandCall>(); Row headerRow = table.getLastHeaderRow(); for (CommandCall childCall : tableCommandCall.getChildren().asCollection()) { int columnIndex = headerRow.getIndexOfCell(childCall.getElement()); if (columnIndex == -1) { throw new RuntimeException("Commands must be placed on <th> elements when using 'execute' or 'verifyRows' commands on a <table>."); } commandCallByColumn.put(columnIndex, childCall); } return commandCallByColumn; }