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.fiscalsub.FiscalSubAccount;
11: import edu.iu.uis.eden.plugin.attributes.WorkflowLookupable;
12:
13: public class SubAccountLookupableImplTestPENDING extends TestCase {
14: private WorkflowLookupable workflowLookupable;
15: private Map conversionFields;
16:
17: protected void setUp() throws Exception {
18: SpringServiceLocator.setToTestMode(null);
19: workflowLookupable = new SubAccountLookupableImpl();
20:
21: conversionFields = new HashMap();
22: conversionFields.put("fin_coa_cd", "test_fin_coa_cd");
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 = FiscalSubAccount.class
31: .getDeclaredField(column.getPropertyName());
32: } catch (NoSuchFieldException e) {
33: assertTrue(
34: "Column property name on SubAccountLookupableImpl does not equal a property on the FiscalSubAccount 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 chart is not correct.", parameters
45: .indexOf("test_fin_coa_cd=") > 0);
46: assertTrue("Return parameter account is not correct.",
47: parameters.indexOf("account_nbr=") > 0);
48: assertTrue("Return parameter subaccount is not correct.",
49: parameters.indexOf("sub_acct_nbr=") > 0);
50: }
51: }
|