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.Responder;
06: import fitnesse.wiki.PathParser;
07: import fitnesse.http.*;
08:
09: public class RawContentResponderTest extends AbstractResponderRegex {
10: protected Responder responderInstance() {
11: return new RawContentResponder();
12: }
13:
14: public void testSimplePage() throws Exception {
15: String result = getResultsUsing("simple content");
16: assertSubString("simple content", result);
17: }
18:
19: public void testNoHtmlRendered() throws Exception {
20: String result = getResultsUsing("'''simple content'''");
21: assertSubString("'''simple content'''", result);
22: }
23:
24: private String getResultsUsing(String content) throws Exception {
25: crawler.addPage(root, PathParser.parse("SimplePage"), content);
26: request.setResource("SimplePage");
27: Response response = responder.makeResponse(context, request);
28: MockResponseSender sender = new MockResponseSender(response);
29: String result = sender.sentData();
30: return result;
31: }
32: }
|