01: /**************************************************************************************
02: * Copyright (c) Jonas Bon?r, Alexandre Vasseur. All rights reserved. *
03: * http://aspectwerkz.codehaus.org *
04: * ---------------------------------------------------------------------------------- *
05: * The software in this package is published under the terms of the LGPL license *
06: * a copy of which has been included with this distribution in the license.txt file. *
07: **************************************************************************************/package test.rtti;
08:
09: import junit.framework.TestCase;
10:
11: /**
12: * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur</a>
13: */
14: public class RttiTest extends TestCase {
15:
16: public void testTarget() {
17: RttiTarget.LOG = new StringBuffer("");
18: RttiTarget rttiTarget = new RttiTarget();
19: rttiTarget.doSomething(1);
20: // will have a nested call to another instance of target, with arg0 = 2
21:
22: assertEquals(
23: "+Target-1.1 Target-1.1 +Target-2.2 Target-2.2 -Target-2.2 -Target-1.1 ",
24: RttiTarget.LOG.toString());
25:
26: RttiTarget.LOG = new StringBuffer();
27: rttiTarget = new RttiTarget();
28: rttiTarget.doSomething(3);
29: assertEquals("+Target-3.3 Target-3.3 -Target-3.3 ",
30: RttiTarget.LOG.toString());
31: }
32:
33: public static void main(String[] args) {
34: junit.textui.TestRunner.run(suite());
35: }
36:
37: public static junit.framework.Test suite() {
38: return new junit.framework.TestSuite(RttiTest.class);
39: }
40:
41: }
|