package org.mockejb.interceptor.test;
import junit.framework.TestCase;
import org.mockejb.interceptor.*;
public class InterceptableProxyTest extends TestCase {
public void testInterfaceProxy() throws Exception{
TestIface proxy = (TestIface) InterceptableProxy.create( TestIface.class, new TestImpl() );
assertEquals( "test", proxy.echo("test") );
}
public void testClassProxy() throws Exception{
InterceptableTestClass proxy = (InterceptableTestClass)
InterceptableProxy.create( InterceptableTestClass.class, new TestImpl() );
assertEquals( "test", proxy.echo("test") );
proxy = (InterceptableTestClass)
InterceptableProxy.create( InterceptableTestClass.class, new InterceptableTestClass() );
assertEquals( "test", proxy.echo("test") );
}
}