Search in sources :

Example 21 with TestEngine

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

the class CommandResolverTest method setUp.

@Before
public void setUp() throws Exception {
    Properties props = TestEngine.getTestProperties();
    props.setProperty(WikiEngine.PROP_MATCHPLURALS, "yes");
    m_engine = new TestEngine(props);
    resolver = m_engine.getCommandResolver();
    m_engine.saveText("SinglePage", "This is a test.");
    m_engine.saveText("PluralPages", "This is a test.");
}
Also used : TestEngine(org.apache.wiki.TestEngine) Properties(java.util.Properties) Before(org.junit.Before)

Example 22 with TestEngine

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

the class GroupCommandTest method setUp.

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

Example 23 with TestEngine

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

the class PageCommandTest method setUp.

@Before
public void setUp() throws Exception {
    Properties props = TestEngine.getTestProperties();
    testEngine = new TestEngine(props);
    testEngine.saveText("TestPage", "This is a test.");
    testPage = testEngine.getPage("TestPage");
}
Also used : TestEngine(org.apache.wiki.TestEngine) Properties(java.util.Properties) Before(org.junit.Before)

Example 24 with TestEngine

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

the class FilterBeanTest method testDoGet.

@Test
public void testDoGet() throws WikiException, NotCompliantMBeanException {
    testEngine = new TestEngine(props);
    WikiContext context = new WikiContext(testEngine, new WikiPage(testEngine, "TestPage01"));
    FilterBean pb = new FilterBean(testEngine);
    String expectedHtml = "<div>" + "<h4>Filters</h4>" + "<table border=\"1\">" + "<tr><th>Name</th><th>Author</th><th>Notes</th></tr>" + "<tr><td>org.apache.wiki.filters.SpamFilter</td><td>Janne Jalkanen</td><td></td></tr>" + "</table>" + "</div>";
    Assert.assertEquals(expectedHtml, pb.doGet(context));
}
Also used : WikiContext(org.apache.wiki.WikiContext) WikiPage(org.apache.wiki.WikiPage) TestEngine(org.apache.wiki.TestEngine) Test(org.junit.Test)

Example 25 with TestEngine

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

the class RenderingManagerTest method setUp.

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

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