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.Simple; 30 import org.jboss.test.proxyfactory.support.SimpleBean; 31 import org.jboss.test.proxyfactory.support.SimpleInterceptor; 32 33 39 public class FieldTestCase extends AbstractProxyTest 40 { 41 public void testField() throws Exception 42 { 43 SimpleBean bean = new SimpleBean(); 44 Simple simple = (Simple) assertCreateProxy(bean, Simple.class); 45 SimpleInterceptor.invoked = null; 46 simple.doSomething(); 47 assertTrue(bean.invoked); 48 Method invoked = SimpleInterceptor.invoked; 49 assertNotNull(invoked); 50 assertEquals("doSomething", invoked.getName()); 51 52 assertTrue(((SimpleBean) simple).invoked); 55 } 56 57 public static Test suite() 58 { 59 return suite(FieldTestCase.class); 60 } 61 62 public FieldTestCase(String name) 63 { 64 super(name); 65 } 66 } 67 | Popular Tags |