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.abstractclass;
9
10 import junit.framework.TestCase;
11
12 /***
13 * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
14 */
15 public class AbstractClassTest extends TestCase {
16 public AbstractClassTest(String name) {
17 super(name);
18 }
19
20 public void testInstrumentedAbstractMemberMethodInvocation() {
21 try {
22 TestAspect.s_log = "";
23 AbstractTarget target = new AbstractTargetImpl();
24 target.method1();
25 assertEquals("method1method1XX", TestAspect.s_log);
26 } catch (Exception e) {
27 fail();
28 }
29 }
30
31 public void testInstrumentedAbstractStaticMethodInvocation() {
32 try {
33 TestAspect.s_log = "";
34 AbstractTarget target = new AbstractTargetImpl();
35 target.method2();
36 assertEquals("method2method2XX", TestAspect.s_log);
37 } catch (Exception e) {
38 fail();
39 }
40 }
41
42 public void testInstrumentedAbstractImplementedMethodInvocation() {
43 try {
44 TestAspect.s_log = "";
45 AbstractTarget target = new AbstractTargetImpl();
46 target.method3();
47 assertEquals("method3XX", TestAspect.s_log);
48 } catch (Exception e) {
49 fail();
50 }
51 }
52
53 public static void main(String[] args) {
54 junit.textui.TestRunner.run(suite());
55 }
56
57 public static junit.framework.Test suite() {
58 return new junit.framework.TestSuite(AbstractClassTest.class);
59 }
60 }