public void transferToParent(CommandCall parent) { if (getParent() != null) { getParent().getChildren().remove(this); } this.parent = parent; if (parent != null) { parent.appendChild(this); } }
public ListSupport(CommandCall listCommandCall) { assert (listCommandCall.getElement().isNamed("ol") || listCommandCall.getElement().isNamed("ul")); this.listCommandCall = listCommandCall; }
public void modifyTree(List<ExampleCommandCall> examples, List<CommandCall> beforeExamples) { this.getCommand().modifyCommandCallTree(this, examples, beforeExamples); List<CommandCall> childrenCopy = new ArrayList(getChildren().asCollection()); for (CommandCall childCall: childrenCopy) { childCall.modifyTree(examples, beforeExamples); } }
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 static void setupCommandForExample(CommandCall node, ResultRecorder resultRecorder, String exampleName) { node.getElement().addAttribute("id", exampleName); // let's be really nice and add the implementation status text into the element itself. ImplementationStatusChecker checker = ImplementationStatusChecker.implementationStatusCheckerFor(resultRecorder.getImplementationStatus()); Element fixtureNode = new Element("p"); fixtureNode.appendText(checker.printNoteToString()); node.getElement().prependChild(fixtureNode); }
@Override protected void processTrueResult(CommandCall commandCall, ResultRecorder resultRecorder) { resultRecorder.record(Result.FAILURE); String expected = commandCall.getElement().getText(); announceFailure(commandCall.getElement(), expected, "== true"); }
private InputStream asHtmlStream(Resource resource) throws IOException { InputStream inputStream = specificationSource.createInputStream(resource); if (specificationConverter != null) { inputStream = specificationConverter.convert(inputStream, resource.getName()); } if (copySourceHtmlTarget != null) { inputStream = copySourceHtml(resource, inputStream); } return inputStream; }
public void testReturnsNullForParentOfRoot() { assertNull(new Resource("/").getParent()); }
@BeforeExample public void incrementAllCounters(@ExampleName String name) { exampleName = name; fieldCounter++; exampleScopedCounter.get().addAndGet(1); }
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 static void setupCommandForExample(CommandCall node, ResultRecorder resultRecorder, String exampleName) { node.getElement().addAttribute("id", exampleName); // let's be really nice and add the implementation status text into the element itself. ImplementationStatusChecker checker = ImplementationStatusChecker.implementationStatusCheckerFor(resultRecorder.getImplementationStatus()); Element fixtureNode = new Element("p"); fixtureNode.appendText(checker.printNoteToString()); node.getElement().prependChild(fixtureNode); }
@Override protected void processFalseResult(CommandCall commandCall, ResultRecorder resultRecorder) { resultRecorder.record(Result.FAILURE); String expected = commandCall.getElement().getText(); announceFailure(commandCall.getElement(), expected, "== false"); }
public ListSupport(CommandCall listCommandCall) { assert (listCommandCall.getElement().isNamed("ol") || listCommandCall.getElement().isNamed("ul")); this.listCommandCall = listCommandCall; }
public void modifyTree(List<ExampleCommandCall> examples, List<CommandCall> beforeExamples) { this.getCommand().modifyCommandCallTree(this, examples, beforeExamples); List<CommandCall> childrenCopy = new ArrayList(getChildren().asCollection()); for (CommandCall childCall: childrenCopy) { childCall.modifyTree(examples, beforeExamples); } }
public void transferToParent(CommandCall parent) { if (getParent() != null) { getParent().getChildren().remove(this); } this.parent = parent; if (parent != null) { parent.appendChild(this); } }
private InputStream asHtmlStream(Resource resource) throws IOException { InputStream inputStream = specificationSource.createInputStream(resource); if (specificationConverter != null) { inputStream = specificationConverter.convert(inputStream, resource.getName()); } if (copySourceHtmlTarget != null) { inputStream = copySourceHtml(resource, inputStream); } return inputStream; }
@Override protected void processFalseResult(CommandCall commandCall, ResultRecorder resultRecorder) { resultRecorder.record(Result.FAILURE); String expected = commandCall.getElement().getText(); announceFailure(commandCall.getElement(), expected, "== false"); }
private boolean isListElement(CommandCall commandCall) { return commandCall.getElement().isNamed("ol") || commandCall.getElement().isNamed("ul"); }
@Override protected void processTrueResult(CommandCall commandCall, ResultRecorder resultRecorder) { resultRecorder.record(Result.FAILURE); String expected = commandCall.getElement().getText(); announceFailure(commandCall.getElement(), expected, "== true"); }
private boolean isTableElement(CommandCall commandCall) { return commandCall.getElement().isNamed("table"); }