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