01: package com.reeltwo.jumble.fast;
02:
03: import junit.framework.TestCase;
04:
05: /**
06: * Abstract test to test whether <CODE>JumbleResult</CODE>s. Mainly used to
07: * make sure that tests initially failing mean that nothing gets jumbled. To run
08: * this test, subclass it and override the <CODE>getJumbleResult()</CODE>
09: * method and return an array of concrete instances to be checked.
10: *
11: * @author Tin Pavlinic
12: * @version $Revision: 500 $
13: */
14: public abstract class AbstractJumbleResultTest extends TestCase {
15: public abstract JumbleResult[] getJumbleResults();
16:
17: public final void testFailedTest() {
18: JumbleResult[] res = getJumbleResults();
19:
20: for (int i = 0; i < res.length; i++) {
21: if (res[i].initialTestsPassed()) {
22: assertNotSame(null, res[i].getCovered());
23: assertNotSame(null, res[i].getMissed());
24: assertNotSame(null, res[i].getTimeouts());
25: } else {
26: assertEquals(null, res[i].getCovered());
27: assertEquals(null, res[i].getMissed());
28: assertEquals(null, res[i].getTimeouts());
29: assertEquals(0, res[i].getTimeoutLength());
30: }
31: }
32: }
33: }
|