Source Code Cross Referenced for OrganizationReversionCategoryTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » service » impl » orgreversion » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.module.gl.service.impl.orgreversion 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-2007 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         * 
008:         * http://www.opensource.org/licenses/ecl1.php
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:        package org.kuali.module.gl.service.impl.orgreversion;
017:
018:        import java.util.Map;
019:
020:        import org.kuali.kfs.context.KualiTestBase;
021:        import org.kuali.kfs.context.SpringContext;
022:        import org.kuali.module.chart.bo.ObjectCode;
023:        import org.kuali.module.chart.service.ObjectCodeService;
024:        import org.kuali.module.chart.service.OrganizationReversionService;
025:        import org.kuali.module.gl.service.OrganizationReversionCategoryLogic;
026:        import org.kuali.test.ConfigureContext;
027:
028:        /**
029:         * A test to make sure that canonical object codes are put into the correct Organization Reversion categories
030:         */
031:        @ConfigureContext
032:        public class OrganizationReversionCategoryTest extends KualiTestBase {
033:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
034:                    .getLogger(OrganizationReversionCategoryTest.class);
035:
036:            private OrganizationReversionService organizationReversionService;
037:            private Map<String, OrganizationReversionCategoryLogic> categories;
038:            private ObjectCodeService objectCodeService;
039:
040:            /**
041:             * Sets up services and initializes the categories for this test.
042:             * @see junit.framework.TestCase#setUp()
043:             */
044:            @Override
045:            public void setUp() throws Exception {
046:                super .setUp();
047:
048:                Map<String, OrganizationReversionService> orgRevServiceBeans = SpringContext
049:                        .getBeansOfType(OrganizationReversionService.class);
050:                organizationReversionService = orgRevServiceBeans
051:                        .get("organizationReversionService");
052:                categories = organizationReversionService.getCategories();
053:                objectCodeService = SpringContext
054:                        .getBean(ObjectCodeService.class);
055:            }
056:
057:            /**
058:             * Tests that C01 (Org. Wages) category accepts the right object codes
059:             */
060:            public void testC01Reversion() {
061:                String category = "C01";
062:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
063:                        .get(category);
064:                assertNotNull("Category not found", cat);
065:
066:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
067:                        2007), "BL", "5000");
068:                assertNotNull("S&E Object code should exist", se);
069:
070:                assertFalse("S&E is not wages", cat.containsObjectCode(se));
071:
072:                ObjectCode wages = objectCodeService.getByPrimaryId(
073:                        new Integer(2007), "BL", "3854");
074:                assertNotNull("Wages Object code should exist", wages);
075:
076:                assertTrue("Wages object is wages", cat
077:                        .containsObjectCode(wages));
078:            }
079:
080:            /**
081:             * Tests that C02 (Salary & Fringes) Category accepts the right object codes
082:             */
083:            public void testC02Reversion() {
084:                String category = "C02";
085:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
086:                        .get(category);
087:                assertNotNull("Category not found", cat);
088:
089:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
090:                        2007), "BL", "5000");
091:                assertNotNull("S&E Object code should exist", se);
092:
093:                assertFalse("S&E is not salary/fringes", cat
094:                        .containsObjectCode(se));
095:
096:                ObjectCode wages = objectCodeService.getByPrimaryId(
097:                        new Integer(2007), "BL", "3854");
098:                assertNotNull("Wages Object code should exist", wages);
099:
100:                assertFalse("Wages object is not salary/fringes", cat
101:                        .containsObjectCode(wages));
102:
103:                ObjectCode sal = objectCodeService.getByPrimaryId(new Integer(
104:                        2007), "BL", "2000");
105:                assertNotNull("Salary Object code should exist", sal);
106:
107:                assertTrue("Wages object is salary/fringes", cat
108:                        .containsObjectCode(sal));
109:            }
110:
111:            /**
112:             * Tests that C03 (Financial Aid) Category accepts the right object codes
113:             */
114:            public void testC03Reversion() {
115:                String category = "C03";
116:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
117:                        .get(category);
118:                assertNotNull("Category not found", cat);
119:
120:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
121:                        2007), "BL", "5000");
122:                assertNotNull("S&E Object code should exist", se);
123:
124:                assertFalse("S&E is not financial aid", cat
125:                        .containsObjectCode(se));
126:
127:                ObjectCode fr = objectCodeService.getByPrimaryId(new Integer(
128:                        2007), "BL", "5885");
129:                assertNotNull("Fee Remission Object code should exist", fr);
130:
131:                assertTrue("Fee Remission object is financial aid", cat
132:                        .containsObjectCode(fr));
133:            }
134:
135:            /**
136:             * Tests that C04 (Capital Equip) Category accepts the right object codes
137:             */
138:            public void testC04Reversion() {
139:                String category = "C04";
140:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
141:                        .get(category);
142:                assertNotNull("Category not found", cat);
143:
144:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
145:                        2007), "BL", "5000");
146:                assertNotNull("S&E Object code should exist", se);
147:
148:                assertFalse("S&E is not capital equipment", cat
149:                        .containsObjectCode(se));
150:
151:                ObjectCode ce = objectCodeService.getByPrimaryId(new Integer(
152:                        2007), "BL", "7677");
153:                assertNotNull("Capital Equip Object code should exist", ce);
154:
155:                assertTrue("Art object is capital equipment", cat
156:                        .containsObjectCode(ce));
157:            }
158:
159:            /**
160:             * Tests that C05 (Reserve) Category accepts the right object codes
161:             */
162:            public void testC05Reversion() {
163:                String category = "C05";
164:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
165:                        .get(category);
166:                assertNotNull("Category not found", cat);
167:
168:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
169:                        2007), "BL", "5000");
170:                assertNotNull("S&E Object code should exist", se);
171:
172:                assertFalse("S&E is not reserve", cat.containsObjectCode(se));
173:                // TODO True test
174:            }
175:
176:            /**
177:             * Tests that C06 (Transfer Out) Category accepts the right object codes
178:             */
179:            public void testC06Reversion() {
180:                String category = "C06";
181:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
182:                        .get(category);
183:                assertNotNull("Category not found", cat);
184:
185:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
186:                        2007), "BL", "5000");
187:                assertNotNull("S&E Object code should exist", se);
188:
189:                assertFalse("S&E is not transfer out", cat
190:                        .containsObjectCode(se));
191:                // TODO True test
192:            }
193:
194:            /**
195:             * Tests that C07 (Transfer In) Category accepts the right object codes
196:             */
197:            public void testC07Reversion() {
198:                String category = "C07";
199:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
200:                        .get(category);
201:                assertNotNull("Category not found", cat);
202:
203:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
204:                        2007), "BL", "5000");
205:                assertNotNull("S&E Object code should exist", se);
206:
207:                assertFalse("S&E is not transfer in", cat
208:                        .containsObjectCode(se));
209:                // TODO True test
210:            }
211:
212:            /**
213:             * Tests that C08 (Travel) Category accepts the right object codes
214:             */
215:            public void testC08Reversion() {
216:                String category = "C08";
217:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
218:                        .get(category);
219:                assertNotNull("Category not found", cat);
220:
221:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
222:                        2007), "BL", "5000");
223:                assertNotNull("S&E Object code should exist", se);
224:
225:                assertFalse("S&E is not travel", cat.containsObjectCode(se));
226:                // TODO True test
227:            }
228:
229:            /**
230:             * Tests that C09 (Other Expenses) Category accepts the right object codes
231:             */
232:            public void testC09Reversion() {
233:                String category = "C09";
234:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
235:                        .get(category);
236:                assertNotNull("Category not found", cat);
237:
238:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
239:                        2007), "BL", "5000");
240:                assertNotNull("S&E Object code should exist", se);
241:
242:                assertTrue("S&E is S&E", cat.containsObjectCode(se));
243:                // TODO False test
244:            }
245:
246:            /**
247:             * Tests that C10 (Assess Expend) Category accepts the right object codes
248:             */
249:            public void testC10Reversion() {
250:                String category = "C10";
251:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
252:                        .get(category);
253:                assertNotNull("Category not found", cat);
254:
255:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
256:                        2007), "BL", "5000");
257:                assertNotNull("S&E Object code should exist", se);
258:
259:                assertFalse("S&E is not asses expend", cat
260:                        .containsObjectCode(se));
261:                // TODO True test
262:            }
263:
264:            /**
265:             * Tests that C11 (Revenue) Category accepts the right object codes
266:             */
267:            public void testC11Reversion() {
268:                String category = "C11";
269:                OrganizationReversionCategoryLogic cat = (OrganizationReversionCategoryLogic) categories
270:                        .get(category);
271:                assertNotNull("Category not found", cat);
272:
273:                ObjectCode se = objectCodeService.getByPrimaryId(new Integer(
274:                        2007), "BL", "5000");
275:                assertNotNull("S&E Object code should exist", se);
276:
277:                assertFalse("S&E is not revenue", cat.containsObjectCode(se));
278:                // TODO True test
279:            }
280:        }
w___w_w.___ja__v___a2_s__.___c__o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.