use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class AnonymousLoginModuleTest method setUp.
/**
*/
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
props.put(XMLUserDatabase.PROP_USERDATABASE, "target/test-classes/userdatabase.xml");
m_engine = new TestEngine(props);
m_db = new XMLUserDatabase();
m_subject = new Subject();
try {
m_db.initialize(m_engine, props);
} catch (NoRequiredPropertyException e) {
System.err.println(e.getMessage());
Assert.assertTrue(false);
}
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class UserDatabaseLoginModuleTest method setUp.
/**
*/
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
props.put(XMLUserDatabase.PROP_USERDATABASE, "target/test-classes/userdatabase.xml");
m_engine = new TestEngine(props);
m_db = new XMLUserDatabase();
m_subject = new Subject();
try {
m_db.initialize(m_engine, props);
} catch (NoRequiredPropertyException e) {
System.err.println(e.getMessage());
Assert.assertTrue(false);
}
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class WebContainerLoginModuleTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
props.put(XMLUserDatabase.PROP_USERDATABASE, "target/test-classes/userdatabase.xml");
m_engine = new TestEngine(props);
m_db = new XMLUserDatabase();
m_subject = new Subject();
try {
m_db.initialize(m_engine, props);
} catch (NoRequiredPropertyException e) {
System.err.println(e.getMessage());
Assert.assertTrue(false);
}
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class JSPWikiMarkupParserTest method testAttachmentLink3.
/**
* Are attachments parsed correctly also when using gappy text?
*/
@Test
public void testAttachmentLink3() 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 = "[Test page/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 JSPWikiMarkupParserTest method testHTMLWhenAllowedPre.
@Test
public void testHTMLWhenAllowedPre() throws Exception {
String src = "{{{ <br /> }}}";
props.setProperty("jspwiki.translatorReader.allowHTML", "true");
testEngine = new TestEngine(props);
WikiPage page = new WikiPage(testEngine, PAGE_NAME);
String out = translate(testEngine, page, src);
Assert.assertEquals("<pre> <br /> </pre>", out);
}
Aggregations