KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > aop > scopedextender > ScopedChildParentDelegationTester


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.test.aop.scopedextender;
23
24 import org.jboss.aop.Advised;
25
26 /**
27  *
28  * @author <a HREF="kabir.khan@jboss.com">Kabir Khan</a>
29  * @version $Revision: 1.1 $
30  */

31 public class ScopedChildParentDelegationTester implements ScopedChildParentDelegationTesterMBean
32 {
33    public void testLoaders() throws Exception JavaDoc
34    {
35       System.out.println("=============== ScopedChildParentDelegationTester - LOADERS ================");
36       ClassLoader JavaDoc mine = this.getClass().getClassLoader();
37       ClassLoader JavaDoc a3 = Child_A3.class.getClassLoader();
38       ClassLoader JavaDoc base = Base_Base.class.getClassLoader();
39       
40       if (mine != a3)
41       {
42          throw new RuntimeException JavaDoc("ClassLoaders for me and Child_A3 should be the same. Mine=" + mine + "; Child_A3=" + a3);
43       }
44       
45       if (mine == base)
46       {
47          throw new RuntimeException JavaDoc("ClassLoaders for me and Base_Base should be different. Mine=" + mine + "; Base_Base=" + base);
48       }
49    }
50
51    public void testMethod() throws Exception JavaDoc
52    {
53       TestUtil testUtil = new TestUtil();
54       System.out.println("=============== ScopedChildParentDelegationTester - METHOD ================");
55       Child_A3 a3 = new Child_A3();
56       
57       clear();
58       a3.a3();
59       String JavaDoc m = "Child_A3.a3";
60       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a3", "a2", "a1", "base"}, ChildAspect.invoked);
61       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a3", "a2", "a1", "base"}, BaseAspect.invoked);
62       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a3", "a2", "a1", "base"}, BaseParentAspect.invoked);
63       
64       clear();
65       a3.overridden();
66       m = "Child_A3.overridden";
67       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"overridden"}, ChildAspect.invoked);
68       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"overridden"}, BaseAspect.invoked);
69       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"overridden"}, BaseParentAspect.invoked);
70       
71       
72       Child_A2 a2 = new Child_A2();
73       
74       clear();
75       a2.a2();
76       m = "Child_A2.a2";
77       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a2", "a1", "base"}, ChildAspect.invoked);
78       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a2", "a1", "base"}, BaseAspect.invoked);
79       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a2", "a1", "base"}, BaseParentAspect.invoked);
80       
81       clear();
82       a2.overridden();
83       m = "Child_A2.overridden";
84       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"overridden"}, ChildAspect.invoked);
85       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"overridden"}, BaseAspect.invoked);
86       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"overridden"}, BaseParentAspect.invoked);
87       
88     
89       //Base_Base is from parent/global ucl, so aspects deployed by us should not apply to its methods
90
Base_Base base = new Base_Base();
91       
92       clear();
93       base.base();
94       m = "Base_Base.base";
95       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
96       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
97       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
98       
99       clear();
100       base.overridden();
101       m = "Base_Base.overridden";
102       testUtil.compare(m, "BaseAspect", new String JavaDoc[] {"overridden"}, BaseAspect.invoked);
103       testUtil.compare(m, "ChildAspect", new String JavaDoc[] {}, ChildAspect.invoked);
104       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
105       
106     
107       //Base_A1 is from parent/global ucl, so aspects deployed by us should not apply to its methods
108
Base_A1 a1 = new Base_A1();
109
110       clear();
111       a1.a1();
112       m = "Base_A1.a1";
113       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a1", "base"}, BaseAspect.invoked);
114       testUtil.compare(m, "ChildAspect", new String JavaDoc[] {}, ChildAspect.invoked);
115       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
116       
117       clear();
118       a1.overridden();
119       m = "Base_A1.overridden";
120       testUtil.compare(m, "BaseAspect", new String JavaDoc[] {"overridden"}, BaseAspect.invoked);
121       testUtil.compare(m, "ChildAspect", new String JavaDoc[] {}, ChildAspect.invoked);
122       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
123       
124       Child_B1 b1 = new Child_B1();
125       
126       clear();
127       b1.b1();
128       m = "Child_B1.b1";
129       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b1", "base"}, ChildAspect.invoked);
130       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b1", "base"}, BaseAspect.invoked);
131       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b1", "base"}, BaseParentAspect.invoked);
132       
133       clear();
134       b1.overridden();
135       m = "Child_B1.overridden";
136       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"overridden"}, ChildAspect.invoked);
137       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"overridden"}, BaseAspect.invoked);
138       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"overridden"}, BaseParentAspect.invoked);
139       
140       Child_B2 b2 = new Child_B2();
141       
142       clear();
143       b2.b2();
144       m = "Child_B2.b2";
145       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b2", "b1", "base"}, ChildAspect.invoked);
146       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b2", "b1", "base"}, BaseAspect.invoked);
147       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b2", "b1", "base"}, BaseParentAspect.invoked);
148       
149       clear();
150       b2.overridden();
151       m = "Child_B2.overridden";
152       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"overridden"}, ChildAspect.invoked);
153       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"overridden"}, BaseAspect.invoked);
154       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"overridden"}, BaseParentAspect.invoked);
155       
156       Child_B3 b3 = new Child_B3();
157       
158       clear();
159       b3.b3();
160       m = "Child_B3.b3";
161       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b3", "b2", "b1", "base"}, ChildAspect.invoked);
162       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b3", "b2", "b1", "base"}, BaseAspect.invoked);
163       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b3", "b2", "b1", "base"}, BaseParentAspect.invoked);
164       
165       clear();
166       b3.overridden();
167       m = "Child_B3.overridden";
168       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"overridden"}, ChildAspect.invoked);
169       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"overridden"}, BaseAspect.invoked);
170       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"overridden"}, BaseParentAspect.invoked);
171
172       if (testUtil.getErrors() != null)
173       {
174          throw new RuntimeException JavaDoc(testUtil.getErrors());
175       }
176
177       if(Advised.class.isAssignableFrom(BaseNotBaseWoven.class))
178       {
179          throw new RuntimeException JavaDoc("BaseNotBaseWoven should not be woven");
180       }
181    }
182
183    public void testConstructor() throws Exception JavaDoc
184    {
185       TestUtil testUtil = new TestUtil();
186       System.out.println("=============== ScopedChildParentDelegationTester - CTOR ================");
187
188       clear();
189       Child_A3 a3 = new Child_A3();
190       testUtil.compare(a3.getClass().getName(), "ChildAspect", new String JavaDoc[]{a3.getClass().getName()}, ChildAspect.invoked);
191       testUtil.compare(a3.getClass().getName(), "BaseAspect", new String JavaDoc[]{a3.getClass().getName()}, BaseAspect.invoked);
192       testUtil.compare(a3.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{a3.getClass().getName()}, BaseParentAspect.invoked);
193       
194       clear();
195       Child_A2 a2 = new Child_A2();
196       testUtil.compare(a2.getClass().getName(), "ChildAspect", new String JavaDoc[]{a2.getClass().getName()}, ChildAspect.invoked);
197       testUtil.compare(a2.getClass().getName(), "BaseAspect", new String JavaDoc[]{a2.getClass().getName()}, BaseAspect.invoked);
198       testUtil.compare(a2.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{a2.getClass().getName()}, BaseParentAspect.invoked);
199       
200       //Base_A1 is from parent/global ucl, so aspects deployed by us should not apply to its ctors
201
clear();
202       Base_Base base = new Base_Base();
203       testUtil.compare(base.getClass().getName(), "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
204       testUtil.compare(base.getClass().getName(), "BaseAspect", new String JavaDoc[]{base.getClass().getName()}, BaseAspect.invoked);
205       testUtil.compare(base.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
206       
207     
208       //Base_A1 is from parent/global ucl, so aspects deployed by us should not apply to its ctors
209
clear();
210       Base_A1 a1 = new Base_A1();
211       testUtil.compare(a1.getClass().getName(), "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
212       testUtil.compare(a1.getClass().getName(), "BaseAspect", new String JavaDoc[]{a1.getClass().getName()}, BaseAspect.invoked);
213       testUtil.compare(a1.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
214       
215       clear();
216       Child_B1 b1 = new Child_B1();
217       testUtil.compare(b1.getClass().getName(), "ChildAspect", new String JavaDoc[]{b1.getClass().getName()}, ChildAspect.invoked);
218       testUtil.compare(b1.getClass().getName(), "BaseAspect", new String JavaDoc[]{b1.getClass().getName()}, BaseAspect.invoked);
219       testUtil.compare(b1.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{b1.getClass().getName()}, BaseParentAspect.invoked);
220       
221       clear();
222       Child_B2 b2 = new Child_B2();
223       testUtil.compare(b2.getClass().getName(), "ChildAspect", new String JavaDoc[]{b2.getClass().getName()}, ChildAspect.invoked);
224       testUtil.compare(b2.getClass().getName(), "BaseAspect", new String JavaDoc[]{b2.getClass().getName()}, BaseAspect.invoked);
225       testUtil.compare(b2.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{b2.getClass().getName()}, BaseParentAspect.invoked);
226       
227       clear();
228       Child_B3 b3 = new Child_B3();
229       testUtil.compare(b3.getClass().getName(), "ChildAspect", new String JavaDoc[]{b3.getClass().getName()}, ChildAspect.invoked);
230       testUtil.compare(b3.getClass().getName(), "BaseAspect", new String JavaDoc[]{b3.getClass().getName()}, BaseAspect.invoked);
231       testUtil.compare(b3.getClass().getName(), "BaseParentAspect", new String JavaDoc[]{b3.getClass().getName()}, BaseParentAspect.invoked);
232          
233    }
234
235    public void testField() throws Exception JavaDoc
236    {
237       TestUtil testUtil = new TestUtil();
238       System.out.println("=============== ScopedChildParentDelegationTester - FIELD ================");
239       Child_A3 a3 = new Child_A3();
240       
241       clear();
242       a3.a3 = 10;
243       String JavaDoc m = "Child_A3.a3";
244       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a3"}, ChildAspect.invoked);
245       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a3"}, BaseAspect.invoked);
246       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a3"}, BaseParentAspect.invoked);
247       
248       clear();
249       testUtil.compare(10, a3.a3);
250       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a3"}, ChildAspect.invoked);
251       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a3"}, BaseAspect.invoked);
252       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a3"}, BaseParentAspect.invoked);
253       
254       clear();
255       a3.a2 = 10;
256       m = "Child_A3.a2";
257       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a2"}, ChildAspect.invoked);
258       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a2"}, BaseAspect.invoked);
259       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a2"}, BaseParentAspect.invoked);
260       
261       clear();
262       testUtil.compare(10, a3.a2);
263       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"a2"}, ChildAspect.invoked);
264       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a2"}, BaseAspect.invoked);
265       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a2"}, BaseParentAspect.invoked);
266       
267       clear();
268       a3.a1 = 10;
269       m = "Child_A3.a1";
270       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
271       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a1"}, BaseAspect.invoked);
272       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a1"}, BaseParentAspect.invoked);
273       
274       clear();
275       testUtil.compare(10, a3.a1);
276       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
277       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a1"}, BaseAspect.invoked);
278       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"a1"}, BaseParentAspect.invoked);
279       
280       clear();
281       a3.base = 10;
282       m = "Child_A3.base";
283       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
284       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
285       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"base"}, BaseParentAspect.invoked);
286       
287       clear();
288       testUtil.compare(10, a3.base);
289       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
290       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
291       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"base"}, BaseParentAspect.invoked);
292       
293       
294       //Base_A1 is from parent/global ucl, so aspects deployed by us should not apply to its fields
295
Base_A1 a1 = new Base_A1();
296
297       clear();
298       a1.a1 = 10;
299       m = "Base_A1.a1";
300       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
301       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a1"}, BaseAspect.invoked);
302       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
303       
304       clear();
305       testUtil.compare(10, a1.a1);
306       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
307       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"a1"}, BaseAspect.invoked);
308       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
309       
310       clear();
311       a1.base = 10;
312       m = "Base_A1.base";
313       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
314       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
315       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
316       
317       clear();
318       testUtil.compare(10, a1.base);
319       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
320       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
321       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
322
323       //Base_A1 is from parent/global ucl, so aspects deployed by us should not apply to its fields
324
Base_Base base = new Base_Base();
325
326       clear();
327       base.base = 10;
328       m = "Base_Base.base";
329       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
330       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
331       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
332       
333       clear();
334       testUtil.compare(10, base.base);
335       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
336       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
337       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{}, BaseParentAspect.invoked);
338
339
340
341       Child_B3 b3 = new Child_B3();
342       
343       clear();
344       b3.b3 = 10;
345       m = "Child_B3.b3";
346       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b3"}, ChildAspect.invoked);
347       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b3"}, BaseAspect.invoked);
348       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b3"}, BaseParentAspect.invoked);
349       
350       clear();
351       testUtil.compare(10, b3.b3);
352       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b3"}, ChildAspect.invoked);
353       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b3"}, BaseAspect.invoked);
354       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b3"}, BaseParentAspect.invoked);
355       
356       clear();
357       b3.b2 = 10;
358       m = "Child_B3.b2";
359       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b2"}, ChildAspect.invoked);
360       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b2"}, BaseAspect.invoked);
361       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b2"}, BaseParentAspect.invoked);
362       
363       clear();
364       testUtil.compare(10, b3.b2);
365       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b2"}, ChildAspect.invoked);
366       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b2"}, BaseAspect.invoked);
367       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b2"}, BaseParentAspect.invoked);
368       
369       clear();
370       b3.b1 = 10;
371       m = "Child_B3.b1";
372       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b1"}, ChildAspect.invoked);
373       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b1"}, BaseAspect.invoked);
374       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b1"}, BaseParentAspect.invoked);
375       
376       clear();
377       testUtil.compare(10, b3.b1);
378       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{"b1"}, ChildAspect.invoked);
379       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"b1"}, BaseAspect.invoked);
380       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"b1"}, BaseParentAspect.invoked);
381       
382       clear();
383       b3.base = 10;
384       m = "Child_B3.base";
385       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
386       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
387       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"base"}, BaseParentAspect.invoked);
388       
389       clear();
390       testUtil.compare(10, b3.base);
391       testUtil.compare(m, "ChildAspect", new String JavaDoc[]{}, ChildAspect.invoked);
392       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"base"}, BaseAspect.invoked);
393       testUtil.compare(m, "BaseParentAspect", new String JavaDoc[]{"base"}, BaseParentAspect.invoked);
394
395       if (testUtil.getErrors() != null)
396       {
397          throw new RuntimeException JavaDoc(testUtil.getErrors());
398       }
399    }
400
401    public void testOverriddenInterceptors() throws Exception JavaDoc
402    {
403       //Not really a test per se, the real test is in the ScopedChildNoParentDelegationTester, when deployed along with the base loaded sar
404
System.out.println("=============== ScopedChildParentDelegationTester - TEST OVERRIDDEN INTERCEPTORS ================");
405       TestUtil testUtil = new TestUtil();
406       
407       Base_Base base = new Base_Base();
408       
409       clear();
410       base.differentScopes();
411       String JavaDoc m = "differentScopes";
412       testUtil.compare(m, "BaseAspect", new String JavaDoc[]{"differentScopes"}, BaseAspect.invoked);
413       testUtil.invoked(BasePerClassInterceptor.class);
414       testUtil.invoked(BasePerInstanceInterceptor.class);
415       testUtil.invoked(BasePerJoinPointInterceptor.class);
416       testUtil.invoked(BasePerClassJoinPointInterceptor.class);
417       
418       if (testUtil.getErrors() != null)
419       {
420          throw new RuntimeException JavaDoc(testUtil.getErrors());
421       }
422    }
423
424    public String JavaDoc readName()
425    {
426       return "ScopedChildParentDelegationTester";
427    }
428    
429    private void clear()
430    {
431       BaseAspect.invoked.clear();
432       ChildAspect.invoked.clear();
433       BaseParentAspect.invoked.clear();
434       BasePerClassInterceptor.invoked = false;
435       BasePerInstanceInterceptor.invoked = false;
436       BasePerJoinPointInterceptor.invoked = false;
437       BasePerClassJoinPointInterceptor.invoked = false;
438
439    }
440 }
441
Popular Tags