import org.apache.tuscany.spi.wire.WireInvocationHandler;
public class RemoteMethodHandlerTestCase extends TestCase {
public void testIntercept() throws SecurityException, NoSuchMethodException, Throwable {
WireInvocationHandler h2 = createMock(WireInvocationHandler.class);
Method method = Runnable.class.getDeclaredMethod("run", new Class[]{});
Object[] noArgs = new Object[]{};
expect(h2.invoke(method, noArgs)).andReturn("foo");
replay(h2);
RemoteMethodHandler handler = new RemoteMethodHandler(h2, Runnable.class);
Object o = handler.intercept(null, method, noArgs, null);
assertEquals("foo", o);
}