01: package com.ecyrd.jspwiki;
02:
03: import junit.framework.*;
04: import java.util.*;
05:
06: import org.apache.log4j.*;
07:
08: import com.ecyrd.jspwiki.providers.*;
09:
10: public class PageManagerTest extends TestCase {
11: Properties props = new Properties();
12:
13: TestEngine engine;
14:
15: public PageManagerTest(String s) {
16: super (s);
17: }
18:
19: public void setUp() throws Exception {
20: props.load(TestEngine.findTestProperties());
21: PropertyConfigurator.configure(props);
22: engine = new TestEngine(props);
23: }
24:
25: public void tearDown() {
26: }
27:
28: public void testPageCacheExists() throws Exception {
29: props.setProperty("jspwiki.usePageCache", "true");
30: PageManager m = new PageManager(engine, props);
31:
32: assertTrue(m.getProvider() instanceof CachingProvider);
33: }
34:
35: public void testPageCacheNotInUse() throws Exception {
36: props.setProperty("jspwiki.usePageCache", "false");
37: PageManager m = new PageManager(engine, props);
38:
39: assertTrue(!(m.getProvider() instanceof CachingProvider));
40: }
41:
42: public static Test suite() {
43: return new TestSuite(PageManagerTest.class);
44: }
45:
46: }
|