use of tests.support.Support_Proxy_I1 in project robovm by robovm.
the class ProxyTest method test_getInvocationHandlerLjava_lang_Object.
/**
* java.lang.reflect.Proxy#getInvocationHandler(java.lang.Object)
*/
public void test_getInvocationHandlerLjava_lang_Object() {
InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return null;
}
};
Object p = Proxy.newProxyInstance(Support_Proxy_I1.class.getClassLoader(), new Class[] { Support_Proxy_I1.class }, handler);
assertTrue("Did not return invocation handler ", Proxy.getInvocationHandler(p) == handler);
boolean aborted = false;
try {
Proxy.getInvocationHandler("");
} catch (IllegalArgumentException e) {
aborted = true;
}
assertTrue("Did not detect non proxy object ", aborted);
}
Aggregations