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.FitNesseContext;
06: import fitnesse.http.*;
07: import fitnesse.testutil.RegexTest;
08: import fitnesse.wiki.*;
09:
10: public class ChunkingResponderTest extends RegexTest {
11:
12: private Exception exception;
13: private Response response;
14: private FitNesseContext context;
15: private WikiPage root = new WikiPageDummy();
16: private ChunkingResponder responder = new ChunkingResponder() {
17: protected void doSending() throws Exception {
18: throw exception;
19: }
20: };
21:
22: protected void setUp() throws Exception {
23: context = new FitNesseContext();
24: context.root = root;
25: }
26:
27: public void testException() throws Exception {
28: exception = new Exception("test exception");
29: response = responder.makeResponse(context, new MockRequest());
30: String result = new MockResponseSender(response).sentData();
31: assertSubString("test exception", result);
32: }
33: }
|