KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > adviseonintroducedinterface > Test


1 /**************************************************************************************
2  * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package test.adviseonintroducedinterface;
9
10 import junit.framework.TestCase;
11
12 /**
13  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr</a>
14  */

15 public class Test extends TestCase {
16     private static String JavaDoc 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 JavaDoc[] 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 JavaDoc wasHere) {
41         s_logString += wasHere;
42     }
43 }
44
Popular Tags