01: package edu.iu.uis.eden.lookupable;
02:
03: import java.lang.reflect.Field;
04: import java.util.HashMap;
05: import java.util.Iterator;
06: import java.util.Map;
07:
08: import junit.framework.TestCase;
09: import edu.iu.uis.eden.SpringServiceLocator;
10: import edu.iu.uis.eden.objectcode.ObjectCode;
11: import edu.iu.uis.eden.plugin.attributes.WorkflowLookupable;
12:
13: public class ObjectCodeTestPENDING extends TestCase {
14: private WorkflowLookupable workflowLookupable;
15: private Map conversionFields;
16:
17: protected void setUp() throws Exception {
18: SpringServiceLocator.setToTestMode(null);
19: workflowLookupable = new ObjectCodeLookupableImpl();
20:
21: conversionFields = new HashMap();
22: conversionFields.put("objectCd", "test_objectCd");
23: }
24:
25: public void testGetColumns() {
26: for (Iterator iter = workflowLookupable.getColumns().iterator(); iter
27: .hasNext();) {
28: Column column = (Column) iter.next();
29: try {
30: Field field = ObjectCode.class.getDeclaredField(column
31: .getPropertyName());
32: } catch (NoSuchFieldException e) {
33: assertTrue(
34: "Column property name on ObjectCode does not equal a property on the ObjectCode bean. Column: "
35: + column.getPropertyName(), false);
36: }
37: }
38: }
39:
40: public void testGetNoReturnParams() {
41: String parameters = workflowLookupable
42: .getNoReturnParams(conversionFields);
43:
44: assertTrue("Return parameter objectCd is not correct.",
45: parameters.indexOf("test_objectCd=") > 0);
46: }
47: }
|