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