public FakeExample addSibling(FakeExample sibling) { if (hasSibling()) { return more.addSibling(sibling); } more = sibling; return more; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } FakeExample that = ( FakeExample ) o; if (more != null ? ! more.equals(that.more) : that.more != null) { return false; } if (parts != null ? ! parts.equals(that.parts) : that.parts != null) { return false; } return true; }
public FakeExample addChild(FakeExample child) { if (hasChild()) { return parts.addSibling(child); } parts = child; return parts; }
@Override public FakeExample addSibling() { return addSibling(newSibling()); }
private Interpreter interpreterFor(Tables paramTable, Fixture fixture) throws Exception { String interpreterCalled = paramTable.firstChild().firstChild().at(0).getContent(); if ("setup".equals(interpreterCalled)) { return new SetupInterpreter(fixture); } else if ("rule for".equals(interpreterCalled)) { return new DecisionTableInterpreter(fixture); } else if ("decision table".equals(interpreterCalled)) { return new DecisionTableInterpreter(fixture); } // TODO find Exception throw new Exception("No interpreter found"); }
public AnnotationTable annotations() { FakeExample example = new Tables(); example.addChild(new Rows()); example.addChild(( Rows ) table.at(0, 0)); FakeSpecification specification = new FakeSpecification(example); interpreter.interpret(specification); prepareRWIE(specification.stats()); return new AnnotationTable(table); }
public void enterRow(String val) { enterRow = val; SetupInterpreter setup = new SetupInterpreter(new PlainOldFixture(new MyFixture(this))); FakeExample table = new Tables(); table.addChild(new Rows()); table.addChild(new Rows(headers(row))); table.addChild(row); FakeSpecification fakeSpecification = new FakeSpecification(table); setup.interpret(fakeSpecification); prepareRWIE(fakeSpecification.stats()); }
public void enterRow(String val) { enterRow = val; DoSetupInterpreter setup = new DoSetupInterpreter(new PlainOldFixture(new MyFixture(enterRow))); FakeExample table = new Tables(); table.addChild(new Rows()); table.addChild(row); FakeSpecification fakeSpecification = new FakeSpecification(table); setup.interpret(fakeSpecification); prepareRWIE(fakeSpecification.stats()); }