org.kuali.student.common.test.mock
Class MockProxy
java.lang.Object
org.kuali.student.common.test.mock.MockProxy
- All Implemented Interfaces:
- InvocationHandler
Deprecated.
@Deprecated
public class MockProxy
- extends Object
- implements InvocationHandler
- Author:
- Daniel Epstein
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MockProxy
public MockProxy()
- Deprecated.
newInstance
public static <T> T newInstance(Map<String,Object> methodReturnMap,
Class<T> interfaceClass)
throws InstantiationException,
IllegalAccessException
- Deprecated.
- Creates a new instance of an object that implements the interface you pass it.
The Map contains a map of method names to return values.
If a method is not in the map, then invoking that method will return null
Example:
Map methodReturnMap = new HashMap();
MyInterface myObject = MockProxy.newInstance(map, MyInterface.class);
map.put("foo", "NEW RETRUN VALUE");
System.out.println(myObject.foo()); // Outputs "NEW RETRUN VALUE"
- Type Parameters:
T
- - Parameters:
methodReturnMap
- interfaceClass
-
- Returns:
-
- Throws:
InstantiationException
IllegalAccessException
invoke
public Object invoke(Object proxy,
Method method,
Object[] args)
throws Throwable
- Deprecated.
- Specified by:
invoke
in interface InvocationHandler
- Throws:
Throwable
Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.