01: package com.mockrunner.base;
02:
03: import com.mockrunner.mock.web.WebMockObjectFactory;
04:
05: /**
06: * Generic implementation of {@link HTMLOutputModule}.
07: * Can be used to to test HTML output in modules that
08: * do not extend {@link HTMLOutputModule}.
09: */
10: public class GenericHTMLOutputModule extends HTMLOutputModule {
11: private WebMockObjectFactory factory;
12:
13: public GenericHTMLOutputModule(WebMockObjectFactory factory) {
14: super (factory);
15: this .factory = factory;
16: }
17:
18: public String getOutput() {
19: try {
20: factory.getMockResponse().getWriter().flush();
21: } catch (Exception exc) {
22:
23: }
24: return factory.getMockResponse().getOutputStreamContent();
25: }
26: }
|