1 8 package test.adviseonintroducedinterface; 9 10 import junit.framework.TestCase; 11 12 15 public class Test extends TestCase { 16 private static String s_logString = ""; 17 18 public void testIntroducedMarkerInterface() { 19 s_logString = ""; 20 Target t = new Target(); 21 t.m1(); 22 assertEquals("before m1 ", s_logString); 23 } 24 25 public void testIntroducedImplementation() { 26 s_logString = ""; 27 Target t = new Target(); 28 ((Intf2) t).m2(); 29 assertEquals("before m2 ", s_logString); 30 } 31 32 public static void main(String [] args) { 33 junit.textui.TestRunner.run(suite()); 34 } 35 36 public static junit.framework.Test suite() { 37 return new junit.framework.TestSuite(Test.class); 38 } 39 40 public static void log(final String wasHere) { 41 s_logString += wasHere; 42 } 43 } 44 | Popular Tags |