View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.common.test.mock;
17  
18  import java.util.Map;
19  
20  import org.springframework.beans.factory.FactoryBean;
21  
22  @Deprecated
23  public class MockProxyFactoryBean implements FactoryBean {
24  	private Class<?> interfaceClass;
25  	private Map<String,Object> methodReturnMap;
26  
27  	@Override
28  	public Object getObject() throws Exception {
29  		return MockProxy.newInstance(methodReturnMap, interfaceClass);
30  	}
31  
32  	@Override
33  	public Class<?> getObjectType() {
34  		return interfaceClass;
35  	}
36  
37  	@Override
38  	public boolean isSingleton() {
39  		return false;
40  	}
41  
42  	/**
43  	 * @return the interfaceClass
44  	 */
45  	public Class<?> getInterfaceClass() {
46  		return interfaceClass;
47  	}
48  
49  	/**
50  	 * @param interfaceClass the interfaceClass to set
51  	 */
52  	public void setInterfaceClass(Class<?> interfaceClass) {
53  		this.interfaceClass = interfaceClass;
54  	}
55  
56  	/**
57  	 * @return the methodReturnMap
58  	 */
59  	public Map<String, Object> getMethodReturnMap() {
60  		return methodReturnMap;
61  	}
62  
63  	/**
64  	 * @param methodReturnMap the methodReturnMap to set
65  	 */
66  	public void setMethodReturnMap(Map<String, Object> methodReturnMap) {
67  		this.methodReturnMap = methodReturnMap;
68  	}
69  
70  }