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