public boolean hasChildCommands() { return !children.isEmpty(); }
public boolean hasChildCommands() { return !children.isEmpty(); }
public List<String> getExampleNames() { List<String> examples = new ArrayList<String>(); if (hasExampleCommandNodes()) { if (!rootCommandNode.getChildren().isEmpty()) { // Add the main spec first to increase the chance that it will be run first by jUnit. examples.add(OUTER_EXAMPLE_NAME); } for (ExampleCommandCall exampleCall : this.examples) { examples.add(exampleCall.getExampleName()); } } return examples; }
public List<String> getExampleNames() { List<String> examples = new ArrayList<String>(); if (hasExampleCommandNodes()) { if (!rootCommandNode.getChildren().isEmpty()) { // Add the main spec first to increase the chance that it will be run first by jUnit. examples.add(OUTER_EXAMPLE_NAME); } for (ExampleCommandCall exampleCall : this.examples) { examples.add(exampleCall.getExampleName()); } } return examples; }
public void processNode(CommandCall node, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { if (!node.getChildren().isEmpty()) { for (CommandCall before: beforeExamples) { SummarizingResultRecorder beforeResultRecorder = new SummarizingResultRecorder(); beforeResultRecorder.setSpecificationDescription("Running before for example " + node.getExpression()); before.getCommand().execute(before, evaluator, beforeResultRecorder, fixture); String errorText = null; if (beforeResultRecorder.hasExceptions()) { errorText = SimpleFormatter.format("Exceptions occurred in the 'before' example in '%s'. See the output specification for details.\n", specificationDescription ); } else if (beforeResultRecorder.getTotalCount() > 0) { errorText = SimpleFormatter.format("Assertions were made in the 'before' example in '%s'.\n" + "Assertions are not supported in the 'before' example.\n", specificationDescription ); } if (errorText != null) { System.err.println(errorText); throw new ConcordionAssertionError(errorText, beforeResultRecorder); } } } node.execute(evaluator, resultRecorder, fixture); }
public void processNode(CommandCall node, Evaluator evaluator, ResultRecorder resultRecorder, Fixture fixture) { if (!node.getChildren().isEmpty()) { for (CommandCall before: beforeExamples) { SummarizingResultRecorder beforeResultRecorder = new SummarizingResultRecorder(); beforeResultRecorder.setSpecificationDescription("Running before for example " + node.getExpression()); before.getCommand().execute(before, evaluator, beforeResultRecorder, fixture); String errorText = null; if (beforeResultRecorder.hasExceptions()) { errorText = SimpleFormatter.format("Exceptions occurred in the 'before' example in '%s'. See the output specification for details.\n", specificationDescription ); } else if (beforeResultRecorder.getTotalCount() > 0) { errorText = SimpleFormatter.format("Assertions were made in the 'before' example in '%s'.\n" + "Assertions are not supported in the 'before' example.\n", specificationDescription ); } if (errorText != null) { System.err.println(errorText); throw new ConcordionAssertionError(errorText, beforeResultRecorder); } } } node.execute(evaluator, resultRecorder, fixture); }