1 22 package org.jboss.test.proxyfactory.test; 23 24 import java.lang.reflect.Method ; 25 26 import junit.framework.Test; 27 28 import org.jboss.test.proxyfactory.AbstractProxyTest; 29 import org.jboss.test.proxyfactory.support.SimpleBean; 30 import org.jboss.test.proxyfactory.support.SimpleInterceptor; 31 32 38 public class NonInterfaceAdvisedTestCase extends AbstractProxyTest 39 { 40 public void testSimple() throws Exception 41 { 42 SimpleInterceptor.invoked = null; 43 SimpleBean bean = new SimpleBean(); 44 SimpleBean proxy = (SimpleBean) assertCreateProxy(bean, SimpleBean.class); 45 proxy.doSomethingElse(); 46 assertTrue(bean.invoked); 47 Method invoked = SimpleInterceptor.invoked; 48 assertNotNull(invoked); 49 assertEquals("doSomethingElse", invoked.getName()); 50 } 51 52 public static Test suite() 53 { 54 return suite(NonInterfaceAdvisedTestCase.class); 55 } 56 57 public NonInterfaceAdvisedTestCase(String name) 58 { 59 super(name); 60 } 61 } 62 | Popular Tags |