01: package org.hanseltest;
02:
03: import junit.framework.TestCase;
04: import junit.framework.Test;
05:
06: import org.hansel.CoverageDecorator;
07:
08: /**
09: * This bug caused a java.lang.ClassCircularityError.
10: * This happened when a inner class extended the instrumented outer class.
11: * In that case the ModifyingClassLoader loaded the classes recursively
12: * again :/
13: * @author Niklas Mehner
14: */
15: public class TestBug588661 extends TestCase {
16:
17: /**
18: * Create a new Test.
19: * @param name Name of the test.
20: */
21: public TestBug588661(String name) {
22: super (name);
23: }
24:
25: /** Cover the class. */
26: public void testSomething() {
27: // This covers both constructors.
28: TestClass588661.cover();
29: }
30:
31: /**
32: * Returns the coverage test suite.
33: * @return Test suite.
34: */
35: public static Test suite() {
36: return new CoverageDecorator(TestBug588661.class,
37: new Class[] { TestClass588661.class });
38: }
39: }
|