1 4 package com.tc.test; 5 6 9 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) && (count <= numTests)); 23 24 if (count == numTests) { 25 if (!testSkipped) { 26 fail("Test not skipped"); 27 } 28 } 29 } 30 31 public void testNotSkipped() { 32 testSkipped = true; 33 return; 34 } 35 36 public void testSkip1() { 37 throw new RuntimeException ("should have been skipped"); 38 } 39 40 public void testSkip2() { 41 throw new RuntimeException ("should have been skipped"); 42 } 43 44 public void runBare() throws Throwable { 45 count++; 46 super.runBare(); 47 } 48 } | Popular Tags |