01: package com.mockrunner.base;
02:
03: /**
04: * Delegator for {@link WebTestModule}. The corresponding
05: * adapters extend this class. This class is used for the standard
06: * adapter versions, that extend {@link BaseTestCase}.
07: */
08: public abstract class WebTestCase extends BaseTestCase {
09: public WebTestCase() {
10:
11: }
12:
13: public WebTestCase(String arg0) {
14: super (arg0);
15: }
16:
17: /**
18: * Implemented by concrete subclasses.
19: */
20: protected abstract WebTestModule getWebTestModule();
21:
22: /**
23: * Delegates to {@link WebTestModule#addRequestParameter(String)}
24: */
25: protected void addRequestParameter(String key) {
26: getWebTestModule().addRequestParameter(key);
27: }
28:
29: /**
30: * Delegates to {@link WebTestModule#addRequestParameter(String, String)}
31: */
32: protected void addRequestParameter(String key, String value) {
33: getWebTestModule().addRequestParameter(key, value);
34: }
35:
36: /**
37: * Delegates to {@link WebTestModule#addRequestParameter(String, String[])}
38: */
39: protected void addRequestParameter(String key, String[] values) {
40: getWebTestModule().addRequestParameter(key, values);
41: }
42:
43: /**
44: * Delegates to {@link WebTestModule#getRequestParameter(String)}
45: */
46: protected String getRequestParameter(String key) {
47: return getWebTestModule().getRequestParameter(key);
48: }
49:
50: /**
51: * Delegates to {@link WebTestModule#getRequestAttribute(String)}
52: */
53: protected Object getRequestAttribute(String key) {
54: return getWebTestModule().getRequestAttribute(key);
55: }
56:
57: /**
58: * Delegates to {@link WebTestModule#setRequestAttribute(String, Object)}
59: */
60: protected void setRequestAttribute(String key, Object value) {
61: getWebTestModule().setRequestAttribute(key, value);
62: }
63:
64: /**
65: * Delegates to {@link WebTestModule#setRequestAttribute(String, Object)}
66: */
67: protected Object getSessionAttribute(String key) {
68: return getWebTestModule().getSessionAttribute(key);
69: }
70:
71: /**
72: * Delegates to {@link WebTestModule#setSessionAttribute(String, Object)}
73: */
74: protected void setSessionAttribute(String key, Object value) {
75: getWebTestModule().setSessionAttribute(key, value);
76: }
77: }
|