001: package com.mockrunner.servlet;
002:
003: import javax.servlet.Filter;
004: import javax.servlet.ServletRequest;
005: import javax.servlet.ServletResponse;
006: import javax.servlet.http.HttpServlet;
007:
008: import com.mockrunner.base.HTMLOutputModule;
009: import com.mockrunner.base.HTMLOutputTestCase;
010:
011: /**
012: * Delegator for {@link com.mockrunner.servlet.ServletTestModule}. You can
013: * subclass this adapter or use {@link com.mockrunner.servlet.ServletTestModule}
014: * directly (so your test case can use another base class).
015: * This adapter extends {@link com.mockrunner.base.BaseTestCase}.
016: * It can be used if you want to use several modules in conjunction.
017: * <b>This class is generated from the {@link com.mockrunner.servlet.ServletTestModule}
018: * and should not be edited directly</b>.
019: */
020: public abstract class ServletTestCaseAdapter extends HTMLOutputTestCase {
021: private ServletTestModule servletTestModule;
022:
023: public ServletTestCaseAdapter() {
024:
025: }
026:
027: public ServletTestCaseAdapter(String name) {
028: super (name);
029: }
030:
031: protected void tearDown() throws Exception {
032: super .tearDown();
033: servletTestModule = null;
034: }
035:
036: /**
037: * Creates the {@link com.mockrunner.servlet.ServletTestModule}. If you
038: * overwrite this method, you must call <code>super.setUp()</code>.
039: */
040: protected void setUp() throws Exception {
041: super .setUp();
042: servletTestModule = createServletTestModule(getWebMockObjectFactory());
043: }
044:
045: /**
046: * Returns the {@link com.mockrunner.servlet.ServletTestModule} as
047: * {@link com.mockrunner.base.HTMLOutputModule}.
048: * @return the {@link com.mockrunner.base.HTMLOutputModule}
049: */
050: protected HTMLOutputModule getHTMLOutputModule() {
051: return servletTestModule;
052: }
053:
054: /**
055: * Gets the {@link com.mockrunner.servlet.ServletTestModule}.
056: * @return the {@link com.mockrunner.servlet.ServletTestModule}
057: */
058: protected ServletTestModule getServletTestModule() {
059: return servletTestModule;
060: }
061:
062: /**
063: * Sets the {@link com.mockrunner.servlet.ServletTestModule}.
064: * @param servletTestModule the {@link com.mockrunner.servlet.ServletTestModule}
065: */
066: protected void setServletTestModule(
067: ServletTestModule servletTestModule) {
068: this .servletTestModule = servletTestModule;
069: }
070:
071: /**
072: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#setServlet(HttpServlet)}
073: */
074: protected void setServlet(HttpServlet servlet) {
075: servletTestModule.setServlet(servlet);
076: }
077:
078: /**
079: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#setServlet(HttpServlet, boolean)}
080: */
081: protected void setServlet(HttpServlet servlet, boolean doInit) {
082: servletTestModule.setServlet(servlet, doInit);
083: }
084:
085: /**
086: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doGet}
087: */
088: protected void doGet() {
089: servletTestModule.doGet();
090: }
091:
092: /**
093: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doPost}
094: */
095: protected void doPost() {
096: servletTestModule.doPost();
097: }
098:
099: /**
100: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doHead}
101: */
102: protected void doHead() {
103: servletTestModule.doHead();
104: }
105:
106: /**
107: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doPut}
108: */
109: protected void doPut() {
110: servletTestModule.doPut();
111: }
112:
113: /**
114: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doDelete}
115: */
116: protected void doDelete() {
117: servletTestModule.doDelete();
118: }
119:
120: /**
121: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doOptions}
122: */
123: protected void doOptions() {
124: servletTestModule.doOptions();
125: }
126:
127: /**
128: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doTrace}
129: */
130: protected void doTrace() {
131: servletTestModule.doTrace();
132: }
133:
134: /**
135: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#getServlet}
136: */
137: protected HttpServlet getServlet() {
138: return servletTestModule.getServlet();
139: }
140:
141: /**
142: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#createServlet(Class)}
143: */
144: protected HttpServlet createServlet(Class servletClass) {
145: return servletTestModule.createServlet(servletClass);
146: }
147:
148: /**
149: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#createFilter(Class)}
150: */
151: protected Filter createFilter(Class filterClass) {
152: return servletTestModule.createFilter(filterClass);
153: }
154:
155: /**
156: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#addFilter(Filter)}
157: */
158: protected void addFilter(Filter filter) {
159: servletTestModule.addFilter(filter);
160: }
161:
162: /**
163: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#addFilter(Filter, boolean)}
164: */
165: protected void addFilter(Filter filter, boolean doInit) {
166: servletTestModule.addFilter(filter, doInit);
167: }
168:
169: /**
170: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#releaseFilters}
171: */
172: protected void releaseFilters() {
173: servletTestModule.releaseFilters();
174: }
175:
176: /**
177: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#setDoChain(boolean)}
178: */
179: protected void setDoChain(boolean doChain) {
180: servletTestModule.setDoChain(doChain);
181: }
182:
183: /**
184: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#doFilter}
185: */
186: protected void doFilter() {
187: servletTestModule.doFilter();
188: }
189:
190: /**
191: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#getFilteredRequest}
192: */
193: protected ServletRequest getFilteredRequest() {
194: return servletTestModule.getFilteredRequest();
195: }
196:
197: /**
198: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#getFilteredResponse}
199: */
200: protected ServletResponse getFilteredResponse() {
201: return servletTestModule.getFilteredResponse();
202: }
203:
204: /**
205: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#clearOutput}
206: */
207: protected void clearOutput() {
208: servletTestModule.clearOutput();
209: }
210:
211: /**
212: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#init}
213: */
214: protected void init() {
215: servletTestModule.init();
216: }
217:
218: /**
219: * Delegates to {@link com.mockrunner.servlet.ServletTestModule#service}
220: */
221: protected void service() {
222: servletTestModule.service();
223: }
224: }
|