01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.test;
05:
06: /**
07: * Test that single test cases can be disabled
08: */
09: public class TCTestCaseDisableSingleTest extends TCTestCase {
10: static final int numTests = 3;
11: static int count = 0;
12: static boolean testSkipped = false;
13:
14: public TCTestCaseDisableSingleTest() {
15: disableTestUntil("testSkip1", "3000-01-01");
16: disableTestUntil("testSkip2", "3000-01-01");
17: }
18:
19: protected void tearDown() throws Exception {
20: super .tearDown();
21:
22: assertTrue("count is " + count, (count > 0)
23: && (count <= numTests));
24:
25: if (count == numTests) {
26: if (!testSkipped) {
27: fail("Test not skipped");
28: }
29: }
30: }
31:
32: public void testNotSkipped() {
33: testSkipped = true;
34: return;
35: }
36:
37: public void testSkip1() {
38: throw new RuntimeException("should have been skipped");
39: }
40:
41: public void testSkip2() {
42: throw new RuntimeException("should have been skipped");
43: }
44:
45: public void runBare() throws Throwable {
46: count++;
47: super.runBare();
48: }
49: }
|