01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.chart.service;
17:
18: import java.util.Collections;
19: import java.util.List;
20:
21: import org.kuali.kfs.context.KualiTestBase;
22: import org.kuali.kfs.context.SpringContext;
23: import org.kuali.test.ConfigureContext;
24:
25: @ConfigureContext
26: public class OrganizationService2Test extends KualiTestBase {
27:
28: private static final String GOOD_CHART = "BL";
29: private static final String GOOD_ORG = "PSY";
30: private static final String BAD_CHART = "ZZ";
31: private static final String BAD_ORG = "ZZZ";
32: private static final String GOOD_ORG2 = "BUS";
33:
34: public void testGetActiveAccountsByOrg_good() {
35:
36: List accounts;
37:
38: accounts = SpringContext.getBean(OrganizationService.class)
39: .getActiveAccountsByOrg(GOOD_CHART, GOOD_ORG);
40:
41: assertFalse("List of Accounts should not contain no elements.",
42: accounts.size() == 0);
43: assertFalse("List of Accounts should not be empty.", accounts
44: .isEmpty());
45:
46: }
47:
48: public void testGetActiveAccountsByOrg_bad() {
49:
50: List accounts;
51:
52: accounts = SpringContext.getBean(OrganizationService.class)
53: .getActiveAccountsByOrg(BAD_CHART, BAD_ORG);
54:
55: assertEquals(Collections.EMPTY_LIST, accounts);
56: assertTrue("List of Accounts should contain no elements.",
57: accounts.size() == 0);
58: assertTrue("List of Accounts should be empty.", accounts
59: .isEmpty());
60:
61: }
62:
63: public void testGetActiveChildOrgs_good() {
64:
65: List orgs;
66:
67: orgs = SpringContext.getBean(OrganizationService.class)
68: .getActiveChildOrgs(GOOD_CHART, GOOD_ORG2);
69:
70: assertFalse("List of Orgs should not contain no elements.",
71: orgs.size() == 0);
72: assertFalse("List of Orgs should not be empty.", orgs.isEmpty());
73:
74: }
75:
76: public void testGetActiveChildOrgs_bad() {
77:
78: List orgs;
79:
80: orgs = SpringContext.getBean(OrganizationService.class)
81: .getActiveChildOrgs(BAD_CHART, BAD_ORG);
82:
83: assertEquals(Collections.EMPTY_LIST, orgs);
84: assertTrue("List of Orgs should contain no elements.", orgs
85: .size() == 0);
86: assertTrue("List of Orgs should be empty.", orgs.isEmpty());
87:
88: }
89:
90: }
|