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.account.Account;
11: import edu.iu.uis.eden.plugin.attributes.WorkflowLookupable;
12:
13: public class AccountTestPENDING extends TestCase {
14: private WorkflowLookupable workflowLookupable;
15: private Map conversionFields;
16:
17: protected void setUp() throws Exception {
18: SpringServiceLocator.setToTestMode(null);
19: workflowLookupable = new AccountLookupableImpl();
20:
21: conversionFields = new HashMap();
22: conversionFields.put("accountNbr", "test_accountNbr");
23: conversionFields.put("fin_coa_cd", "test_fin_coa_cd");
24: }
25:
26: public void testGetColumns() {
27: for (Iterator iter = workflowLookupable.getColumns().iterator(); iter
28: .hasNext();) {
29: Column column = (Column) iter.next();
30: try {
31: Field field = Account.class.getDeclaredField(column
32: .getPropertyName());
33: } catch (NoSuchFieldException e) {
34: assertTrue(
35: "Column property name on Account does not equal a property on the Account bean. Column: "
36: + column.getPropertyName(), false);
37: }
38: }
39: }
40:
41: public void testGetNoReturnParams() {
42: String parameters = workflowLookupable
43: .getNoReturnParams(conversionFields);
44:
45: assertTrue("Return parameter accountNbr is not correct.",
46: parameters.indexOf("test_accountNbr=") > 0);
47: assertTrue("Return parameter fin_coa_cd is not correct.",
48: parameters.indexOf("test_fin_coa_cd=") > 0);
49:
50: }
51:
52: }
|