1 22 package org.jboss.test.aop.regression.statictest; 23 24 25 import org.jboss.test.aop.AOPTestWithSetup; 26 27 import junit.framework.Test; 28 import junit.framework.TestSuite; 29 30 36 public class AOPTester extends AOPTestWithSetup 37 { 38 public static Test suite() 39 { 40 TestSuite suite = new TestSuite("AOPTester"); 41 suite.addTestSuite(AOPTester.class); 42 return suite; 43 } 44 45 public AOPTester(String name) 46 { 47 super(name); 48 } 49 50 public void testRegression() 51 { 52 MemberOnly mo = new MemberOnly(); 53 SimpleInterceptor.called = false; 54 mo.memberMethod(); 55 if (SimpleInterceptor.called != true) throw new RuntimeException ("MemberOnly did not get intercepted"); 56 SimpleInterceptor.called = false; 57 MemberOnly.staticMethod(); 58 if (SimpleInterceptor.called == true) throw new RuntimeException ("MemberOnly static method DID get intercepted"); 59 60 StaticOnly so = new StaticOnly(); 61 SimpleInterceptor.called = false; 62 so.memberMethod(); 63 if (SimpleInterceptor.called == true) throw new RuntimeException ("StaticOnly member method got intercepted!"); 64 SimpleInterceptor.called = false; 65 StaticOnly.staticMethod(); 66 if (SimpleInterceptor.called == false) throw new RuntimeException ("StaticOnly static method DID NOT get intercepted"); 67 68 } 69 70 } 71 72 | Popular Tags |