001: package org.springunit.examples;
002:
003: import org.springunit.framework.SpringUnitContext;
004: import org.springunit.framework.SpringUnitTest;
005:
006: public class CompositeDateTimeSpringUnitTest extends SpringUnitTest {
007:
008: public SpringUnitContext getCompositeDateTimeSpringUnitTest() {
009: return this .compositeDateTimeSpringUnitTest;
010: }
011:
012: public void setCompositeDateTimeSpringUnitTest(
013: SpringUnitContext compositeDateTimeSpringUnitTest) {
014: this .compositeDateTimeSpringUnitTest = compositeDateTimeSpringUnitTest;
015: }
016:
017: public void testConstructor20060101_000000000() throws Exception {
018: runConstructor();
019: }
020:
021: public void testConstructorMaxValue1231_235959999()
022: throws Exception {
023: runConstructor();
024: }
025:
026: public void testConstructorMinValue0101_000000000()
027: throws Exception {
028: runConstructor();
029: }
030:
031: public void testIncrementMillis20060101_235959999()
032: throws Exception {
033: runIncrementMillis();
034: }
035:
036: public void testIncrementMillis20060131_235959999()
037: throws Exception {
038: runIncrementMillis();
039: }
040:
041: public void testIncrementMillis20060228_235959999()
042: throws Exception {
043: runIncrementMillis();
044: }
045:
046: public void testIncrementMillis20040228_235959999()
047: throws Exception {
048: runIncrementMillis();
049: }
050:
051: public void testIncrementMillis20000228_235959999()
052: throws Exception {
053: runIncrementMillis();
054: }
055:
056: public void testIncrementMillis19000228_235959999()
057: throws Exception {
058: runIncrementMillis();
059: }
060:
061: public void testIncrementMillis20061231_235959999()
062: throws Exception {
063: runIncrementMillis();
064: }
065:
066: public void testIncrementMillisMaxValue1231_235959999()
067: throws Exception {
068: runIncrementMillis();
069: }
070:
071: public void testIncrementSeconds20060101_235959999()
072: throws Exception {
073: runIncrementSeconds();
074: }
075:
076: public void testIncrementSeconds20060131_235959999()
077: throws Exception {
078: runIncrementSeconds();
079: }
080:
081: public void testIncrementSeconds20060228_235959999()
082: throws Exception {
083: runIncrementSeconds();
084: }
085:
086: public void testIncrementSeconds20040228_235959999()
087: throws Exception {
088: runIncrementSeconds();
089: }
090:
091: public void testIncrementSeconds20000228_235959999()
092: throws Exception {
093: runIncrementSeconds();
094: }
095:
096: public void testIncrementSeconds19000228_235959999()
097: throws Exception {
098: runIncrementSeconds();
099: }
100:
101: public void testIncrementSeconds20061231_235959999()
102: throws Exception {
103: runIncrementSeconds();
104: }
105:
106: public void testIncrementSecondsMaxValue1231_235959999()
107: throws Exception {
108: runIncrementSeconds();
109: }
110:
111: public void testIncrementMinutes20060101_235959999()
112: throws Exception {
113: runIncrementMinutes();
114: }
115:
116: public void testIncrementMinutes20060131_235959999()
117: throws Exception {
118: runIncrementMinutes();
119: }
120:
121: public void testIncrementMinutes20060228_235959999()
122: throws Exception {
123: runIncrementMinutes();
124: }
125:
126: public void testIncrementMinutes20040228_235959999()
127: throws Exception {
128: runIncrementMinutes();
129: }
130:
131: public void testIncrementMinutes20000228_235959999()
132: throws Exception {
133: runIncrementMinutes();
134: }
135:
136: public void testIncrementMinutes19000228_235959999()
137: throws Exception {
138: runIncrementMinutes();
139: }
140:
141: public void testIncrementMinutes20061231_235959999()
142: throws Exception {
143: runIncrementMinutes();
144: }
145:
146: public void testIncrementMinutesMaxValue1231_235959999()
147: throws Exception {
148: runIncrementMinutes();
149: }
150:
151: public void testIncrementHours20060101_235959999() throws Exception {
152: runIncrementHours();
153: }
154:
155: public void testIncrementHours20060131_235959999() throws Exception {
156: runIncrementHours();
157: }
158:
159: public void testIncrementHours20060228_235959999() throws Exception {
160: runIncrementHours();
161: }
162:
163: public void testIncrementHours20040228_235959999() throws Exception {
164: runIncrementHours();
165: }
166:
167: public void testIncrementHours20000228_235959999() throws Exception {
168: runIncrementHours();
169: }
170:
171: public void testIncrementHours19000228_235959999() throws Exception {
172: runIncrementHours();
173: }
174:
175: public void testIncrementHours20061231_235959999() throws Exception {
176: runIncrementHours();
177: }
178:
179: public void testIncrementHoursMaxValue1231_235959999()
180: throws Exception {
181: runIncrementHours();
182: }
183:
184: public void testIncrementDayMaxValue1231_235959999()
185: throws Exception {
186: runIncrementDay();
187: }
188:
189: public void testIncrementMonthMaxValue1231_235959999()
190: throws Exception {
191: runIncrementMonth();
192: }
193:
194: public void testIncrementYearMaxValue1231_235959999()
195: throws Exception {
196: runIncrementYear();
197: }
198:
199: public void testDecrementMillis20060201_000000000()
200: throws Exception {
201: runDecrementMillis();
202: }
203:
204: public void testDecrementMillis20060301_000000000()
205: throws Exception {
206: runDecrementMillis();
207: }
208:
209: public void testDecrementMillis20040301_000000000()
210: throws Exception {
211: runDecrementMillis();
212: }
213:
214: public void testDecrementMillis20000301_000000000()
215: throws Exception {
216: runDecrementMillis();
217: }
218:
219: public void testDecrementMillis19000301_000000000()
220: throws Exception {
221: runDecrementMillis();
222: }
223:
224: public void testDecrementMillis20060101_000000000()
225: throws Exception {
226: runDecrementMillis();
227: }
228:
229: public void testDecrementMillisMinValue0101_000000000()
230: throws Exception {
231: runDecrementMillis();
232: }
233:
234: public void testDecrementSeconds20060201_000000000()
235: throws Exception {
236: runDecrementSeconds();
237: }
238:
239: public void testDecrementSeconds20060301_000000000()
240: throws Exception {
241: runDecrementSeconds();
242: }
243:
244: public void testDecrementSeconds20040301_000000000()
245: throws Exception {
246: runDecrementSeconds();
247: }
248:
249: public void testDecrementSeconds20000301_000000000()
250: throws Exception {
251: runDecrementSeconds();
252: }
253:
254: public void testDecrementSeconds19000301_000000000()
255: throws Exception {
256: runDecrementSeconds();
257: }
258:
259: public void testDecrementSeconds20060101_000000000()
260: throws Exception {
261: runDecrementSeconds();
262: }
263:
264: public void testDecrementSecondsMinValue0101_000000000()
265: throws Exception {
266: runDecrementSeconds();
267: }
268:
269: public void testDecrementMinutes20060201_000000000()
270: throws Exception {
271: runDecrementMinutes();
272: }
273:
274: public void testDecrementMinutes20060301_000000000()
275: throws Exception {
276: runDecrementMinutes();
277: }
278:
279: public void testDecrementMinutes20040301_000000000()
280: throws Exception {
281: runDecrementMinutes();
282: }
283:
284: public void testDecrementMinutes20000301_000000000()
285: throws Exception {
286: runDecrementMinutes();
287: }
288:
289: public void testDecrementMinutes19000301_000000000()
290: throws Exception {
291: runDecrementMinutes();
292: }
293:
294: public void testDecrementMinutes20060101_000000000()
295: throws Exception {
296: runDecrementMinutes();
297: }
298:
299: public void testDecrementMinutesMinValue0101_000000000()
300: throws Exception {
301: runDecrementMinutes();
302: }
303:
304: public void testDecrementHours20060201_000000000() throws Exception {
305: runDecrementHours();
306: }
307:
308: public void testDecrementHours20060301_000000000() throws Exception {
309: runDecrementHours();
310: }
311:
312: public void testDecrementHours20040301_000000000() throws Exception {
313: runDecrementHours();
314: }
315:
316: public void testDecrementHours20000301_000000000() throws Exception {
317: runDecrementHours();
318: }
319:
320: public void testDecrementHours19000301_000000000() throws Exception {
321: runDecrementHours();
322: }
323:
324: public void testDecrementHours20060101_000000000() throws Exception {
325: runDecrementHours();
326: }
327:
328: public void testDecrementHoursMinValue0101_000000000()
329: throws Exception {
330: runDecrementHours();
331: }
332:
333: public void testDecrementDayMinValue0101_000000000()
334: throws Exception {
335: runDecrementDay();
336: }
337:
338: public void testDecrementMonthMinValue0101_000000000()
339: throws Exception {
340: runDecrementMonth();
341: }
342:
343: public void testDecrementYearMinValue0101_000000000()
344: throws Exception {
345: runDecrementYear();
346: }
347:
348: protected void runConstructor() throws Exception {
349: CompositeDate date = getObject("date");
350: CompositeTime time = getObject("time");
351: Exception expectedException = getObject("expectedException");
352: try {
353: CompositeDateTime subject = new CompositeDateTime(date,
354: time);
355: if (expectedException != null) {
356: fail("Exception not thrown");
357: }
358: CompositeDate expectedDate = getObject("expectedDate");
359: CompositeTime expectedTime = getObject("expectedTime");
360: assertEquals(expectedDate, subject.getDate());
361: assertEquals(expectedTime, subject.getTime());
362: } catch (Exception ex) {
363: if (expectedException == null) {
364: throw ex;
365: } else {
366: assertTrue(expectedException.getClass()
367: .isAssignableFrom(ex.getClass()));
368: }
369: }
370: }
371:
372: protected void runIncrementMillis() throws Exception {
373: CompositeDateTime subject = getObject("subject");
374: CompositeDateTime expected = getObject("expected");
375: Exception expectedException = getObject("expectedException");
376: try {
377: subject.incrementMillis();
378: if (expectedException != null) {
379: fail("Exception not thrown");
380: }
381: assertEquals(expected, subject);
382: } catch (Exception ex) {
383: if (expectedException == null) {
384: throw ex;
385: } else {
386: assertTrue(expectedException.getClass()
387: .isAssignableFrom(ex.getClass()));
388: }
389: }
390: }
391:
392: protected void runIncrementSeconds() throws Exception {
393: CompositeDateTime subject = getObject("subject");
394: CompositeDateTime expected = getObject("expected");
395: Exception expectedException = getObject("expectedException");
396: try {
397: subject.incrementSeconds();
398: if (expectedException != null) {
399: fail("Exception not thrown");
400: }
401: assertEquals(expected, subject);
402: } catch (Exception ex) {
403: if (expectedException == null) {
404: throw ex;
405: } else {
406: assertTrue(expectedException.getClass()
407: .isAssignableFrom(ex.getClass()));
408: }
409: }
410: }
411:
412: protected void runIncrementMinutes() throws Exception {
413: CompositeDateTime subject = getObject("subject");
414: CompositeDateTime expected = getObject("expected");
415: Exception expectedException = getObject("expectedException");
416: try {
417: subject.incrementMinutes();
418: if (expectedException != null) {
419: fail("Exception not thrown");
420: }
421: assertEquals(expected, subject);
422: } catch (Exception ex) {
423: if (expectedException == null) {
424: throw ex;
425: } else {
426: assertTrue(expectedException.getClass()
427: .isAssignableFrom(ex.getClass()));
428: }
429: }
430: }
431:
432: protected void runIncrementHours() throws Exception {
433: CompositeDateTime subject = getObject("subject");
434: CompositeDateTime expected = getObject("expected");
435: Exception expectedException = getObject("expectedException");
436: try {
437: subject.incrementHours();
438: if (expectedException != null) {
439: fail("Exception not thrown");
440: }
441: assertEquals(expected, subject);
442: } catch (Exception ex) {
443: if (expectedException == null) {
444: throw ex;
445: } else {
446: assertTrue(expectedException.getClass()
447: .isAssignableFrom(ex.getClass()));
448: }
449: }
450: }
451:
452: protected void runIncrementDay() throws Exception {
453: CompositeDateTime subject = getObject("subject");
454: CompositeDateTime expected = getObject("expected");
455: Exception expectedException = getObject("expectedException");
456: try {
457: subject.incrementDay();
458: if (expectedException != null) {
459: fail("Exception not thrown");
460: }
461: assertEquals(expected, subject);
462: } catch (Exception ex) {
463: if (expectedException == null) {
464: throw ex;
465: } else {
466: assertTrue(expectedException.getClass()
467: .isAssignableFrom(ex.getClass()));
468: }
469: }
470: }
471:
472: protected void runIncrementMonth() throws Exception {
473: CompositeDateTime subject = getObject("subject");
474: CompositeDateTime expected = getObject("expected");
475: Exception expectedException = getObject("expectedException");
476: try {
477: subject.incrementMonth();
478: if (expectedException != null) {
479: fail("Exception not thrown");
480: }
481: assertEquals(expected, subject);
482: } catch (Exception ex) {
483: if (expectedException == null) {
484: throw ex;
485: } else {
486: assertTrue(expectedException.getClass()
487: .isAssignableFrom(ex.getClass()));
488: }
489: }
490: }
491:
492: protected void runIncrementYear() throws Exception {
493: CompositeDateTime subject = getObject("subject");
494: CompositeDateTime expected = getObject("expected");
495: Exception expectedException = getObject("expectedException");
496: try {
497: subject.incrementYear();
498: if (expectedException != null) {
499: fail("Exception not thrown");
500: }
501: assertEquals(expected, subject);
502: } catch (Exception ex) {
503: if (expectedException == null) {
504: throw ex;
505: } else {
506: assertTrue(expectedException.getClass()
507: .isAssignableFrom(ex.getClass()));
508: }
509: }
510: }
511:
512: protected void runDecrementMillis() throws Exception {
513: CompositeDateTime subject = getObject("subject");
514: CompositeDateTime expected = getObject("expected");
515: Exception expectedException = getObject("expectedException");
516: try {
517: subject.decrementMillis();
518: if (expectedException != null) {
519: fail("Exception not thrown");
520: }
521: assertEquals(expected, subject);
522: } catch (Exception ex) {
523: if (expectedException == null) {
524: throw ex;
525: } else {
526: assertTrue(expectedException.getClass()
527: .isAssignableFrom(ex.getClass()));
528: }
529: }
530: }
531:
532: protected void runDecrementSeconds() throws Exception {
533: CompositeDateTime subject = getObject("subject");
534: CompositeDateTime expected = getObject("expected");
535: Exception expectedException = getObject("expectedException");
536: try {
537: subject.decrementSeconds();
538: if (expectedException != null) {
539: fail("Exception not thrown");
540: }
541: assertEquals(expected, subject);
542: } catch (Exception ex) {
543: if (expectedException == null) {
544: throw ex;
545: } else {
546: assertTrue(expectedException.getClass()
547: .isAssignableFrom(ex.getClass()));
548: }
549: }
550: }
551:
552: protected void runDecrementMinutes() throws Exception {
553: CompositeDateTime subject = getObject("subject");
554: CompositeDateTime expected = getObject("expected");
555: Exception expectedException = getObject("expectedException");
556: try {
557: subject.decrementMinutes();
558: if (expectedException != null) {
559: fail("Exception not thrown");
560: }
561: assertEquals(expected, subject);
562: } catch (Exception ex) {
563: if (expectedException == null) {
564: throw ex;
565: } else {
566: assertTrue(expectedException.getClass()
567: .isAssignableFrom(ex.getClass()));
568: }
569: }
570: }
571:
572: protected void runDecrementHours() throws Exception {
573: CompositeDateTime subject = getObject("subject");
574: CompositeDateTime expected = getObject("expected");
575: Exception expectedException = getObject("expectedException");
576: try {
577: subject.decrementHours();
578: if (expectedException != null) {
579: fail("Exception not thrown");
580: }
581: assertEquals(expected, subject);
582: } catch (Exception ex) {
583: if (expectedException == null) {
584: throw ex;
585: } else {
586: assertTrue(expectedException.getClass()
587: .isAssignableFrom(ex.getClass()));
588: }
589: }
590: }
591:
592: protected void runDecrementDay() throws Exception {
593: CompositeDateTime subject = getObject("subject");
594: CompositeDateTime expected = getObject("expected");
595: Exception expectedException = getObject("expectedException");
596: try {
597: subject.decrementDay();
598: if (expectedException != null) {
599: fail("Exception not thrown");
600: }
601: assertEquals(expected, subject);
602: } catch (Exception ex) {
603: if (expectedException == null) {
604: throw ex;
605: } else {
606: assertTrue(expectedException.getClass()
607: .isAssignableFrom(ex.getClass()));
608: }
609: }
610: }
611:
612: protected void runDecrementMonth() throws Exception {
613: CompositeDateTime subject = getObject("subject");
614: CompositeDateTime expected = getObject("expected");
615: Exception expectedException = getObject("expectedException");
616: try {
617: subject.decrementMonth();
618: if (expectedException != null) {
619: fail("Exception not thrown");
620: }
621: assertEquals(expected, subject);
622: } catch (Exception ex) {
623: if (expectedException == null) {
624: throw ex;
625: } else {
626: assertTrue(expectedException.getClass()
627: .isAssignableFrom(ex.getClass()));
628: }
629: }
630: }
631:
632: protected void runDecrementYear() throws Exception {
633: CompositeDateTime subject = getObject("subject");
634: CompositeDateTime expected = getObject("expected");
635: Exception expectedException = getObject("expectedException");
636: try {
637: subject.decrementYear();
638: if (expectedException != null) {
639: fail("Exception not thrown");
640: }
641: assertEquals(expected, subject);
642: } catch (Exception ex) {
643: if (expectedException == null) {
644: throw ex;
645: } else {
646: assertTrue(expectedException.getClass()
647: .isAssignableFrom(ex.getClass()));
648: }
649: }
650: }
651:
652: private SpringUnitContext compositeDateTimeSpringUnitTest;
653:
654: }
|