1 package org.hanseltest; 2 3 import junit.framework.TestCase; 4 import junit.framework.TestResult; 5 6 import org.hansel.CoverageDecorator; 7 8 12 public class TestSwitchBug extends TestCase { 13 14 private static final Class [] COVERED = {CoverSwitchBug.class}; 15 16 public void testBug() { 17 CoverageDecorator cd = new CoverageDecorator(FullCoverage.class, 18 COVERED); 19 20 TestResult result = new TestResult(); 21 cd.run(result); 22 23 assertEquals(0, result.failureCount()); 24 } 25 26 27 public static class FullCoverage extends TestCase { 28 29 public void testCase() { 30 CoverSwitchBug coverSwitchbug = new CoverSwitchBug(); 31 coverSwitchbug.aCase(-1); 32 coverSwitchbug.aCase(1); 33 coverSwitchbug.aCase(2); 34 } 35 } 36 37 } 38 | Popular Tags |