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.optimizations;
9
10 import junit.framework.TestCase;
11
12 /***
13 * @author <a href="mailto:alex@gnilux.com">Alexandre Vasseur</a>
14 */
15 public class OptimizeTest extends TestCase {
16
17 private static String s_log = "";
18
19 public static void log(String s) {
20 s_log += s + " ";
21 }
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58 public void testRtti() {
59 s_log = "";
60 IOptimize target = new OptimizeRtti();
61 target.before();
62 target.around();
63 target.beforeAround();
64 target.before(0);
65 target.around(0);
66 }
67
68 public static interface IOptimize {
69 public void before();
70 public void around();
71 public void beforeAround();
72 public void before(int arg);
73 public void around(int arg);
74 }
75
76 public static class OptimizeNothing implements IOptimize {
77
78 public void before() {
79 }
80
81 public void around() {
82 }
83
84 public void beforeAround() {
85 }
86
87 public void before(int arg) {
88 }
89
90 public void around(int arg) {
91 }
92 }
93
94 public static class OptimizeStaticJoinPoint implements IOptimize {
95
96 public void before() {
97 }
98
99 public void around() {
100 }
101
102 public void beforeAround() {
103 }
104
105 public void before(int arg) {
106 }
107
108 public void around(int arg) {
109 }
110 }
111
112 public static class OptimizeJoinPoint implements IOptimize {
113
114 public String toString() {return "OptimizeJoinPoint"; }
115
116 public void before() {
117 }
118
119 public void around() {
120 }
121
122 public void beforeAround() {
123 }
124
125 public void before(int arg) {
126 }
127
128 public void around(int arg) {
129 }
130 }
131
132 public static class OptimizeRtti implements IOptimize {
133
134 public String toString() {return "OptimizeRtti"; }
135
136 public void before() {
137 }
138
139 public void around() {
140 }
141
142 public void beforeAround() {
143 }
144
145 public void before(int arg) {
146 }
147
148 public void around(int arg) {
149 }
150 }
151
152 public static void main(String[] args) {
153 junit.textui.TestRunner.run(suite());
154 }
155
156 public static junit.framework.Test suite() {
157 return new junit.framework.TestSuite(OptimizeTest.class);
158 }
159
160 public String toString() {return "OptimizeTest";}
161
162 }