01: package org.springunit.examples;
02:
03: import org.springunit.framework.SpringUnitContext;
04: import org.springunit.framework.SpringUnitTest;
05:
06: public abstract class RangeSpringUnitTestAbstract<T extends Comparable<T>>
07: extends SpringUnitTest {
08:
09: public SpringUnitContext getRangeSpringUnitTestAbstract() {
10: return this .rangeSpringUnitTestAbstract;
11: }
12:
13: public void setRangeSpringUnitTestAbstract(
14: SpringUnitContext rangeSpringUnitTestAbstract) {
15: this .rangeSpringUnitTestAbstract = rangeSpringUnitTestAbstract;
16: }
17:
18: public void testIsWithinBelowLower() throws Exception {
19: runIsWithin();
20: }
21:
22: public void testIsWithinAtLower() throws Exception {
23: runIsWithin();
24: }
25:
26: public void testIsWithinBetween() throws Exception {
27: runIsWithin();
28: }
29:
30: public void testIsWithinAtUpper() throws Exception {
31: runIsWithin();
32: }
33:
34: public void testIsWithinAboveUpper() throws Exception {
35: runIsWithin();
36: }
37:
38: protected void runIsWithin() throws Exception {
39: Range<T> subject = getObject("subject");
40: T item = getObject("item");
41: boolean expected = (Boolean) getObject("expected");
42: boolean actual = subject.isWithin(item);
43: assertEquals(expected, actual);
44: }
45:
46: private SpringUnitContext rangeSpringUnitTestAbstract;
47:
48: }
|