forked from unclebob/fitnesse
/
UpdateTestCase.java
50 lines (40 loc) · 1.4 KB
/
UpdateTestCase.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2003-2009 by Object Mentor, Inc. All rights reserved.
// Released under the terms of the CPL Common Public License version 1.0.
package fitnesse.updates;
import fitnesse.FitNesseContext;
import fitnesse.testutil.FitNesseUtil;
import fitnesse.wiki.FileSystemPage;
import fitnesse.wiki.PageCrawler;
import fitnesse.wiki.PathParser;
import fitnesse.wiki.WikiPage;
import org.junit.After;
import org.junit.Before;
import util.FileUtil;
public abstract class UpdateTestCase {
public static final String rootName = "RooT";
protected WikiPage root;
protected Update update;
protected UpdaterBase updater;
protected WikiPage pageOne;
protected WikiPage pageTwo;
protected FitNesseContext context;
protected PageCrawler crawler;
@Before
public void setUp() throws Exception {
root = new FileSystemPage(FitNesseUtil.base, rootName);
context = FitNesseUtil.makeTestContext(root);
FileUtil.makeDir(FitNesseUtil.base);
crawler = root.getPageCrawler();
pageOne = crawler.addPage(root, PathParser.parse("PageOne"), "some content");
pageTwo = crawler.addPage(pageOne, PathParser.parse("PageTwo"), "page two content");
updater = new UpdaterBase(context);
update = makeUpdate();
}
@After
public void tearDown() throws Exception {
FileUtil.deleteFileSystemDirectory(FitNesseUtil.base);
}
protected Update makeUpdate() throws Exception {
return null;
}
}