use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class JSPWikiMarkupParserTest method setUp.
@Before
public void setUp() throws Exception {
CacheManager.getInstance().removeAllCaches();
props.setProperty("jspwiki.translatorReader.matchEnglishPlurals", "true");
testEngine = new TestEngine(props);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class JSPWikiMarkupParserTest method testAttachmentLink2.
@Test
public void testAttachmentLink2() throws Exception {
props.setProperty("jspwiki.encoding", "ISO-8859-1");
// TODO
TestEngine testEngine2 = new TestEngine(props);
testEngine2.saveText("Test", "foo ");
created.addElement("Test");
Attachment att = new Attachment(testEngine2, "Test", "TestAtt.txt");
att.setAuthor("FirstPost");
testEngine2.getAttachmentManager().storeAttachment(att, testEngine.makeAttachmentFile());
String src = "This should be an [attachment link|Test/TestAtt.txt]";
Assert.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));
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class JSPWikiMarkupParserTest method testAttachmentLink4.
@Test
public void testAttachmentLink4() throws Exception {
TestEngine testEngine2 = new TestEngine(props);
testEngine2.saveText("TestPage", "foo ");
created.addElement("TestPage");
Attachment att = new Attachment(testEngine2, "TestPage", "TestAtt.txt");
att.setAuthor("FirstPost");
testEngine2.getAttachmentManager().storeAttachment(att, testEngine.makeAttachmentFile());
String src = "[" + testEngine2.beautifyTitle("TestPage/TestAtt.txt") + "]";
Assert.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));
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class PageRenamerTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
props.setProperty(WikiEngine.PROP_MATCHPLURALS, "true");
CacheManager.getInstance().removeAllCaches();
TestEngine.emptyWorkDir();
m_engine = new TestEngine(props);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class UserProfileTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
PropertyConfigurator.configure(props);
WikiEngine engine = new TestEngine(props);
m_db = engine.getUserManager().getUserDatabase();
}
Aggregations