01: package org.springunit.examples.tutorial;
02:
03: import org.springunit.examples.CompositeDate;
04: import org.springunit.examples.InvalidDateException;
05: import org.springunit.framework.SpringUnitContext;
06: import org.springunit.framework.SpringUnitTest;
07:
08: public class CompositeDateTutorialExample2Test extends SpringUnitTest {
09:
10: public void testApr31() throws Exception {
11: runSetDayInvalidDate();
12: }
13:
14: public void testFeb29() throws Exception {
15: runSetDayInvalidDate();
16: }
17:
18: protected void runSetDayInvalidDate() throws Exception {
19: CompositeDate subject = getObject("subject");
20: int day = getObject("day");
21: try {
22: subject.setDay(day);
23: fail("Exception not thrown");
24: } catch (InvalidDateException ex) {
25: }
26: }
27:
28: public SpringUnitContext getCompositeDateTutorialExample2Test() {
29: return this .compositeDateTutorialExample2Test;
30: }
31:
32: public void setCompositeDateTutorialExample2Test(
33: SpringUnitContext compositeDateTutorialExample2Test) {
34: this .compositeDateTutorialExample2Test = compositeDateTutorialExample2Test;
35: }
36:
37: private SpringUnitContext compositeDateTutorialExample2Test;
38:
39: }
|