1 package org.hanseltest; 2 3 import junit.framework.TestCase; 4 import junit.framework.TestResult; 5 6 import org.hansel.CoverageDecorator; 7 import org.hansel.Util; 8 9 14 public class TestClassLiteral extends TestCase { 15 16 private static final Class [] COVERED = {CoverClassLiteral.class}; 17 18 22 public TestClassLiteral(String name) { 23 super(name); 24 } 25 26 29 public void testFullCoverage() { 30 CoverageDecorator cd = 31 new CoverageDecorator(FullCoverage.class, 32 COVERED); 33 34 TestResult result = new TestResult(); 35 cd.run(result); 36 37 Util.dumpResult(result); 38 assertEquals(0, result.failureCount()); 40 41 assertEquals(0, result.errorCount()); 43 } 44 45 46 public static class FullCoverage extends TestCase { 47 51 public FullCoverage(String name) { 52 super(name); 53 } 54 55 56 public void testAll() { 57 CoverClassLiteral ccl = new CoverClassLiteral(); 58 assertEquals("org.hanseltest.CoverClassLiteral", 59 ccl.getClassName()); 60 } 61 } 62 63 } 64 | Popular Tags |