Search in sources :

Example 46 with TestEngine

use of org.apache.wiki.TestEngine in project jspwiki by apache.

the class IfPluginTest method setUp.

@Before
public void setUp() throws Exception {
    Properties props = TestEngine.getTestProperties();
    testEngine = new TestEngine(props);
}
Also used : TestEngine(org.apache.wiki.TestEngine) Properties(java.util.Properties) Before(org.junit.Before)

Example 47 with TestEngine

use of org.apache.wiki.TestEngine in project jspwiki by apache.

the class PageViewPluginTest method setUp.

@Before
public void setUp() throws Exception {
    CacheManager.getInstance().removeAllCaches();
    testEngine = new TestEngine(props);
    // create pages that should be counted
    testEngine.saveText("TestPage01", "this is test page 01 [{PageViewPlugin}]");
    testEngine.saveText("TestPage02", "this is test page 02 [{PageViewPlugin}]");
    manager = new DefaultPluginManager(testEngine, props);
}
Also used : TestEngine(org.apache.wiki.TestEngine) Before(org.junit.Before)

Example 48 with TestEngine

use of org.apache.wiki.TestEngine in project jspwiki by apache.

the class RecentChangesPluginTest method setUp.

@Before
public void setUp() throws Exception {
    CacheManager.getInstance().removeAllCaches();
    testEngine = new TestEngine(props);
    testEngine.saveText("TestPage01", "Some Text for testing 01");
    testEngine.saveText("TestPage02", "Some Text for testing 02");
    testEngine.saveText("TestPage03", "Some Text for testing 03");
    testEngine.saveText("TestPage04", "Some Text for testing 04");
    manager = new DefaultPluginManager(testEngine, props);
}
Also used : TestEngine(org.apache.wiki.TestEngine) Before(org.junit.Before)

Example 49 with TestEngine

use of org.apache.wiki.TestEngine in project jspwiki by apache.

the class ReferringPagesPluginTest method setUp.

@Before
public void setUp() throws Exception {
    props.setProperty("jspwiki.breakTitleWithSpaces", "false");
    engine = new TestEngine(props);
    engine.saveText("TestPage", "Reference to [Foobar].");
    engine.saveText("Foobar", "Reference to [TestPage].");
    engine.saveText("Foobar2", "Reference to [TestPage].");
    engine.saveText("Foobar3", "Reference to [TestPage].");
    engine.saveText("Foobar4", "Reference to [TestPage].");
    engine.saveText("Foobar5", "Reference to [TestPage].");
    engine.saveText("Foobar6", "Reference to [TestPage].");
    engine.saveText("Foobar7", "Reference to [TestPage].");
    context = new WikiContext(engine, engine.newHttpRequest(), new WikiPage(engine, "TestPage"));
    manager = new DefaultPluginManager(engine, props);
}
Also used : WikiContext(org.apache.wiki.WikiContext) WikiPage(org.apache.wiki.WikiPage) TestEngine(org.apache.wiki.TestEngine) Before(org.junit.Before)

Example 50 with TestEngine

use of org.apache.wiki.TestEngine in project jspwiki by apache.

the class ShortViewURLConstructorTest method getConstructor.

private URLConstructor getConstructor(String prefix) throws WikiException {
    if (prefix != null)
        props.setProperty(ShortViewURLConstructor.PROP_PREFIX, prefix);
    testEngine = new TestEngine(props);
    URLConstructor constr = new ShortViewURLConstructor();
    constr.initialize(testEngine, props);
    return constr;
}
Also used : TestEngine(org.apache.wiki.TestEngine)

Aggregations

TestEngine (org.apache.wiki.TestEngine)70 Before (org.junit.Before)49 Properties (java.util.Properties)42 WikiPage (org.apache.wiki.WikiPage)15 Test (org.junit.Test)15 WikiContext (org.apache.wiki.WikiContext)11 WikiEngine (org.apache.wiki.WikiEngine)8 File (java.io.File)4 Subject (javax.security.auth.Subject)4 WikiSessionTest (org.apache.wiki.WikiSessionTest)4 NoRequiredPropertyException (org.apache.wiki.api.exceptions.NoRequiredPropertyException)4 XMLUserDatabase (org.apache.wiki.auth.user.XMLUserDatabase)4 Attachment (org.apache.wiki.attachment.Attachment)3 WikiPrincipal (org.apache.wiki.auth.WikiPrincipal)3 StringReader (java.io.StringReader)2 Principal (java.security.Principal)2 WikiSession (org.apache.wiki.WikiSession)2 GroupPrincipal (org.apache.wiki.auth.GroupPrincipal)2 Group (org.apache.wiki.auth.authorize.Group)2 BufferedReader (java.io.BufferedReader)1