@Override protected FakeExample newChild() { return new Cells(""); }
@Override public String toString() { return getContent(); } }
@Override public String toMarkup(boolean prettyPrint) { return toMarkup(this, prettyPrint); }
public static Rows parse(String markup) { Tables table = new Tables(); String[] rows = markup.split("\\n"); for (String cells : rows) { if (StringUtils.isBlank(cells)) { continue; } Rows row = ( Rows ) table.addChild(); if ( ! isRowEmpty(cells)) { row.addChild(Cells.parse(cells)); } } return ( Rows ) table.firstChild(); }
@Override protected FakeExample newSibling() { return new Cells(""); }
public static String toMarkup(Example example, boolean prettyPrint) { return toMarkup(example, prettyPrint, new MarkupPrinter.Default()); }
public static Cells parse(String markup) { Rows row = new Rows(); // The following regex uses a group representing the string between [ ] // containing any characters except ] Pattern pattern = Pattern.compile("\\[([^\\]]*)\\]"); Matcher matcher = pattern.matcher(markup); while (matcher.find()) { row.addChild(new Cells(matcher.group(1).trim())); } return ( Cells ) row.firstChild(); }
public static String toMarkup(Example example, boolean prettyPrint, MarkupPrinter printer) { StringBuilder sb = new StringBuilder(); if (example.hasChild()) { sb.append(Cells.toMarkup(example.firstChild(), prettyPrint, printer)); } else { sb.append(EMPTY); } if (example.hasSibling()) { sb.append("\n"); sb.append(toMarkup(example.nextSibling(), prettyPrint, printer)); } return sb.toString(); }
public void setRecognizedAs(String recognizedAs) throws IllegalArgumentException, InvocationTargetException, IllegalAccessException { Fixture fixture; Column column = new NullColumn(); ruleRespected = false; resultingValue = ""; fixture = fixtureFor(recognizedAs); column = new GivenColumn(fixture.send("foo")); column.doCell(new Cells(cellText)); }
public String inputWillBe() throws IllegalArgumentException, InvocationTargetException, IllegalAccessException { Fixture fixture = new PlainOldFixture(new MyFixture(this)); Column column = new GivenColumn(fixture.send("foo")); column.doCell(new Cells(cellText)); return inputCellRecognizedAs; }
public Object annotation() throws IllegalArgumentException, InvocationTargetException, IllegalAccessException { Cells cell = new Cells(comparisonValue); MockFixture mockFixture = new MockFixture(); mockFixture.willRespondTo("foo", returnedValue); Column col = new ExpectedColumn(mockFixture.send("foo")); col.doCell(cell); return AnnotationUtil.getAnnotationOnCell(cell); }
public String comparisonWillBe() throws IllegalArgumentException, InvocationTargetException, IllegalAccessException { Cells cell = new Cells(cellText); MockFixture mockFixture = new MockFixture(); mockFixture.willRespondTo("foo", "anything"); Column col = new ExpectedColumn(mockFixture.send("foo")); col.doCell(cell); return AnnotationUtil.getAnnotationOnCell(cell); }
public Object annotation() throws IllegalArgumentException, InvocationTargetException, IllegalAccessException { Cells cell = new Cells(cellText); MockFixture mockFixture = new MockFixture(); mockFixture.willRespondTo("outputFromSystemUnderDevelopment", outputFromSystemUnderDevelopment); Column col = new SavedColumn(mockFixture.check("outputFromSystemUnderDevelopment")); col.bindTo(variables); col.doCell(cell); return AnnotationUtil.getAnnotationOnCell(cell); }