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.List;
07: import java.util.Map;
08:
09: import junit.framework.TestCase;
10: import edu.iu.uis.eden.SpringServiceLocator; //import edu.iu.uis.eden.fiscalorg.FiscalOrganization;
11: import edu.iu.uis.eden.plugin.attributes.WorkflowLookupable;
12:
13: public class ChartOrgLookupableImplTestPENDING extends TestCase {
14: private WorkflowLookupable workflowLookupable;
15: private Map fieldValues;
16: private Map conversionFields;
17:
18: protected void setUp() throws Exception {
19: SpringServiceLocator.setToTestMode(null);
20: workflowLookupable = new ChartOrgLookupableImpl();
21:
22: fieldValues = new HashMap();
23: fieldValues.put("fin_coa_cd", "BL");
24: fieldValues.put("org_cd", "BL");
25:
26: conversionFields = new HashMap();
27: conversionFields.put("fin_coa_cd", "test_fin_coa_cd");
28: conversionFields.put("org_cd", "test_org_cd");
29: }
30:
31: public void testGetSearchResults() throws Exception {
32: List results = workflowLookupable.getSearchResults(fieldValues,
33: conversionFields);
34: assertEquals("Too many results listed.", 1, results.size());
35: /*FiscalOrganization orgRecord = (FiscalOrganization) results.get(0);
36:
37: assertEquals("Chart value is incorrect.", "BL", orgRecord.getFinCoaCd());
38: assertEquals("Org Code value is incorrect.", "BL", orgRecord.getOrgCd());
39: assertEquals("Org name is incorrect.", "BLOOMINGTON CAMPUS", orgRecord.getOrganizationName());
40: assertTrue("Return parameter chart not correct.", orgRecord.getReturnUrl().indexOf("test_fin_coa_cd=BL") > 0);
41: assertTrue("Return parameter org not correct.", orgRecord.getReturnUrl().indexOf("test_org_cd=BL") > 0);*/
42:
43: }
44:
45: public void testGetColumns() {
46: for (Iterator iter = workflowLookupable.getColumns().iterator(); iter
47: .hasNext();) {
48: Column column = (Column) iter.next();
49: /*try {
50: Field field = FiscalOrganization.class.getDeclaredField(column.getPropertyName());
51: } catch (NoSuchFieldException e) {
52: assertTrue("Column property name on ChartOrgLookupableImpl does not equal a property on the FiscalOrganization bean.", false);
53: }*/
54: }
55: }
56:
57: public void testGetNoReturnParams() {
58: String parameters = workflowLookupable
59: .getNoReturnParams(conversionFields);
60:
61: assertTrue("Return parameter chart not correct.", parameters
62: .indexOf("test_fin_coa_cd=") > 0);
63: assertTrue("Return parameter org not correct.", parameters
64: .indexOf("test_org_cd=") > 0);
65: }
66: }
|