1 8 package test.rtti; 9 10 import junit.framework.TestCase; 11 12 15 public class RttiTest extends TestCase { 16 17 public void testTarget() { 18 RttiTarget.LOG = new StringBuffer (""); 19 RttiTarget rttiTarget = new RttiTarget(); 20 rttiTarget.doSomething(1); 21 23 assertEquals( 24 "+Target-1.1 Target-1.1 +Target-2.2 Target-2.2 -Target-2.2 -Target-1.1 ", RttiTarget.LOG.toString() 25 ); 26 27 RttiTarget.LOG = new StringBuffer (); 28 rttiTarget = new RttiTarget(); 29 rttiTarget.doSomething(3); 30 assertEquals("+Target-3.3 Target-3.3 -Target-3.3 ", RttiTarget.LOG.toString()); 31 } 32 33 34 public static void main(String [] args) { 35 junit.textui.TestRunner.run(suite()); 36 } 37 38 public static junit.framework.Test suite() { 39 return new junit.framework.TestSuite(RttiTest.class); 40 } 41 42 43 } 44 | Popular Tags |