Source Code Cross Referenced for NightlyOutServiceTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » service » 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 
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;
017:
018:        import java.util.List;
019:
020:        import org.kuali.core.service.DateTimeService;
021:        import org.kuali.core.util.Guid;
022:        import org.kuali.core.util.UnitTestSqlDao;
023:        import org.kuali.kfs.context.KualiTestBase;
024:        import org.kuali.kfs.context.SpringContext;
025:        import org.kuali.test.ConfigureContext;
026:
027:        /**
028:         * Tests the NighlyOutService
029:         */
030:        @ConfigureContext
031:        public class NightlyOutServiceTest extends KualiTestBase {
032:
033:            private NightlyOutService nightlyOutService;
034:            private UnitTestSqlDao unitTestSqlDao;
035:            private DateTimeService dateTimeService;
036:
037:            /**
038:             * Initializes the services needed for this test
039:             * @see junit.framework.TestCase#setUp()
040:             */
041:            @Override
042:            protected void setUp() throws Exception {
043:                super .setUp();
044:
045:                nightlyOutService = SpringContext
046:                        .getBean(NightlyOutService.class);
047:                unitTestSqlDao = SpringContext.getBean(UnitTestSqlDao.class);
048:                dateTimeService = SpringContext.getBean(DateTimeService.class);
049:            }
050:
051:            /**
052:             * This test validates that the correct data is copied into origin_entry
053:             * 
054:             * @throws Exception thrown if any exception is encountered for any reason
055:             */
056:            public void testCopyPendingLedgerEntry() throws Exception {
057:                // Empty out the origin entry group & origin entry tables
058:                unitTestSqlDao.sqlCommand("delete from gl_origin_entry_t");
059:                unitTestSqlDao.sqlCommand("delete from gl_origin_entry_grp_t");
060:
061:                // Empty out the pending entry table & doc header table
062:                unitTestSqlDao
063:                        .sqlCommand("delete from fp_doc_header_t where fdoc_nbr in ('1','2','3')");
064:                unitTestSqlDao.sqlCommand("delete from gl_pending_entry_t");
065:
066:                // Add a few documents
067:                unitTestSqlDao
068:                        .sqlCommand("insert into fp_doc_header_t (fdoc_nbr,obj_id,ver_nbr,fdoc_status_cd,fdoc_desc,fdoc_total_amt,org_doc_nbr,"
069:                                + "fdoc_in_err_nbr,fdoc_tmpl_nbr) values ('1','"
070:                                + new Guid().toString()
071:                                + "',1,'A','a',100,'OA',null,null)");
072:                unitTestSqlDao
073:                        .sqlCommand("insert into fp_doc_header_t (fdoc_nbr,obj_id,ver_nbr,fdoc_status_cd,fdoc_desc,fdoc_total_amt,org_doc_nbr,"
074:                                + "fdoc_in_err_nbr,fdoc_tmpl_nbr) values ('2','"
075:                                + new Guid().toString()
076:                                + "',1,'D','b',100,'OB',null,null)");
077:                unitTestSqlDao
078:                        .sqlCommand("insert into fp_doc_header_t (fdoc_nbr,obj_id,ver_nbr,fdoc_status_cd,fdoc_desc,fdoc_total_amt,org_doc_nbr,"
079:                                + "fdoc_in_err_nbr,fdoc_tmpl_nbr) values ('3','"
080:                                + new Guid().toString()
081:                                + "',1,'A','c',100,'OC',null,null)");
082:
083:                unitTestSqlDao
084:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
085:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
086:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
087:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
088:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','1',1,'"
089:                                + new Guid().toString()
090:                                + "',1,'BA','123456',"
091:                                + "null,'4166',null,'AC','EX',2004,'01',"
092:                                + "'Description',100,'D',"
093:                                + unitTestSqlDao.getDbPlatform()
094:                                        .getCurTimeFunction()
095:                                + ",'JV',null,null,"
096:                                + "null,null,null,null,null,' ','A',"
097:                                + "'4166',null,null)");
098:                unitTestSqlDao
099:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
100:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
101:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
102:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
103:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','1',2,'"
104:                                + new Guid().toString()
105:                                + "',1,'BA','123456',"
106:                                + "null,'4166',null,'AC','EX',2004,'01',"
107:                                + "'Description',100,'C',"
108:                                + unitTestSqlDao.getDbPlatform()
109:                                        .getCurTimeFunction()
110:                                + ",'JV',null,null,"
111:                                + "null,null,null,null,null,' ',null,"
112:                                + "'4166',null,null)");
113:                unitTestSqlDao
114:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
115:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
116:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
117:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
118:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','2',3,'"
119:                                + new Guid().toString()
120:                                + "',1,'BA','123456',"
121:                                + "null,'4166',null,'AC','EX',2004,'01',"
122:                                + "'Description',100,'D',"
123:                                + unitTestSqlDao.getDbPlatform()
124:                                        .getCurTimeFunction()
125:                                + ",'JV',null,null,"
126:                                + "null,null,null,null,null,' ','A',"
127:                                + "'4166',null,null)");
128:                unitTestSqlDao
129:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
130:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
131:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
132:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
133:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','2',4,'"
134:                                + new Guid().toString()
135:                                + "',1,'BA','123456',"
136:                                + "null,'4166',null,'AC','EX',2004,'01',"
137:                                + "'Description',100,'C',"
138:                                + unitTestSqlDao.getDbPlatform()
139:                                        .getCurTimeFunction()
140:                                + ",'JV',null,null,"
141:                                + "null,null,null,null,null,' ',null,"
142:                                + "'4166',null,null)");
143:                unitTestSqlDao
144:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
145:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
146:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
147:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
148:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','3',5,'"
149:                                + new Guid().toString()
150:                                + "',1,'BA','123456',"
151:                                + "null,'4166',null,'AC','EX',2004,'01',"
152:                                + "'Description',100,'D',"
153:                                + unitTestSqlDao.getDbPlatform()
154:                                        .getCurTimeFunction()
155:                                + ",'JV',null,null,"
156:                                + "null,null,null,null,null,' ','X',"
157:                                + "'4166',null,null)");
158:                unitTestSqlDao
159:                        .sqlCommand("insert into gl_pending_entry_t (fs_origin_cd,fdoc_nbr,trn_entr_seq_nbr,obj_id,ver_nbr,fin_coa_cd,account_nbr,"
160:                                + "sub_acct_nbr,fin_object_cd,fin_sub_obj_cd,fin_balance_typ_cd,fin_obj_typ_cd,univ_fiscal_yr,univ_fiscal_prd_cd,"
161:                                + "trn_ldgr_entr_desc,trn_ldgr_entr_amt,trn_debit_crdt_cd,transaction_dt,fdoc_typ_cd,org_doc_nbr,project_cd,"
162:                                + "org_reference_id,fdoc_ref_typ_cd,fs_ref_origin_cd,fdoc_ref_nbr,fdoc_reversal_dt,trn_encum_updt_cd,fdoc_approved_cd,"
163:                                + "acct_sf_finobj_cd,trn_entr_ofst_cd,trnentr_process_tm) values ('01','3',6,'"
164:                                + new Guid().toString()
165:                                + "',1,'BA','123456',"
166:                                + "null,'4166',null,'AC','EX',2004,'01',"
167:                                + "'Description',100,'C',"
168:                                + unitTestSqlDao.getDbPlatform()
169:                                        .getCurTimeFunction()
170:                                + ",'JV',null,null,"
171:                                + "null,null,null,null,null,' ','X',"
172:                                + "'4166',null,null)");
173:
174:                nightlyOutService.copyApprovedPendingLedgerEntries();
175:
176:                List groups = unitTestSqlDao
177:                        .sqlSelect("select * from gl_origin_entry_grp_t");
178:                assertEquals("Should have 1 group", 1, groups.size());
179:
180:                List entries = unitTestSqlDao
181:                        .sqlSelect("select * from gl_origin_entry_t");
182:                assertEquals("Should have 2 entries", 2, entries.size());
183:
184:                // 2 transactions were set to X to start with, 2 were marked as X when copyApprovedPendingLedgerEntries was run
185:                List pendingEntries = unitTestSqlDao
186:                        .sqlSelect("select * from gl_pending_entry_t where fdoc_approved_cd = 'X'");
187:                assertEquals("Should have 4 copied entries", 4, pendingEntries
188:                        .size());
189:
190:                nightlyOutService.deleteCopiedPendingLedgerEntries();
191:                List remainderEntries = unitTestSqlDao
192:                        .sqlSelect("select * from gl_pending_entry_t");
193:                assertEquals("Should have 2 remaining entries", 2,
194:                        remainderEntries.size());
195:            }
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.