Search in sources :

Example 41 with TestEngine

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

the class WysiwygEditingRendererTest method setUp.

@Before
public void setUp() throws Exception {
    Properties props = TestEngine.getTestProperties();
    testEngine = new TestEngine(props);
    testEngine.saveText("WysiwygEditingRendererTest", "test page");
    testEngine.saveText("This Pagename Has Spaces", "This Pagename Has Spaces");
}
Also used : TestEngine(org.apache.wiki.TestEngine) Properties(java.util.Properties) Before(org.junit.Before)

Example 42 with TestEngine

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

the class MassiveRepositoryTest method setUp.

@Before
public void setUp() throws Exception {
    String files = props.getProperty(FileSystemProvider.PROP_PAGEDIR);
    // Remove file
    File f = new File(files);
    TestEngine.deleteAll(f);
    CacheManager.getInstance().removeAllCaches();
    engine = new TestEngine(props);
}
Also used : TestEngine(org.apache.wiki.TestEngine) File(java.io.File) Before(org.junit.Before)

Example 43 with TestEngine

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

the class InputValidatorTest method setUp.

@Before
public void setUp() throws Exception {
    Properties props = TestEngine.getTestProperties();
    testEngine = new TestEngine(props);
    WikiContext context = new WikiContext(testEngine, new WikiPage(testEngine, "dummyPage"));
    val = new InputValidator(TEST, context);
}
Also used : WikiContext(org.apache.wiki.WikiContext) WikiPage(org.apache.wiki.WikiPage) TestEngine(org.apache.wiki.TestEngine) Properties(java.util.Properties) Before(org.junit.Before)

Example 44 with TestEngine

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

the class WikiCommandTest method setUp.

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

Example 45 with TestEngine

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

the class PluginBeanTest method testDoGet.

@Test
public void testDoGet() throws WikiException, NotCompliantMBeanException {
    testEngine = new TestEngine(props);
    WikiContext context = new WikiContext(testEngine, new WikiPage(testEngine, "TestPage01"));
    PluginBean pb = new PluginBean(testEngine);
    String expectedHtml = "<div>" + "<h4>Plugins</h4>" + "<table border=\"1\">" + "<tr><th>Name</th><th>Alias</th><th>Author</th><th>Notes</th></tr>" + "<tr><td>IfPlugin</td><td>If</td><td>Janne Jalkanen</td><td></td></tr>" + "<tr><td>Note</td><td></td><td>Janne Jalkanen</td><td></td></tr>" + "<tr><td>SamplePlugin</td><td>samplealias</td><td>Janne Jalkanen</td><td></td></tr>" + "<tr><td>SamplePlugin2</td><td>samplealias2</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)

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