use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class RSSGeneratorTest method setUp.
@Before
public void setUp() throws Exception {
props.setProperty(RSSGenerator.PROP_GENERATE_RSS, "true");
CacheManager.getInstance().removeAllCaches();
m_testEngine = new TestEngine(props);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class SearchManagerTest method setUp.
@Before
public void setUp() throws Exception {
Properties props = TestEngine.getTestProperties();
String workDir = props.getProperty("jspwiki.workDir");
String workRepo = props.getProperty("jspwiki.fileSystemProvider.pageDir");
props.setProperty(SearchManager.PROP_SEARCHPROVIDER, "LuceneSearchProvider");
props.setProperty("jspwiki.lucene.initialdelay", "1");
props.setProperty("jspwiki.workDir", workDir + System.currentTimeMillis());
props.setProperty("jspwiki.fileSystemProvider.pageDir", workRepo + System.currentTimeMillis());
CacheManager.getInstance().removeAllCaches();
m_engine = new TestEngine(props);
m_mgr = m_engine.getSearchManager();
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class ReferringUndefinedPagesPluginTest method setUp.
@Before
public void setUp() throws Exception {
CacheManager.getInstance().removeAllCaches();
testEngine = new TestEngine(props);
testEngine.saveText("TestPage01", "Some Text for testing 01 which refers [NonExistingPageA] ");
testEngine.saveText("TestPage02", "Some Text for testing 02 which refers [NonExistingPageB] ");
testEngine.saveText("TestPage03", "Some Text for testing 03 which refers [NonExistingPageC] ");
context = new WikiContext(testEngine, testEngine.newHttpRequest(), new WikiPage(testEngine, "TestPage"));
manager = new DefaultPluginManager(testEngine, props);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class ContextualDiffProviderTest method diffTest.
// FIXME: This test Assert.fails; must be enabled again asap.
/*
@Test
public void testKnownProblemCases() throws NoRequiredPropertyException, IOException
{
//These all Assert.fail...
//make two consequtive changes
diffTest(null, "A B C D", "A b c D", "A |^b c^-B C-| D");
//acually returns -> "A |^b^-B-| |^c^-C-| D"
//collapse adjacent elements...
diffTest(null, "A B C D", "A BC D", "A |^BC^-B C-| D");
//acually returns -> "A |^BC^-B-| |-C -|D"
//These Assert.failures are all due to how we process the diff results, we need to collapse
//adjacent edits into one...
}
*/
private void diffTest(String contextLimit, String oldText, String newText, String expectedDiff) throws IOException, WikiException {
ContextualDiffProvider diff = new ContextualDiffProvider();
specializedNotation(diff);
Properties props = TestEngine.getTestProperties();
if (null != contextLimit)
props.put(ContextualDiffProvider.PROP_UNCHANGED_CONTEXT_LIMIT, contextLimit);
diff.initialize(null, props);
PropertyConfigurator.configure(props);
TestEngine engine = new TestEngine(props);
WikiContext ctx = new WikiContext(engine, new WikiPage(engine, "Dummy"));
String actualDiff = diff.makeDiffHtml(ctx, oldText, newText);
Assert.assertEquals(expectedDiff, actualDiff);
}
use of org.apache.wiki.TestEngine in project jspwiki by apache.
the class DefaultFilterManagerTest method setUp.
@Before
public void setUp() throws Exception {
PropertyConfigurator.configure(props);
engine = new TestEngine(props);
}
Aggregations