001: package com.mockrunner.struts;
002:
003: import java.util.Locale;
004:
005: import javax.sql.DataSource;
006:
007: import org.apache.commons.validator.ValidatorResources;
008: import org.apache.struts.action.Action;
009: import org.apache.struts.action.ActionForm;
010: import org.apache.struts.action.ActionForward;
011: import org.apache.struts.action.ActionMapping;
012: import org.apache.struts.action.ActionMessage;
013: import org.apache.struts.action.ActionMessages;
014: import org.apache.struts.action.DynaActionForm;
015: import org.apache.struts.config.FormBeanConfig;
016: import org.apache.struts.util.MessageResources;
017:
018: import com.mockrunner.base.HTMLOutputModule;
019: import com.mockrunner.base.HTMLOutputTestCase;
020: import com.mockrunner.mock.web.MockActionForward;
021: import com.mockrunner.mock.web.MockActionMapping;
022: import com.mockrunner.mock.web.MockPageContext;
023:
024: /**
025: * Delegator for {@link com.mockrunner.struts.ActionTestModule}. You can
026: * subclass this adapter or use {@link com.mockrunner.struts.ActionTestModule}
027: * directly (so your test case can use another base class).
028: * This adapter extends {@link com.mockrunner.base.BaseTestCase}.
029: * It can be used if you want to use several modules in conjunction.
030: * <b>This class is generated from the {@link com.mockrunner.struts.ActionTestModule}
031: * and should not be edited directly</b>.
032: */
033: public abstract class ActionTestCaseAdapter extends HTMLOutputTestCase {
034: private ActionTestModule actionTestModule;
035:
036: public ActionTestCaseAdapter() {
037:
038: }
039:
040: public ActionTestCaseAdapter(String name) {
041: super (name);
042: }
043:
044: protected void tearDown() throws Exception {
045: super .tearDown();
046: actionTestModule = null;
047: }
048:
049: /**
050: * Creates the {@link com.mockrunner.struts.ActionTestModule}. If you
051: * overwrite this method, you must call <code>super.setUp()</code>.
052: */
053: protected void setUp() throws Exception {
054: super .setUp();
055: actionTestModule = createActionTestModule(getActionMockObjectFactory());
056: }
057:
058: /**
059: * Returns the {@link com.mockrunner.struts.ActionTestModule} as
060: * {@link com.mockrunner.base.HTMLOutputModule}.
061: * @return the {@link com.mockrunner.base.HTMLOutputModule}
062: */
063: protected HTMLOutputModule getHTMLOutputModule() {
064: return actionTestModule;
065: }
066:
067: /**
068: * Gets the {@link com.mockrunner.struts.ActionTestModule}.
069: * @return the {@link com.mockrunner.struts.ActionTestModule}
070: */
071: protected ActionTestModule getActionTestModule() {
072: return actionTestModule;
073: }
074:
075: /**
076: * Sets the {@link com.mockrunner.struts.ActionTestModule}.
077: * @param actionTestModule the {@link com.mockrunner.struts.ActionTestModule}
078: */
079: protected void setActionTestModule(ActionTestModule actionTestModule) {
080: this .actionTestModule = actionTestModule;
081: }
082:
083: /**
084: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setReset(boolean)}
085: */
086: protected void setReset(boolean reset) {
087: actionTestModule.setReset(reset);
088: }
089:
090: /**
091: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setDoPopulate(boolean)}
092: */
093: protected void setDoPopulate(boolean doPopulate) {
094: actionTestModule.setDoPopulate(doPopulate);
095: }
096:
097: /**
098: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setRecognizeMessagesInSession(boolean)}
099: */
100: protected void setRecognizeMessagesInSession(
101: boolean recognizeInSession) {
102: actionTestModule
103: .setRecognizeMessagesInSession(recognizeInSession);
104: }
105:
106: /**
107: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setMessageAttributeKey(String)}
108: */
109: protected void setMessageAttributeKey(String messageAttributeKey) {
110: actionTestModule.setMessageAttributeKey(messageAttributeKey);
111: }
112:
113: /**
114: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setErrorAttributeKey(String)}
115: */
116: protected void setErrorAttributeKey(String errorAttributeKey) {
117: actionTestModule.setErrorAttributeKey(errorAttributeKey);
118: }
119:
120: /**
121: * Delegates to {@link com.mockrunner.struts.ActionTestModule#addMappedPropertyRequestPrefix(String)}
122: */
123: protected String addMappedPropertyRequestPrefix(String property) {
124: return actionTestModule
125: .addMappedPropertyRequestPrefix(property);
126: }
127:
128: /**
129: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionMapping}
130: */
131: protected ActionMapping getActionMapping() {
132: return actionTestModule.getActionMapping();
133: }
134:
135: /**
136: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setValidate(boolean)}
137: */
138: protected void setValidate(boolean validate) {
139: actionTestModule.setValidate(validate);
140: }
141:
142: /**
143: * Delegates to {@link com.mockrunner.struts.ActionTestModule#addExceptionHandler(ExceptionHandlerConfig)}
144: */
145: protected void addExceptionHandler(ExceptionHandlerConfig handler) {
146: actionTestModule.addExceptionHandler(handler);
147: }
148:
149: /**
150: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setResources(MessageResources)}
151: */
152: protected void setResources(MessageResources resources) {
153: actionTestModule.setResources(resources);
154: }
155:
156: /**
157: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setResources(String, MessageResources)}
158: */
159: protected void setResources(String key, MessageResources resources) {
160: actionTestModule.setResources(key, resources);
161: }
162:
163: /**
164: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setDataSource(DataSource)}
165: */
166: protected void setDataSource(DataSource dataSource) {
167: actionTestModule.setDataSource(dataSource);
168: }
169:
170: /**
171: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setDataSource(String, DataSource)}
172: */
173: protected void setDataSource(String key, DataSource dataSource) {
174: actionTestModule.setDataSource(key, dataSource);
175: }
176:
177: /**
178: * Delegates to {@link com.mockrunner.struts.ActionTestModule#createValidatorResources(String[])}
179: */
180: protected ValidatorResources createValidatorResources(
181: String[] resourcesFiles) {
182: return actionTestModule
183: .createValidatorResources(resourcesFiles);
184: }
185:
186: /**
187: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setValidatorResources(ValidatorResources)}
188: */
189: protected void setValidatorResources(
190: ValidatorResources validatorResources) {
191: actionTestModule.setValidatorResources(validatorResources);
192: }
193:
194: /**
195: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyForward(String)}
196: */
197: protected void verifyForward(String path) {
198: actionTestModule.verifyForward(path);
199: }
200:
201: /**
202: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionForward}
203: */
204: protected MockActionForward getActionForward() {
205: return actionTestModule.getActionForward();
206: }
207:
208: /**
209: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyForwardName(String)}
210: */
211: protected void verifyForwardName(String name) {
212: actionTestModule.verifyForwardName(name);
213: }
214:
215: /**
216: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyRedirect(boolean)}
217: */
218: protected void verifyRedirect(boolean redirect) {
219: actionTestModule.verifyRedirect(redirect);
220: }
221:
222: /**
223: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyNoActionErrors}
224: */
225: protected void verifyNoActionErrors() {
226: actionTestModule.verifyNoActionErrors();
227: }
228:
229: /**
230: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionErrors}
231: */
232: protected ActionMessages getActionErrors() {
233: return actionTestModule.getActionErrors();
234: }
235:
236: /**
237: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyNoActionMessages}
238: */
239: protected void verifyNoActionMessages() {
240: actionTestModule.verifyNoActionMessages();
241: }
242:
243: /**
244: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionMessages}
245: */
246: protected ActionMessages getActionMessages() {
247: return actionTestModule.getActionMessages();
248: }
249:
250: /**
251: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyHasActionErrors}
252: */
253: protected void verifyHasActionErrors() {
254: actionTestModule.verifyHasActionErrors();
255: }
256:
257: /**
258: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyHasActionMessages}
259: */
260: protected void verifyHasActionMessages() {
261: actionTestModule.verifyHasActionMessages();
262: }
263:
264: /**
265: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrorPresent(String)}
266: */
267: protected void verifyActionErrorPresent(String errorKey) {
268: actionTestModule.verifyActionErrorPresent(errorKey);
269: }
270:
271: /**
272: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessagePresent(String)}
273: */
274: protected void verifyActionMessagePresent(String messageKey) {
275: actionTestModule.verifyActionMessagePresent(messageKey);
276: }
277:
278: /**
279: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrorNotPresent(String)}
280: */
281: protected void verifyActionErrorNotPresent(String errorKey) {
282: actionTestModule.verifyActionErrorNotPresent(errorKey);
283: }
284:
285: /**
286: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessageNotPresent(String)}
287: */
288: protected void verifyActionMessageNotPresent(String messageKey) {
289: actionTestModule.verifyActionMessageNotPresent(messageKey);
290: }
291:
292: /**
293: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrors(String[])}
294: */
295: protected void verifyActionErrors(String[] errorKeys) {
296: actionTestModule.verifyActionErrors(errorKeys);
297: }
298:
299: /**
300: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessages(String[])}
301: */
302: protected void verifyActionMessages(String[] messageKeys) {
303: actionTestModule.verifyActionMessages(messageKeys);
304: }
305:
306: /**
307: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrorValues(String, Object[])}
308: */
309: protected void verifyActionErrorValues(String errorKey,
310: Object[] values) {
311: actionTestModule.verifyActionErrorValues(errorKey, values);
312: }
313:
314: /**
315: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionErrorByKey(String)}
316: */
317: protected ActionMessage getActionErrorByKey(String errorKey) {
318: return actionTestModule.getActionErrorByKey(errorKey);
319: }
320:
321: /**
322: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessageValues(String, Object[])}
323: */
324: protected void verifyActionMessageValues(String messageKey,
325: Object[] values) {
326: actionTestModule.verifyActionMessageValues(messageKey, values);
327: }
328:
329: /**
330: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionMessageByKey(String)}
331: */
332: protected ActionMessage getActionMessageByKey(String messageKey) {
333: return actionTestModule.getActionMessageByKey(messageKey);
334: }
335:
336: /**
337: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrorValue(String, Object)}
338: */
339: protected void verifyActionErrorValue(String errorKey, Object value) {
340: actionTestModule.verifyActionErrorValue(errorKey, value);
341: }
342:
343: /**
344: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessageValue(String, Object)}
345: */
346: protected void verifyActionMessageValue(String messageKey,
347: Object value) {
348: actionTestModule.verifyActionMessageValue(messageKey, value);
349: }
350:
351: /**
352: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionErrorProperty(String, String)}
353: */
354: protected void verifyActionErrorProperty(String errorKey,
355: String property) {
356: actionTestModule.verifyActionErrorProperty(errorKey, property);
357: }
358:
359: /**
360: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyActionMessageProperty(String, String)}
361: */
362: protected void verifyActionMessageProperty(String messageKey,
363: String property) {
364: actionTestModule.verifyActionMessageProperty(messageKey,
365: property);
366: }
367:
368: /**
369: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyNumberActionErrors(int)}
370: */
371: protected void verifyNumberActionErrors(int number) {
372: actionTestModule.verifyNumberActionErrors(number);
373: }
374:
375: /**
376: * Delegates to {@link com.mockrunner.struts.ActionTestModule#verifyNumberActionMessages(int)}
377: */
378: protected void verifyNumberActionMessages(int number) {
379: actionTestModule.verifyNumberActionMessages(number);
380: }
381:
382: /**
383: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setActionMessages(ActionMessages)}
384: */
385: protected void setActionMessages(ActionMessages messages) {
386: actionTestModule.setActionMessages(messages);
387: }
388:
389: /**
390: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setActionMessagesToSession(ActionMessages)}
391: */
392: protected void setActionMessagesToSession(ActionMessages messages) {
393: actionTestModule.setActionMessagesToSession(messages);
394: }
395:
396: /**
397: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionMessagesFromRequest}
398: */
399: protected ActionMessages getActionMessagesFromRequest() {
400: return actionTestModule.getActionMessagesFromRequest();
401: }
402:
403: /**
404: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionMessagesFromSession}
405: */
406: protected ActionMessages getActionMessagesFromSession() {
407: return actionTestModule.getActionMessagesFromSession();
408: }
409:
410: /**
411: * Delegates to {@link com.mockrunner.struts.ActionTestModule#hasActionMessages}
412: */
413: protected boolean hasActionMessages() {
414: return actionTestModule.hasActionMessages();
415: }
416:
417: /**
418: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setActionErrors(ActionMessages)}
419: */
420: protected void setActionErrors(ActionMessages errors) {
421: actionTestModule.setActionErrors(errors);
422: }
423:
424: /**
425: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setActionErrorsToSession(ActionMessages)}
426: */
427: protected void setActionErrorsToSession(ActionMessages errors) {
428: actionTestModule.setActionErrorsToSession(errors);
429: }
430:
431: /**
432: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionErrorsFromRequest}
433: */
434: protected ActionMessages getActionErrorsFromRequest() {
435: return actionTestModule.getActionErrorsFromRequest();
436: }
437:
438: /**
439: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionErrorsFromSession}
440: */
441: protected ActionMessages getActionErrorsFromSession() {
442: return actionTestModule.getActionErrorsFromSession();
443: }
444:
445: /**
446: * Delegates to {@link com.mockrunner.struts.ActionTestModule#hasActionErrors}
447: */
448: protected boolean hasActionErrors() {
449: return actionTestModule.hasActionErrors();
450: }
451:
452: /**
453: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getMockActionMapping}
454: */
455: protected MockActionMapping getMockActionMapping() {
456: return actionTestModule.getMockActionMapping();
457: }
458:
459: /**
460: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getMockPageContext}
461: */
462: protected MockPageContext getMockPageContext() {
463: return actionTestModule.getMockPageContext();
464: }
465:
466: /**
467: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getLastAction}
468: */
469: protected Action getLastAction() {
470: return actionTestModule.getLastAction();
471: }
472:
473: /**
474: * Delegates to {@link com.mockrunner.struts.ActionTestModule#generateValidToken}
475: */
476: protected void generateValidToken() {
477: actionTestModule.generateValidToken();
478: }
479:
480: /**
481: * Delegates to {@link com.mockrunner.struts.ActionTestModule#getActionForm}
482: */
483: protected ActionForm getActionForm() {
484: return actionTestModule.getActionForm();
485: }
486:
487: /**
488: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setActionForm(ActionForm)}
489: */
490: protected void setActionForm(ActionForm formObj) {
491: actionTestModule.setActionForm(formObj);
492: }
493:
494: /**
495: * Delegates to {@link com.mockrunner.struts.ActionTestModule#createActionForm(Class)}
496: */
497: protected ActionForm createActionForm(Class form) {
498: return actionTestModule.createActionForm(form);
499: }
500:
501: /**
502: * Delegates to {@link com.mockrunner.struts.ActionTestModule#createDynaActionForm(FormBeanConfig)}
503: */
504: protected DynaActionForm createDynaActionForm(
505: FormBeanConfig formConfig) {
506: return actionTestModule.createDynaActionForm(formConfig);
507: }
508:
509: /**
510: * Delegates to {@link com.mockrunner.struts.ActionTestModule#populateRequestToForm}
511: */
512: protected void populateRequestToForm() {
513: actionTestModule.populateRequestToForm();
514: }
515:
516: /**
517: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Class, Class)}
518: */
519: protected ActionForward actionPerform(Class action, Class form) {
520: return actionTestModule.actionPerform(action, form);
521: }
522:
523: /**
524: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Class)}
525: */
526: protected ActionForward actionPerform(Class action) {
527: return actionTestModule.actionPerform(action);
528: }
529:
530: /**
531: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Action)}
532: */
533: protected ActionForward actionPerform(Action action) {
534: return actionTestModule.actionPerform(action);
535: }
536:
537: /**
538: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Action, ActionForm)}
539: */
540: protected ActionForward actionPerform(Action action, ActionForm form) {
541: return actionTestModule.actionPerform(action, form);
542: }
543:
544: /**
545: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Action, Class)}
546: */
547: protected ActionForward actionPerform(Action action, Class form) {
548: return actionTestModule.actionPerform(action, form);
549: }
550:
551: /**
552: * Delegates to {@link com.mockrunner.struts.ActionTestModule#actionPerform(Class, ActionForm)}
553: */
554: protected ActionForward actionPerform(Class action, ActionForm form) {
555: return actionTestModule.actionPerform(action, form);
556: }
557:
558: /**
559: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setLocale(Locale)}
560: */
561: protected void setLocale(Locale locale) {
562: actionTestModule.setLocale(locale);
563: }
564:
565: /**
566: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setInput(String)}
567: */
568: protected void setInput(String input) {
569: actionTestModule.setInput(input);
570: }
571:
572: /**
573: * Delegates to {@link com.mockrunner.struts.ActionTestModule#setParameter(String)}
574: */
575: protected void setParameter(String parameter) {
576: actionTestModule.setParameter(parameter);
577: }
578: }
|