@Test public void parseTestDoc() throws IOException { WikiVisitor visitor = EasyMock.createStrictMock(WikiVisitor.class); visitor.startPara(0); visitor.heading(1, "myTestdoc"); visitor.endPara(); visitor.startPara(0); visitor.endPara(); visitor.startPara(0); visitor.text("Some text"); visitor.endPara(); visitor.startPara(0); visitor.enumeration("enumeration"); visitor.endPara(); visitor.startPara(0); visitor.enumeration("enumeration"); visitor.text("- wit"); visitor.text("h additional text"); visitor.endPara(); visitor.startPara(1); visitor.text("some text "); visitor.link("a link", ""); visitor.text(" some more text"); visitor.endPara(); visitor.startPara(0); visitor.text("h1 is no heading"); visitor.endPara(); visitor.startPara(0); visitor.text("some "); visitor.bold(true); visitor.text("bold"); visitor.bold(false); visitor.text(" text"); visitor.endPara(); visitor.startPara(0); visitor.text("and a line for KARAF-6650 "); visitor.text("h"); visitor.endPara(); EasyMock.replay(visitor); WikiParser parser = new WikiParser(visitor); parser.parse(new StringReader(TESTDOC)); EasyMock.verify(visitor); }
public void parse(Reader reader) throws IOException { BufferedReader br = new BufferedReader(reader); String line; while ((line = br.readLine()) != null) { if (!line.startsWith("#")) { parse(line); } } }
WikiParser { public void parse(Reader reader) throws IOException { BufferedReader br = new BufferedReader(reader); String line; while ((line = br.readLine()) != null) { if (!line.startsWith("#")) { parse(line); } } } }
WikiParser { public void parse(Reader reader) throws IOException { BufferedReader br = new BufferedReader(reader); String line; while ((line = br.readLine()) != null) { if (!line.startsWith("#")) { parse(line); } } } WikiParser(WikiVisitor visitor); }
WikiParser { public void parse(Reader reader) throws IOException { BufferedReader br = new BufferedReader(reader); String line; while ((line = br.readLine()) != null) { if (!line.startsWith("#")) { parse(line); } } } WikiParser(WikiVisitor visitor); void parse(Reader reader); void parse(String line); }
WikiParser { public void parse(Reader reader) throws IOException { BufferedReader br = new BufferedReader(reader); String line; while ((line = br.readLine()) != null) { if (!line.startsWith("#")) { parse(line); } } } WikiParser(WikiVisitor visitor); void parse(Reader reader); void parse(String line);  }