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.responders;
04:
05: import fitnesse.testutil.AbstractRegex;
06: import fitnesse.wiki.*;
07: import fitnesse.*;
08: import fitnesse.http.*;
09:
10: public class PageDataResponderTest extends AbstractRegex {
11: WikiPage root;
12:
13: WikiPage pageOne;
14:
15: public void setUp() throws Exception {
16: root = InMemoryPage.makeRoot("RooT");
17: pageOne = root.getPageCrawler().addPage(root,
18: PathParser.parse("PageOne"), "Line one\nLine two");
19: }
20:
21: public void testGetPageData() throws Exception {
22: Responder responder = new PageDataWikiPageResponder();
23: MockRequest request = new MockRequest();
24: request.setResource("PageOne");
25: request.addInput("pageData", "");
26: SimpleResponse response = (SimpleResponse) responder
27: .makeResponse(new FitNesseContext(root), request);
28: assertEquals(pageOne.getData().getContent(), response
29: .getContent());
30: }
31: }
|