01: /*
02: * JBoss, Home of Professional Open Source
03: * Copyright 2005, JBoss Inc., and individual contributors as indicated
04: * by the @authors tag. See the copyright.txt in the distribution for a
05: * full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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.extender;
23:
24: /**
25: *
26: * @author <a href="stalep@conduct.no">Stale W. Pedersen</a>
27: * @version $Revision:
28: */
29: public class ExtenderTester implements ExtenderTesterMBean {
30:
31: public void testMethod() throws Exception {
32:
33: System.out
34: .println("--------------------------- TESTING EXTENDER ------------------");
35: System.out.println("MY CLASSLOADER "
36: + getClass().getClassLoader());
37: System.out.println("EXTENDER INTERCEPTOR CLASSLOADER "
38: + ExtenderInterceptor.class.getClassLoader());
39:
40: ChildBase childB = new ChildBase();
41: childB.updateBase();
42: if (!ExtenderInterceptor.method)
43: throw new RuntimeException(
44: "Expected ExtenderInterceptor.method to be true, it was: "
45: + ExtenderInterceptor.method);
46:
47: ExtenderInterceptor.method = false;
48: Base base = new SubBase();
49: base.setBase(1);
50: if (!ExtenderInterceptor.method)
51: throw new RuntimeException(
52: "Expected ExtenderInterceptor.method to be true, it was: "
53: + ExtenderInterceptor.method);
54:
55: ExtenderInterceptor.method = false;
56: ChildExtender ext = new ChildExtender();
57: ext.updateExtender();
58: if (!ExtenderInterceptor.method)
59: throw new RuntimeException(
60: "Expected ExtenderInterceptor.method to be true, it was: "
61: + ExtenderInterceptor.method);
62:
63: ExtenderInterceptor.method = false;
64: InfantBase infant = new InfantBase();
65: infant.infantize(3);
66: if (!ExtenderInterceptor.method)
67: throw new RuntimeException(
68: "Expected ExtenderInterceptor.method to be true, it was: "
69: + ExtenderInterceptor.method);
70:
71: }
72:
73: }
|