### Question:
JSPWikiMarkupParser extends MarkupParser { private Element addElement( final Content e ) { if( e != null ) { flushPlainText(); m_currentElement.addContent( e ); } return m_currentElement; } JSPWikiMarkupParser( final Context context, final Reader in ); Element makeHeading( final int level, final String title, final Heading hd ); @Override WikiDocument parse();  }### Answer:
@Test public void testAttachmentLink2() throws Exception { props.setProperty( "jspwiki.encoding", "ISO-8859-1" ); final TestEngine testEngine2 = new TestEngine( props ); testEngine2.saveText( "Test", "foo "); created.addElement( "Test" ); final Attachment att = Wiki.contents().attachment( testEngine2, "Test", "TestAtt.txt" ); att.setAuthor( "FirstPost" ); testEngine2.getManager( AttachmentManager.class ).storeAttachment( att, testEngine.makeAttachmentFile() ); final String src = "This should be an [attachment link|Test/TestAtt.txt]"; Assertions.assertEquals( "This should be an <a class=\"attachment\" href=\"/test/attach/Test/TestAtt.txt\">attachment link</a>"+ "<a href=\"/test/PageInfo.jsp?page=Test/TestAtt.txt\" class=\"infolink\"><img src=\"/test/images/attachment_small.png\" border=\"0\" alt=\"(info)\" /></a>", translate(testEngine2,src)); }
@Test public void testAttachmentLink3() throws Exception { final TestEngine testEngine2 = new TestEngine( props ); testEngine2.saveText( "TestPage", "foo "); created.addElement( "TestPage" ); final Attachment att = Wiki.contents().attachment( testEngine2, "TestPage", "TestAtt.txt" ); att.setAuthor( "FirstPost" ); testEngine2.getManager( AttachmentManager.class ).storeAttachment( att, testEngine.makeAttachmentFile() ); final String src = "[Test page/TestAtt.txt]"; Assertions.assertEquals( "<a class=\"attachment\" href=\"/test/attach/TestPage/TestAtt.txt\">Test page/TestAtt.txt</a>"+ "<a href=\"/test/PageInfo.jsp?page=TestPage/TestAtt.txt\" class=\"infolink\"><img src=\"/test/images/attachment_small.png\" border=\"0\" alt=\"(info)\" /></a>", translate(testEngine2,src)); }
@Test public void testAttachmentLink4() throws Exception { final TestEngine testEngine2 = new TestEngine( props ); testEngine2.saveText( "TestPage", "foo "); created.addElement( "TestPage" ); final Attachment att = Wiki.contents().attachment( testEngine2, "TestPage", "TestAtt.txt" ); att.setAuthor( "FirstPost" ); testEngine2.getManager( AttachmentManager.class ).storeAttachment( att, testEngine.makeAttachmentFile() ); final String src = "["+testEngine2.getManager( RenderingManager.class ).beautifyTitle("TestPage/TestAtt.txt")+"]"; Assertions.assertEquals( "<a class=\"attachment\" href=\"/test/attach/TestPage/TestAtt.txt\">Test Page/TestAtt.txt</a>"+ "<a href=\"/test/PageInfo.jsp?page=TestPage/TestAtt.txt\" class=\"infolink\"><img src=\"/test/images/attachment_small.png\" border=\"0\" alt=\"(info)\" /></a>", translate(testEngine2,src)); }