01: package com.mockrunner.base;
02:
03: import java.io.BufferedReader;
04:
05: /**
06: * Delegator for {@link HTMLOutputModule}. The corresponding
07: * adapters extend this class. This class is used for the basic
08: * adapter versions.
09: */
10: public abstract class BasicHTMLOutputTestCase extends BasicWebTestCase {
11: public BasicHTMLOutputTestCase() {
12:
13: }
14:
15: public BasicHTMLOutputTestCase(String arg0) {
16: super (arg0);
17: }
18:
19: protected WebTestModule getWebTestModule() {
20: return getHTMLOutputModule();
21: }
22:
23: /**
24: * Implemented by concrete subclasses.
25: */
26: protected abstract HTMLOutputModule getHTMLOutputModule();
27:
28: /**
29: * Delegates to {@link HTMLOutputModule#getOutput}
30: */
31: protected String getOutput() {
32: return getHTMLOutputModule().getOutput();
33: }
34:
35: /**
36: * Delegates to {@link HTMLOutputModule#getOutputAsBufferedReader}
37: */
38: protected BufferedReader getOutputAsBufferedReader() {
39: return getHTMLOutputModule().getOutputAsBufferedReader();
40: }
41:
42: /**
43: * Delegates to {@link HTMLOutputModule#getOutputAsW3CDocument}
44: */
45: protected org.w3c.dom.Document getOutputAsW3CDocument() {
46: return getHTMLOutputModule().getOutputAsW3CDocument();
47: }
48:
49: /**
50: * Delegates to {@link HTMLOutputModule#getOutputAsJDOMDocument}
51: */
52: protected org.jdom.Document getOutputAsJDOMDocument() {
53: return getHTMLOutputModule().getOutputAsJDOMDocument();
54: }
55:
56: /**
57: * Delegates to {@link HTMLOutputModule#getOutputAsWellformedXML}
58: */
59: protected String getOutputAsWellformedXML() {
60: return getHTMLOutputModule().getOutputAsWellformedXML();
61: }
62:
63: /**
64: * Delegates to {@link HTMLOutputModule#setCaseSensitive}
65: */
66: protected void setCaseSensitive(boolean caseSensitive) {
67: getHTMLOutputModule().setCaseSensitive(caseSensitive);
68: }
69:
70: /**
71: * Delegates to {@link HTMLOutputModule#verifyOutput}
72: */
73: protected void verifyOutput(String expectedOutput) {
74: getHTMLOutputModule().verifyOutput(expectedOutput);
75: }
76:
77: /**
78: * Delegates to {@link HTMLOutputModule#verifyOutputContains}
79: */
80: protected void verifyOutputContains(String expectedOutput) {
81: getHTMLOutputModule().verifyOutputContains(expectedOutput);
82: }
83:
84: /**
85: * Delegates to {@link HTMLOutputModule#verifyOutputRegularExpression}
86: */
87: protected void verifyOutputRegularExpression(String expression) {
88: getHTMLOutputModule().verifyOutputRegularExpression(expression);
89: }
90: }
|