01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.updates;
04:
05: import junit.framework.*;
06: import fitnesse.util.FileUtil;
07: import fitnesse.wiki.*;
08: import fitnesse.FitNesseContext;
09:
10: public abstract class UpdateTest extends TestCase {
11: public static final String testDir = "testDir";
12: public static final String rootName = "RooT";
13:
14: protected WikiPage root;
15: protected Update update;
16: protected Updater updater;
17: protected WikiPage pageOne;
18: protected WikiPage pageTwo;
19: protected FitNesseContext context;
20: protected PageCrawler crawler;
21:
22: public void setUp() throws Exception {
23: context = new FitNesseContext();
24: context.rootPath = testDir;
25: context.rootPageName = rootName;
26: context.rootPagePath = testDir + "/" + rootName;
27:
28: FileUtil.makeDir(testDir);
29: root = FileSystemPage.makeRoot(context.rootPath,
30: context.rootPageName);
31: crawler = root.getPageCrawler();
32: context.root = root;
33:
34: pageOne = crawler.addPage(root, PathParser.parse("PageOne"),
35: "some content");
36: pageTwo = crawler.addPage(pageOne, PathParser.parse("PageTwo"),
37: "page two content");
38:
39: updater = new Updater(context);
40: update = makeUpdate();
41: }
42:
43: public void tearDown() throws Exception {
44: FileUtil.deleteFileSystemDirectory(testDir);
45: }
46:
47: protected Update makeUpdate() throws Exception {
48: return null;
49: };
50: }
|