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 java.io.File;
06:
07: import junit.framework.*;
08: import fitnesse.util.FileUtil;
09: import fitnesse.wiki.*;
10: import fitnesse.FitNesseContext;
11:
12: public abstract class AbstractUpdateTestCase extends TestCase {
13: public static final String testDir = System
14: .getProperty("java.io.tmpdir")
15: + File.separator + "testDir";
16:
17: public static final String rootName = "RooT";
18:
19: protected WikiPage root;
20:
21: protected Update update;
22:
23: protected Updater updater;
24:
25: protected WikiPage pageOne;
26:
27: protected WikiPage pageTwo;
28:
29: protected FitNesseContext context;
30:
31: protected PageCrawler crawler;
32:
33: public void setUp() throws Exception {
34: context = new FitNesseContext();
35: context.rootPath = testDir;
36: context.rootPageName = rootName;
37: context.rootPagePath = testDir + File.separator + rootName;
38:
39: FileUtil.makeDir(testDir);
40: root = FileSystemPage.makeRoot(context.rootPath,
41: context.rootPageName);
42: crawler = root.getPageCrawler();
43: context.root = root;
44:
45: pageOne = crawler.addPage(root, PathParser.parse("PageOne"),
46: "some content");
47: pageTwo = crawler.addPage(pageOne, PathParser.parse("PageTwo"),
48: "page two content");
49:
50: updater = new Updater(context);
51: update = makeUpdate();
52: }
53:
54: public void tearDown() throws Exception {
55: FileUtil.deleteFileSystemDirectory(testDir);
56: }
57:
58: protected Update makeUpdate() throws Exception {
59: return null;
60: }
61: }
|