01: package edu.iu.uis.eden.account;
02:
03: import java.util.Iterator;
04:
05: import edu.iu.uis.eden.SpringServiceLocator;
06: import edu.iu.uis.eden.test.WorkflowTestCase;
07: import edu.iu.uis.eden.user.UserService;
08:
09: public class AccountTestPENDING extends WorkflowTestCase {
10:
11: private AccountService accountService;
12: private UserService userService;
13:
14: protected void setUpTransaction() throws Exception {
15: super .setUpTransaction();
16: //SpringServiceLocator.setToTestMode(null);
17: userService = (UserService) SpringServiceLocator
18: .getService(SpringServiceLocator.USER_SERVICE);
19: //accountService = (AccountService) SpringServiceLocator
20: // .getService(SpringServiceLocator.ACCOUNT_SERVICE);
21: }
22:
23: // public void testHitAllAccounts() throws Exception {
24: // List accounts = accountService.getAllAccounts();
25: // System.out.println(accounts.size() + " accounts retrieved");
26: // Set usersNotFound = new HashSet();
27: // for (Iterator iter = accounts.iterator(); iter.hasNext();) {
28: // Account account = (Account) iter.next();
29: // try {
30: // WorkflowUser user = userService.getWorkflowUser(new IUUserId(IUUserId.UUID, account.getFiscalOfficerUnvlId()));
31: // if (user == null
32: // || user.getWorkflowUserId() == null
33: // || user.getWorkflowUserId().getWorkflowId() == null
34: // || user.getWorkflowUserId().getWorkflowId().length() < 1) {
35: // usersNotFound.add(account.getFiscalOfficerUnvlId());
36: // }
37: // } catch (Throwable e) {
38: // usersNotFound.add(account.getFiscalOfficerUnvlId());
39: // }
40: // }
41: // System.out.println("listing users not found");
42: // for (Iterator iter = usersNotFound.iterator(); iter.hasNext();) {
43: // String uuid = (String) iter.next();
44: // System.out.println(uuid);
45: // }
46: // }
47:
48: public void testFetchAccount() throws Exception {
49: Account account = accountService.findByChartAccount("UA",
50: "1912610");
51: for (Iterator iter = account.getAccountDelegations().iterator(); iter
52: .hasNext();) {
53: AccountDelegation delegation = (AccountDelegation) iter
54: .next();
55: System.out.println("delegation: "
56: + delegation.getFdocTypCd());
57:
58: }
59: assertNotNull(account);
60: }
61:
62: }
|