01: package com.mockrunner.example.tag;
02:
03: import com.mockrunner.tag.BasicTagTestCaseAdapter;
04:
05: /**
06: * Example test for the {@link ConstrainedNumericTextTag}.
07: * Demonstrates the usage of {@link com.mockrunner.tag.TagTestModule}
08: * and {@link com.mockrunner.tag.BasicTagTestCaseAdapter}.
09: */
10: public class ConstrainedNumericTextTagTest extends
11: BasicTagTestCaseAdapter {
12: private ConstrainedNumericTextTag tag;
13:
14: protected void setUp() throws Exception {
15: super .setUp();
16: tag = (ConstrainedNumericTextTag) createTag(ConstrainedNumericTextTag.class);
17: prepareStrutsTag();
18: }
19:
20: private void prepareStrutsTag() {
21: tag.setName("test");
22: setRequestAttribute("test", "test");
23: }
24:
25: public void testOnBlurHandler() throws Exception {
26: tag.setMinValue(3);
27: tag.setMaxValue(10000);
28: doStartTag();
29: verifyOutputContains("checkConstraints(this,3,10000)");
30: }
31: }
|