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.testutil;
04:
05: import fitnesse.wiki.*;
06: import java.util.Date;
07:
08: public class SimpleCachinePage extends CachingPage {
09: private static final long serialVersionUID = 1L;
10:
11: private PageData data;
12:
13: public SimpleCachinePage(String name, WikiPage parent)
14: throws Exception {
15: super (name, parent);
16: }
17:
18: public boolean hasChildPage(String pageName) throws Exception {
19: return hasCachedSubpage(pageName);
20: }
21:
22: protected WikiPage createChildPage(String name) throws Exception {
23: return new SimpleCachinePage(name, this );
24: }
25:
26: protected void loadChildren() throws Exception {
27: }
28:
29: protected PageData makePageData() throws Exception {
30: if (data == null)
31: return new PageData(this , "some content");
32: else
33: return new PageData(data);
34: }
35:
36: protected VersionInfo makeVersion() throws Exception {
37: return new VersionInfo("abc", "Jon", new Date());
38: }
39:
40: protected void doCommit(PageData data) throws Exception {
41: this .data = data;
42: }
43:
44: public PageData getDataVersion(String versionName) throws Exception {
45: return new PageData(this , "content from version " + versionName);
46: }
47: }
|