Source Code Cross Referenced for InternalBillingDocumentRuleTest.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » financial » rules » 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.financial.rules 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        /*
0002:         * Copyright 2005-2007 The Kuali Foundation.
0003:         * 
0004:         * Licensed under the Educational Community License, Version 1.0 (the "License");
0005:         * you may not use this file except in compliance with the License.
0006:         * You may obtain a copy of the License at
0007:         * 
0008:         * http://www.opensource.org/licenses/ecl1.php
0009:         * 
0010:         * Unless required by applicable law or agreed to in writing, software
0011:         * distributed under the License is distributed on an "AS IS" BASIS,
0012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013:         * See the License for the specific language governing permissions and
0014:         * limitations under the License.
0015:         */
0016:        package org.kuali.module.financial.rules;
0017:
0018:        import static org.kuali.module.financial.rules.IsDebitTestUtils.Amount.NEGATIVE;
0019:        import static org.kuali.module.financial.rules.IsDebitTestUtils.Amount.POSITIVE;
0020:        import static org.kuali.test.fixtures.AccountingLineFixture.EXPENSE_LINE;
0021:        import static org.kuali.test.fixtures.AccountingLineFixture.PFIP_SUB_FUND_LINE;
0022:        import static org.kuali.test.fixtures.UserNameFixture.KHUNTLEY;
0023:        import static org.kuali.test.util.KualiTestAssertionUtils.assertGlobalErrorMapContains;
0024:        import static org.kuali.test.util.KualiTestAssertionUtils.assertGlobalErrorMapEmpty;
0025:
0026:        import org.kuali.core.service.DataDictionaryService;
0027:        import org.kuali.core.service.DocumentService;
0028:        import org.kuali.core.service.DocumentTypeService;
0029:        import org.kuali.core.util.KualiDecimal;
0030:        import org.kuali.kfs.KFSKeyConstants;
0031:        import org.kuali.kfs.KFSPropertyConstants;
0032:        import org.kuali.kfs.bo.AccountingLine;
0033:        import org.kuali.kfs.bo.SourceAccountingLine;
0034:        import org.kuali.kfs.bo.TargetAccountingLine;
0035:        import org.kuali.kfs.context.KualiTestBase;
0036:        import org.kuali.kfs.context.SpringContext;
0037:        import org.kuali.kfs.document.AccountingDocument;
0038:        import org.kuali.module.financial.document.InternalBillingDocument;
0039:        import org.kuali.test.ConfigureContext;
0040:
0041:        /**
0042:         * This class tests the business rules of the internal billing document. This is not implemented yet and needs to extend
0043:         * AccountingDocumentRuleTestBase. We'll fully implement this when we get to this document during development.
0044:         */
0045:        @ConfigureContext(session=KHUNTLEY)
0046:        // @RelatesTo(RelatesTo.JiraIssue.KULRNE5908)
0047:        public class InternalBillingDocumentRuleTest extends KualiTestBase {
0048:
0049:            // ////////////////////////////////////////////////////////////////////////
0050:            // Test methods start here //
0051:            // ////////////////////////////////////////////////////////////////////////
0052:
0053:            public final void testSave_nullDocument() throws Exception {
0054:                boolean failedAsExpected = false;
0055:
0056:                try {
0057:                    SpringContext.getBean(DocumentService.class).saveDocument(
0058:                            null);
0059:                } catch (IllegalArgumentException e) {
0060:                    failedAsExpected = true;
0061:                }
0062:
0063:                assertTrue(failedAsExpected);
0064:            }
0065:
0066:            public final void testIsSubFundGroupAllowed_true() throws Exception {
0067:                AccountingLine line = EXPENSE_LINE.createSourceAccountingLine();
0068:                line.refresh();
0069:                assertGlobalErrorMapEmpty();
0070:                boolean actual = new InternalBillingDocumentRule()
0071:                        .isSubFundGroupAllowed(InternalBillingDocument.class,
0072:                                line);
0073:                assertGlobalErrorMapEmpty();
0074:                assertEquals(true, actual);
0075:            }
0076:
0077:            public final void testIsSubFundGroupAllowed_false()
0078:                    throws Exception {
0079:                AccountingLine line = PFIP_SUB_FUND_LINE
0080:                        .createSourceAccountingLine();
0081:                line.refresh();
0082:                assertGlobalErrorMapEmpty();
0083:                boolean actual = new InternalBillingDocumentRule()
0084:                        .isSubFundGroupAllowed(InternalBillingDocument.class,
0085:                                line);
0086:                assertGlobalErrorMapContains(
0087:                        KFSPropertyConstants.ACCOUNT_NUMBER,
0088:                        KFSKeyConstants.ERROR_DOCUMENT_INVALID_VALUE,
0089:                        new String[] { null, "PFIP", null, "not allowed",
0090:                                "PFRI, PFIP", null });
0091:                assertEquals(false, actual);
0092:            }
0093:
0094:            /**
0095:             * tests false is returned for a positive income
0096:             * 
0097:             * @throws Exception
0098:             */
0099:            public void testIsDebit_source_income_positveAmount()
0100:                    throws Exception {
0101:                AccountingDocument accountingDocument = IsDebitTestUtils
0102:                        .getDocument(SpringContext
0103:                                .getBean(DocumentService.class),
0104:                                InternalBillingDocument.class);
0105:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0106:                        accountingDocument, SourceAccountingLine.class,
0107:                        POSITIVE);
0108:
0109:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0110:                        .getBean(DocumentTypeService.class), SpringContext
0111:                        .getBean(DataDictionaryService.class),
0112:                        accountingDocument, accountingLine));
0113:            }
0114:
0115:            /**
0116:             * tests true is returned for a negative income
0117:             * 
0118:             * @throws Exception
0119:             */
0120:            public void testIsDebit_source_income_negativeAmount()
0121:                    throws Exception {
0122:                AccountingDocument accountingDocument = IsDebitTestUtils
0123:                        .getDocument(SpringContext
0124:                                .getBean(DocumentService.class),
0125:                                InternalBillingDocument.class);
0126:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0127:                        accountingDocument, SourceAccountingLine.class,
0128:                        NEGATIVE);
0129:
0130:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0131:                        .getBean(DocumentTypeService.class), SpringContext
0132:                        .getBean(DataDictionaryService.class),
0133:                        accountingDocument, accountingLine));
0134:            }
0135:
0136:            /**
0137:             * tests an <code>IllegalStateException</code> is thrown for a zero income
0138:             * 
0139:             * @throws Exception
0140:             */
0141:            public void testIsDebit_source_income_zeroAmount() throws Exception {
0142:
0143:                AccountingDocument accountingDocument = IsDebitTestUtils
0144:                        .getDocument(SpringContext
0145:                                .getBean(DocumentService.class),
0146:                                InternalBillingDocument.class);
0147:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0148:                        accountingDocument, SourceAccountingLine.class,
0149:                        KualiDecimal.ZERO);
0150:
0151:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0152:                        SpringContext.getBean(DocumentTypeService.class),
0153:                        SpringContext.getBean(DataDictionaryService.class),
0154:                        accountingDocument, accountingLine));
0155:            }
0156:
0157:            /**
0158:             * tests false is returned for a positive expense
0159:             * 
0160:             * @throws Exception
0161:             */
0162:            public void testIsDebit_source_expense_positveAmount()
0163:                    throws Exception {
0164:                AccountingDocument accountingDocument = IsDebitTestUtils
0165:                        .getDocument(SpringContext
0166:                                .getBean(DocumentService.class),
0167:                                InternalBillingDocument.class);
0168:                AccountingLine accountingLine = IsDebitTestUtils
0169:                        .getExpenseLine(accountingDocument,
0170:                                SourceAccountingLine.class, POSITIVE);
0171:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0172:                        .getBean(DocumentTypeService.class), SpringContext
0173:                        .getBean(DataDictionaryService.class),
0174:                        accountingDocument, accountingLine));
0175:            }
0176:
0177:            /**
0178:             * tests true is returned for a negative expense
0179:             * 
0180:             * @throws Exception
0181:             */
0182:            public void testIsDebit_source_expense_negativeAmount()
0183:                    throws Exception {
0184:                AccountingDocument accountingDocument = IsDebitTestUtils
0185:                        .getDocument(SpringContext
0186:                                .getBean(DocumentService.class),
0187:                                InternalBillingDocument.class);
0188:                AccountingLine accountingLine = IsDebitTestUtils
0189:                        .getExpenseLine(accountingDocument,
0190:                                SourceAccountingLine.class, NEGATIVE);
0191:
0192:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0193:                        .getBean(DocumentTypeService.class), SpringContext
0194:                        .getBean(DataDictionaryService.class),
0195:                        accountingDocument, accountingLine));
0196:            }
0197:
0198:            /**
0199:             * tests an <code>IllegalStateException</code> is thrown for a zero expense
0200:             * 
0201:             * @throws Exception
0202:             */
0203:            public void testIsDebit_source_expense_zeroAmount()
0204:                    throws Exception {
0205:                AccountingDocument accountingDocument = IsDebitTestUtils
0206:                        .getDocument(SpringContext
0207:                                .getBean(DocumentService.class),
0208:                                InternalBillingDocument.class);
0209:                AccountingLine accountingLine = IsDebitTestUtils
0210:                        .getExpenseLine(accountingDocument,
0211:                                SourceAccountingLine.class, KualiDecimal.ZERO);
0212:
0213:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0214:                        SpringContext.getBean(DocumentTypeService.class),
0215:                        SpringContext.getBean(DataDictionaryService.class),
0216:                        accountingDocument, accountingLine));
0217:            }
0218:
0219:            /**
0220:             * tests false is returned for a positive asset
0221:             * 
0222:             * @throws Exception
0223:             */
0224:            public void testIsDebit_source_asset_positveAmount()
0225:                    throws Exception {
0226:                AccountingDocument accountingDocument = IsDebitTestUtils
0227:                        .getDocument(SpringContext
0228:                                .getBean(DocumentService.class),
0229:                                InternalBillingDocument.class);
0230:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0231:                        accountingDocument, SourceAccountingLine.class,
0232:                        POSITIVE);
0233:
0234:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0235:                        .getBean(DocumentTypeService.class), SpringContext
0236:                        .getBean(DataDictionaryService.class),
0237:                        accountingDocument, accountingLine));
0238:            }
0239:
0240:            /**
0241:             * tests true is returned for a negative asset
0242:             * 
0243:             * @throws Exception
0244:             */
0245:            public void testIsDebit_source_asset_negativeAmount()
0246:                    throws Exception {
0247:                AccountingDocument accountingDocument = IsDebitTestUtils
0248:                        .getDocument(SpringContext
0249:                                .getBean(DocumentService.class),
0250:                                InternalBillingDocument.class);
0251:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0252:                        accountingDocument, SourceAccountingLine.class,
0253:                        NEGATIVE);
0254:
0255:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0256:                        .getBean(DocumentTypeService.class), SpringContext
0257:                        .getBean(DataDictionaryService.class),
0258:                        accountingDocument, accountingLine));
0259:            }
0260:
0261:            /**
0262:             * tests an <code>IllegalStateException</code> is thrown for a zero asset
0263:             * 
0264:             * @throws Exception
0265:             */
0266:            public void testIsDebit_source_asset_zeroAmount() throws Exception {
0267:                AccountingDocument accountingDocument = IsDebitTestUtils
0268:                        .getDocument(SpringContext
0269:                                .getBean(DocumentService.class),
0270:                                InternalBillingDocument.class);
0271:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0272:                        accountingDocument, SourceAccountingLine.class,
0273:                        KualiDecimal.ZERO);
0274:
0275:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0276:                        SpringContext.getBean(DocumentTypeService.class),
0277:                        SpringContext.getBean(DataDictionaryService.class),
0278:                        accountingDocument, accountingLine));
0279:            }
0280:
0281:            /**
0282:             * tests false is returned for a positive liability
0283:             * 
0284:             * @throws Exception
0285:             */
0286:            public void testIsDebit_source_liability_positveAmount()
0287:                    throws Exception {
0288:                AccountingDocument accountingDocument = IsDebitTestUtils
0289:                        .getDocument(SpringContext
0290:                                .getBean(DocumentService.class),
0291:                                InternalBillingDocument.class);
0292:                AccountingLine accountingLine = IsDebitTestUtils
0293:                        .getLiabilityLine(accountingDocument,
0294:                                SourceAccountingLine.class, POSITIVE);
0295:
0296:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0297:                        .getBean(DocumentTypeService.class), SpringContext
0298:                        .getBean(DataDictionaryService.class),
0299:                        accountingDocument, accountingLine));
0300:            }
0301:
0302:            /**
0303:             * tests true is returned for a negative liability
0304:             * 
0305:             * @throws Exception
0306:             */
0307:            public void testIsDebit_source_liability_negativeAmount()
0308:                    throws Exception {
0309:                AccountingDocument accountingDocument = IsDebitTestUtils
0310:                        .getDocument(SpringContext
0311:                                .getBean(DocumentService.class),
0312:                                InternalBillingDocument.class);
0313:                AccountingLine accountingLine = IsDebitTestUtils
0314:                        .getLiabilityLine(accountingDocument,
0315:                                SourceAccountingLine.class, NEGATIVE);
0316:
0317:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0318:                        .getBean(DocumentTypeService.class), SpringContext
0319:                        .getBean(DataDictionaryService.class),
0320:                        accountingDocument, accountingLine));
0321:            }
0322:
0323:            /**
0324:             * tests an <code>IllegalStateException</code> is thrown for a zero liability
0325:             * 
0326:             * @throws Exception
0327:             */
0328:            public void testIsDebit_source_liability_zeroAmount()
0329:                    throws Exception {
0330:                AccountingDocument accountingDocument = IsDebitTestUtils
0331:                        .getDocument(SpringContext
0332:                                .getBean(DocumentService.class),
0333:                                InternalBillingDocument.class);
0334:                AccountingLine accountingLine = IsDebitTestUtils
0335:                        .getLiabilityLine(accountingDocument,
0336:                                SourceAccountingLine.class, KualiDecimal.ZERO);
0337:
0338:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0339:                        SpringContext.getBean(DocumentTypeService.class),
0340:                        SpringContext.getBean(DataDictionaryService.class),
0341:                        accountingDocument, accountingLine));
0342:            }
0343:
0344:            /**
0345:             * tests true is returned for a positive income
0346:             * 
0347:             * @throws Exception
0348:             */
0349:            public void testIsDebit_target_income_positveAmount()
0350:                    throws Exception {
0351:                AccountingDocument accountingDocument = IsDebitTestUtils
0352:                        .getDocument(SpringContext
0353:                                .getBean(DocumentService.class),
0354:                                InternalBillingDocument.class);
0355:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0356:                        accountingDocument, TargetAccountingLine.class,
0357:                        POSITIVE);
0358:
0359:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0360:                        .getBean(DocumentTypeService.class), SpringContext
0361:                        .getBean(DataDictionaryService.class),
0362:                        accountingDocument, accountingLine));
0363:            }
0364:
0365:            /**
0366:             * tests false is returned for a negative income
0367:             * 
0368:             * @throws Exception
0369:             */
0370:            public void testIsDebit_target_income_negativeAmount()
0371:                    throws Exception {
0372:                AccountingDocument accountingDocument = IsDebitTestUtils
0373:                        .getDocument(SpringContext
0374:                                .getBean(DocumentService.class),
0375:                                InternalBillingDocument.class);
0376:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0377:                        accountingDocument, TargetAccountingLine.class,
0378:                        NEGATIVE);
0379:
0380:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0381:                        .getBean(DocumentTypeService.class), SpringContext
0382:                        .getBean(DataDictionaryService.class),
0383:                        accountingDocument, accountingLine));
0384:            }
0385:
0386:            /**
0387:             * tests an <code>IllegalStateException</code> is thrown for a zero income
0388:             * 
0389:             * @throws Exception
0390:             */
0391:            public void testIsDebit_target_income_zeroAmount() throws Exception {
0392:
0393:                AccountingDocument accountingDocument = IsDebitTestUtils
0394:                        .getDocument(SpringContext
0395:                                .getBean(DocumentService.class),
0396:                                InternalBillingDocument.class);
0397:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0398:                        accountingDocument, TargetAccountingLine.class,
0399:                        KualiDecimal.ZERO);
0400:
0401:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0402:                        SpringContext.getBean(DocumentTypeService.class),
0403:                        SpringContext.getBean(DataDictionaryService.class),
0404:                        accountingDocument, accountingLine));
0405:            }
0406:
0407:            /**
0408:             * tests true is returned for a positive expense
0409:             * 
0410:             * @throws Exception
0411:             */
0412:            public void testIsDebit_target_expense_positveAmount()
0413:                    throws Exception {
0414:                AccountingDocument accountingDocument = IsDebitTestUtils
0415:                        .getDocument(SpringContext
0416:                                .getBean(DocumentService.class),
0417:                                InternalBillingDocument.class);
0418:                AccountingLine accountingLine = IsDebitTestUtils
0419:                        .getExpenseLine(accountingDocument,
0420:                                TargetAccountingLine.class, POSITIVE);
0421:
0422:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0423:                        .getBean(DocumentTypeService.class), SpringContext
0424:                        .getBean(DataDictionaryService.class),
0425:                        accountingDocument, accountingLine));
0426:            }
0427:
0428:            /**
0429:             * tests false ir returned for a negative expense
0430:             * 
0431:             * @throws Exception
0432:             */
0433:            public void testIsDebit_target_expense_negativeAmount()
0434:                    throws Exception {
0435:                AccountingDocument accountingDocument = IsDebitTestUtils
0436:                        .getDocument(SpringContext
0437:                                .getBean(DocumentService.class),
0438:                                InternalBillingDocument.class);
0439:                AccountingLine accountingLine = IsDebitTestUtils
0440:                        .getExpenseLine(accountingDocument,
0441:                                TargetAccountingLine.class, NEGATIVE);
0442:
0443:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0444:                        .getBean(DocumentTypeService.class), SpringContext
0445:                        .getBean(DataDictionaryService.class),
0446:                        accountingDocument, accountingLine));
0447:            }
0448:
0449:            /**
0450:             * tests an <code>IllegalStateException</code> is thrown for a zero expense
0451:             * 
0452:             * @throws Exception
0453:             */
0454:            public void testIsDebit_target_expense_zeroAmount()
0455:                    throws Exception {
0456:                AccountingDocument accountingDocument = IsDebitTestUtils
0457:                        .getDocument(SpringContext
0458:                                .getBean(DocumentService.class),
0459:                                InternalBillingDocument.class);
0460:                AccountingLine accountingLine = IsDebitTestUtils
0461:                        .getExpenseLine(accountingDocument,
0462:                                TargetAccountingLine.class, KualiDecimal.ZERO);
0463:
0464:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0465:                        SpringContext.getBean(DocumentTypeService.class),
0466:                        SpringContext.getBean(DataDictionaryService.class),
0467:                        accountingDocument, accountingLine));
0468:            }
0469:
0470:            /**
0471:             * tests true is returned for a positive asset
0472:             * 
0473:             * @throws Exception
0474:             */
0475:            public void testIsDebit_target_asset_positveAmount()
0476:                    throws Exception {
0477:                AccountingDocument accountingDocument = IsDebitTestUtils
0478:                        .getDocument(SpringContext
0479:                                .getBean(DocumentService.class),
0480:                                InternalBillingDocument.class);
0481:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0482:                        accountingDocument, TargetAccountingLine.class,
0483:                        POSITIVE);
0484:
0485:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0486:                        .getBean(DocumentTypeService.class), SpringContext
0487:                        .getBean(DataDictionaryService.class),
0488:                        accountingDocument, accountingLine));
0489:            }
0490:
0491:            /**
0492:             * tests false is returned for a negative asset
0493:             * 
0494:             * @throws Exception
0495:             */
0496:            public void testIsDebit_target_asset_negativeAmount()
0497:                    throws Exception {
0498:                AccountingDocument accountingDocument = IsDebitTestUtils
0499:                        .getDocument(SpringContext
0500:                                .getBean(DocumentService.class),
0501:                                InternalBillingDocument.class);
0502:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0503:                        accountingDocument, TargetAccountingLine.class,
0504:                        NEGATIVE);
0505:
0506:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0507:                        .getBean(DocumentTypeService.class), SpringContext
0508:                        .getBean(DataDictionaryService.class),
0509:                        accountingDocument, accountingLine));
0510:            }
0511:
0512:            /**
0513:             * tests an <code>IllegalStateException</code> is thrown for a zero asset
0514:             * 
0515:             * @throws Exception
0516:             */
0517:            public void testIsDebit_target_asset_zeroAmount() throws Exception {
0518:                AccountingDocument accountingDocument = IsDebitTestUtils
0519:                        .getDocument(SpringContext
0520:                                .getBean(DocumentService.class),
0521:                                InternalBillingDocument.class);
0522:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0523:                        accountingDocument, TargetAccountingLine.class,
0524:                        KualiDecimal.ZERO);
0525:
0526:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0527:                        SpringContext.getBean(DocumentTypeService.class),
0528:                        SpringContext.getBean(DataDictionaryService.class),
0529:                        accountingDocument, accountingLine));
0530:            }
0531:
0532:            /**
0533:             * tests true is returned for a positive liability
0534:             * 
0535:             * @throws Exception
0536:             */
0537:            public void testIsDebit_target_liability_positveAmount()
0538:                    throws Exception {
0539:                AccountingDocument accountingDocument = IsDebitTestUtils
0540:                        .getDocument(SpringContext
0541:                                .getBean(DocumentService.class),
0542:                                InternalBillingDocument.class);
0543:                AccountingLine accountingLine = IsDebitTestUtils
0544:                        .getLiabilityLine(accountingDocument,
0545:                                TargetAccountingLine.class, POSITIVE);
0546:
0547:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0548:                        .getBean(DocumentTypeService.class), SpringContext
0549:                        .getBean(DataDictionaryService.class),
0550:                        accountingDocument, accountingLine));
0551:            }
0552:
0553:            /**
0554:             * tests false is returned for a negative liability
0555:             * 
0556:             * @throws Exception
0557:             */
0558:            public void testIsDebit_target_liability_negativeAmount()
0559:                    throws Exception {
0560:                AccountingDocument accountingDocument = IsDebitTestUtils
0561:                        .getDocument(SpringContext
0562:                                .getBean(DocumentService.class),
0563:                                InternalBillingDocument.class);
0564:                AccountingLine accountingLine = IsDebitTestUtils
0565:                        .getLiabilityLine(accountingDocument,
0566:                                TargetAccountingLine.class, NEGATIVE);
0567:
0568:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0569:                        .getBean(DocumentTypeService.class), SpringContext
0570:                        .getBean(DataDictionaryService.class),
0571:                        accountingDocument, accountingLine));
0572:            }
0573:
0574:            /**
0575:             * tests an <code>IllegalStateException</code> is thrown for a zero liability
0576:             * 
0577:             * @throws Exception
0578:             */
0579:            public void testIsDebit_target_liability_zeroAmount()
0580:                    throws Exception {
0581:                AccountingDocument accountingDocument = IsDebitTestUtils
0582:                        .getDocument(SpringContext
0583:                                .getBean(DocumentService.class),
0584:                                InternalBillingDocument.class);
0585:                AccountingLine accountingLine = IsDebitTestUtils
0586:                        .getLiabilityLine(accountingDocument,
0587:                                TargetAccountingLine.class, KualiDecimal.ZERO);
0588:
0589:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0590:                        SpringContext.getBean(DocumentTypeService.class),
0591:                        SpringContext.getBean(DataDictionaryService.class),
0592:                        accountingDocument, accountingLine));
0593:            }
0594:
0595:            /**
0596:             * tests false is returned for a positive income
0597:             * 
0598:             * @throws Exception
0599:             */
0600:            public void testIsDebit_errorCorrection_source_income_positveAmount()
0601:                    throws Exception {
0602:                AccountingDocument accountingDocument = IsDebitTestUtils
0603:                        .getErrorCorrectionDocument(SpringContext
0604:                                .getBean(DocumentService.class),
0605:                                InternalBillingDocument.class);
0606:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0607:                        accountingDocument, SourceAccountingLine.class,
0608:                        POSITIVE);
0609:
0610:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0611:                        .getBean(DocumentTypeService.class), SpringContext
0612:                        .getBean(DataDictionaryService.class),
0613:                        accountingDocument, accountingLine));
0614:            }
0615:
0616:            /**
0617:             * tests true is returned for a negative income
0618:             * 
0619:             * @throws Exception
0620:             */
0621:            public void testIsDebit_errorCorrection_source_income_negativeAmount()
0622:                    throws Exception {
0623:                AccountingDocument accountingDocument = IsDebitTestUtils
0624:                        .getErrorCorrectionDocument(SpringContext
0625:                                .getBean(DocumentService.class),
0626:                                InternalBillingDocument.class);
0627:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0628:                        accountingDocument, SourceAccountingLine.class,
0629:                        NEGATIVE);
0630:
0631:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0632:                        .getBean(DocumentTypeService.class), SpringContext
0633:                        .getBean(DataDictionaryService.class),
0634:                        accountingDocument, accountingLine));
0635:            }
0636:
0637:            /**
0638:             * tests an <code>IllegalStateException</code> is thrown for a zero income
0639:             * 
0640:             * @throws Exception
0641:             */
0642:            public void testIsDebit_errorCorrection_source_income_zeroAmount()
0643:                    throws Exception {
0644:
0645:                AccountingDocument accountingDocument = IsDebitTestUtils
0646:                        .getErrorCorrectionDocument(SpringContext
0647:                                .getBean(DocumentService.class),
0648:                                InternalBillingDocument.class);
0649:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0650:                        accountingDocument, SourceAccountingLine.class,
0651:                        KualiDecimal.ZERO);
0652:
0653:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0654:                        SpringContext.getBean(DocumentTypeService.class),
0655:                        SpringContext.getBean(DataDictionaryService.class),
0656:                        accountingDocument, accountingLine));
0657:            }
0658:
0659:            /**
0660:             * tests false is returned for positive expense
0661:             * 
0662:             * @throws Exception
0663:             */
0664:            public void testIsDebit_errorCorrection_source_expense_positveAmount()
0665:                    throws Exception {
0666:                AccountingDocument accountingDocument = IsDebitTestUtils
0667:                        .getErrorCorrectionDocument(SpringContext
0668:                                .getBean(DocumentService.class),
0669:                                InternalBillingDocument.class);
0670:                AccountingLine accountingLine = IsDebitTestUtils
0671:                        .getExpenseLine(accountingDocument,
0672:                                SourceAccountingLine.class, POSITIVE);
0673:
0674:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0675:                        .getBean(DocumentTypeService.class), SpringContext
0676:                        .getBean(DataDictionaryService.class),
0677:                        accountingDocument, accountingLine));
0678:            }
0679:
0680:            /**
0681:             * tests true is returned for a negative expense
0682:             * 
0683:             * @throws Exception
0684:             */
0685:            public void testIsDebit_errorCorrection_source_expense_negativeAmount()
0686:                    throws Exception {
0687:                AccountingDocument accountingDocument = IsDebitTestUtils
0688:                        .getErrorCorrectionDocument(SpringContext
0689:                                .getBean(DocumentService.class),
0690:                                InternalBillingDocument.class);
0691:                AccountingLine accountingLine = IsDebitTestUtils
0692:                        .getExpenseLine(accountingDocument,
0693:                                SourceAccountingLine.class, NEGATIVE);
0694:
0695:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0696:                        .getBean(DocumentTypeService.class), SpringContext
0697:                        .getBean(DataDictionaryService.class),
0698:                        accountingDocument, accountingLine));
0699:            }
0700:
0701:            /**
0702:             * tests an <code>IllegalStateException</code> is thrown for a zero expense
0703:             * 
0704:             * @throws Exception
0705:             */
0706:            public void testIsDebit_errorCorrection_source_expense_zeroAmount()
0707:                    throws Exception {
0708:                AccountingDocument accountingDocument = IsDebitTestUtils
0709:                        .getErrorCorrectionDocument(SpringContext
0710:                                .getBean(DocumentService.class),
0711:                                InternalBillingDocument.class);
0712:                AccountingLine accountingLine = IsDebitTestUtils
0713:                        .getExpenseLine(accountingDocument,
0714:                                SourceAccountingLine.class, KualiDecimal.ZERO);
0715:
0716:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0717:                        SpringContext.getBean(DocumentTypeService.class),
0718:                        SpringContext.getBean(DataDictionaryService.class),
0719:                        accountingDocument, accountingLine));
0720:            }
0721:
0722:            /**
0723:             * tests false is returned for a positive asset
0724:             * 
0725:             * @throws Exception
0726:             */
0727:            public void testIsDebit_errorCorrection_source_asset_positveAmount()
0728:                    throws Exception {
0729:                AccountingDocument accountingDocument = IsDebitTestUtils
0730:                        .getErrorCorrectionDocument(SpringContext
0731:                                .getBean(DocumentService.class),
0732:                                InternalBillingDocument.class);
0733:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0734:                        accountingDocument, SourceAccountingLine.class,
0735:                        POSITIVE);
0736:
0737:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0738:                        .getBean(DocumentTypeService.class), SpringContext
0739:                        .getBean(DataDictionaryService.class),
0740:                        accountingDocument, accountingLine));
0741:            }
0742:
0743:            /**
0744:             * tests true is returned for a negative asset
0745:             * 
0746:             * @throws Exception
0747:             */
0748:            public void testIsDebit_errorCorrection_source_asset_negativeAmount()
0749:                    throws Exception {
0750:                AccountingDocument accountingDocument = IsDebitTestUtils
0751:                        .getErrorCorrectionDocument(SpringContext
0752:                                .getBean(DocumentService.class),
0753:                                InternalBillingDocument.class);
0754:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0755:                        accountingDocument, SourceAccountingLine.class,
0756:                        NEGATIVE);
0757:
0758:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0759:                        .getBean(DocumentTypeService.class), SpringContext
0760:                        .getBean(DataDictionaryService.class),
0761:                        accountingDocument, accountingLine));
0762:            }
0763:
0764:            /**
0765:             * tests an <code>IllegalStateException</code> is thrown for a zero asset
0766:             * 
0767:             * @throws Exception
0768:             */
0769:            public void testIsDebit_errorCorrection_source_asset_zeroAmount()
0770:                    throws Exception {
0771:                AccountingDocument accountingDocument = IsDebitTestUtils
0772:                        .getErrorCorrectionDocument(SpringContext
0773:                                .getBean(DocumentService.class),
0774:                                InternalBillingDocument.class);
0775:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0776:                        accountingDocument, SourceAccountingLine.class,
0777:                        KualiDecimal.ZERO);
0778:
0779:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0780:                        SpringContext.getBean(DocumentTypeService.class),
0781:                        SpringContext.getBean(DataDictionaryService.class),
0782:                        accountingDocument, accountingLine));
0783:            }
0784:
0785:            /**
0786:             * tests false is returned for a positive liability
0787:             * 
0788:             * @throws Exception
0789:             */
0790:            public void testIsDebit_errorCorrection_source_liability_positveAmount()
0791:                    throws Exception {
0792:                AccountingDocument accountingDocument = IsDebitTestUtils
0793:                        .getErrorCorrectionDocument(SpringContext
0794:                                .getBean(DocumentService.class),
0795:                                InternalBillingDocument.class);
0796:                AccountingLine accountingLine = IsDebitTestUtils
0797:                        .getLiabilityLine(accountingDocument,
0798:                                SourceAccountingLine.class, POSITIVE);
0799:
0800:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0801:                        .getBean(DocumentTypeService.class), SpringContext
0802:                        .getBean(DataDictionaryService.class),
0803:                        accountingDocument, accountingLine));
0804:            }
0805:
0806:            /**
0807:             * tests true is returned for a negative liability
0808:             * 
0809:             * @throws Exception
0810:             */
0811:            public void testIsDebit_errorCorrection_source_liability_negativeAmount()
0812:                    throws Exception {
0813:                AccountingDocument accountingDocument = IsDebitTestUtils
0814:                        .getErrorCorrectionDocument(SpringContext
0815:                                .getBean(DocumentService.class),
0816:                                InternalBillingDocument.class);
0817:                AccountingLine accountingLine = IsDebitTestUtils
0818:                        .getLiabilityLine(accountingDocument,
0819:                                SourceAccountingLine.class, NEGATIVE);
0820:
0821:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0822:                        .getBean(DocumentTypeService.class), SpringContext
0823:                        .getBean(DataDictionaryService.class),
0824:                        accountingDocument, accountingLine));
0825:            }
0826:
0827:            /**
0828:             * tests an <code>IllegalStateException</code> is thrown for a zero liability
0829:             * 
0830:             * @throws Exception
0831:             */
0832:            public void testIsDebit_errorCorrection_source_liability_zeroAmount()
0833:                    throws Exception {
0834:                AccountingDocument accountingDocument = IsDebitTestUtils
0835:                        .getErrorCorrectionDocument(SpringContext
0836:                                .getBean(DocumentService.class),
0837:                                InternalBillingDocument.class);
0838:                AccountingLine accountingLine = IsDebitTestUtils
0839:                        .getLiabilityLine(accountingDocument,
0840:                                SourceAccountingLine.class, KualiDecimal.ZERO);
0841:
0842:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0843:                        SpringContext.getBean(DocumentTypeService.class),
0844:                        SpringContext.getBean(DataDictionaryService.class),
0845:                        accountingDocument, accountingLine));
0846:            }
0847:
0848:            /**
0849:             * tests true is returned for a positive income
0850:             * 
0851:             * @throws Exception
0852:             */
0853:            public void testIsDebit_errorCorrection_target_income_positveAmount()
0854:                    throws Exception {
0855:                AccountingDocument accountingDocument = IsDebitTestUtils
0856:                        .getErrorCorrectionDocument(SpringContext
0857:                                .getBean(DocumentService.class),
0858:                                InternalBillingDocument.class);
0859:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0860:                        accountingDocument, TargetAccountingLine.class,
0861:                        POSITIVE);
0862:
0863:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0864:                        .getBean(DocumentTypeService.class), SpringContext
0865:                        .getBean(DataDictionaryService.class),
0866:                        accountingDocument, accountingLine));
0867:            }
0868:
0869:            /**
0870:             * tests false is returned for a negative income
0871:             * 
0872:             * @throws Exception
0873:             */
0874:            public void testIsDebit_errorCorrection_target_income_negativeAmount()
0875:                    throws Exception {
0876:                AccountingDocument accountingDocument = IsDebitTestUtils
0877:                        .getErrorCorrectionDocument(SpringContext
0878:                                .getBean(DocumentService.class),
0879:                                InternalBillingDocument.class);
0880:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0881:                        accountingDocument, TargetAccountingLine.class,
0882:                        NEGATIVE);
0883:
0884:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0885:                        .getBean(DocumentTypeService.class), SpringContext
0886:                        .getBean(DataDictionaryService.class),
0887:                        accountingDocument, accountingLine));
0888:            }
0889:
0890:            /**
0891:             * tests an <code>IllegalStateException</code> is thrown for a zero income
0892:             * 
0893:             * @throws Exception
0894:             */
0895:            public void testIsDebit_errorCorrection_target_income_zeroAmount()
0896:                    throws Exception {
0897:
0898:                AccountingDocument accountingDocument = IsDebitTestUtils
0899:                        .getErrorCorrectionDocument(SpringContext
0900:                                .getBean(DocumentService.class),
0901:                                InternalBillingDocument.class);
0902:                AccountingLine accountingLine = IsDebitTestUtils.getIncomeLine(
0903:                        accountingDocument, TargetAccountingLine.class,
0904:                        KualiDecimal.ZERO);
0905:
0906:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0907:                        SpringContext.getBean(DocumentTypeService.class),
0908:                        SpringContext.getBean(DataDictionaryService.class),
0909:                        accountingDocument, accountingLine));
0910:            }
0911:
0912:            /**
0913:             * tests true is returned for a positive expense
0914:             * 
0915:             * @throws Exception
0916:             */
0917:            public void testIsDebit_errorCorrection_target_expense_positveAmount()
0918:                    throws Exception {
0919:                AccountingDocument accountingDocument = IsDebitTestUtils
0920:                        .getErrorCorrectionDocument(SpringContext
0921:                                .getBean(DocumentService.class),
0922:                                InternalBillingDocument.class);
0923:                AccountingLine accountingLine = IsDebitTestUtils
0924:                        .getExpenseLine(accountingDocument,
0925:                                TargetAccountingLine.class, POSITIVE);
0926:
0927:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0928:                        .getBean(DocumentTypeService.class), SpringContext
0929:                        .getBean(DataDictionaryService.class),
0930:                        accountingDocument, accountingLine));
0931:            }
0932:
0933:            /**
0934:             * tests false is returned for a negative expense
0935:             * 
0936:             * @throws Exception
0937:             */
0938:            public void testIsDebit_errorCorrection_target_expense_negativeAmount()
0939:                    throws Exception {
0940:                AccountingDocument accountingDocument = IsDebitTestUtils
0941:                        .getErrorCorrectionDocument(SpringContext
0942:                                .getBean(DocumentService.class),
0943:                                InternalBillingDocument.class);
0944:                AccountingLine accountingLine = IsDebitTestUtils
0945:                        .getExpenseLine(accountingDocument,
0946:                                TargetAccountingLine.class, NEGATIVE);
0947:
0948:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
0949:                        .getBean(DocumentTypeService.class), SpringContext
0950:                        .getBean(DataDictionaryService.class),
0951:                        accountingDocument, accountingLine));
0952:            }
0953:
0954:            /**
0955:             * tests an <code>IllegalStateException</code> is thrown for a zero expense
0956:             * 
0957:             * @throws Exception
0958:             */
0959:            public void testIsDebit_errorCorrection_target_expense_zeroAmount()
0960:                    throws Exception {
0961:                AccountingDocument accountingDocument = IsDebitTestUtils
0962:                        .getErrorCorrectionDocument(SpringContext
0963:                                .getBean(DocumentService.class),
0964:                                InternalBillingDocument.class);
0965:                AccountingLine accountingLine = IsDebitTestUtils
0966:                        .getExpenseLine(accountingDocument,
0967:                                TargetAccountingLine.class, KualiDecimal.ZERO);
0968:
0969:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
0970:                        SpringContext.getBean(DocumentTypeService.class),
0971:                        SpringContext.getBean(DataDictionaryService.class),
0972:                        accountingDocument, accountingLine));
0973:            }
0974:
0975:            /**
0976:             * tests true is returned for a positive asset
0977:             * 
0978:             * @throws Exception
0979:             */
0980:            public void testIsDebit_errorCorrection_target_asset_positveAmount()
0981:                    throws Exception {
0982:                AccountingDocument accountingDocument = IsDebitTestUtils
0983:                        .getErrorCorrectionDocument(SpringContext
0984:                                .getBean(DocumentService.class),
0985:                                InternalBillingDocument.class);
0986:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
0987:                        accountingDocument, TargetAccountingLine.class,
0988:                        POSITIVE);
0989:
0990:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
0991:                        .getBean(DocumentTypeService.class), SpringContext
0992:                        .getBean(DataDictionaryService.class),
0993:                        accountingDocument, accountingLine));
0994:            }
0995:
0996:            /**
0997:             * tests false is returned for a negative asset
0998:             * 
0999:             * @throws Exception
1000:             */
1001:            public void testIsDebit_errorCorrection_target_asset_negativeAmount()
1002:                    throws Exception {
1003:                AccountingDocument accountingDocument = IsDebitTestUtils
1004:                        .getErrorCorrectionDocument(SpringContext
1005:                                .getBean(DocumentService.class),
1006:                                InternalBillingDocument.class);
1007:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
1008:                        accountingDocument, TargetAccountingLine.class,
1009:                        NEGATIVE);
1010:
1011:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
1012:                        .getBean(DocumentTypeService.class), SpringContext
1013:                        .getBean(DataDictionaryService.class),
1014:                        accountingDocument, accountingLine));
1015:            }
1016:
1017:            /**
1018:             * tests an <code>IllegalStateException</code> is thrown for a zero asset
1019:             * 
1020:             * @throws Exception
1021:             */
1022:            public void testIsDebit_errorCorrection_target_asset_zeroAmount()
1023:                    throws Exception {
1024:                AccountingDocument accountingDocument = IsDebitTestUtils
1025:                        .getErrorCorrectionDocument(SpringContext
1026:                                .getBean(DocumentService.class),
1027:                                InternalBillingDocument.class);
1028:                AccountingLine accountingLine = IsDebitTestUtils.getAssetLine(
1029:                        accountingDocument, TargetAccountingLine.class,
1030:                        KualiDecimal.ZERO);
1031:
1032:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
1033:                        SpringContext.getBean(DocumentTypeService.class),
1034:                        SpringContext.getBean(DataDictionaryService.class),
1035:                        accountingDocument, accountingLine));
1036:            }
1037:
1038:            /**
1039:             * tests true is returned for a positive liability
1040:             * 
1041:             * @throws Exception
1042:             */
1043:            public void testIsDebit_errorCorrection_target_liability_positveAmount()
1044:                    throws Exception {
1045:                AccountingDocument accountingDocument = IsDebitTestUtils
1046:                        .getErrorCorrectionDocument(SpringContext
1047:                                .getBean(DocumentService.class),
1048:                                InternalBillingDocument.class);
1049:                AccountingLine accountingLine = IsDebitTestUtils
1050:                        .getLiabilityLine(accountingDocument,
1051:                                TargetAccountingLine.class, POSITIVE);
1052:
1053:                assertTrue(IsDebitTestUtils.isDebit(SpringContext
1054:                        .getBean(DocumentTypeService.class), SpringContext
1055:                        .getBean(DataDictionaryService.class),
1056:                        accountingDocument, accountingLine));
1057:            }
1058:
1059:            /**
1060:             * tests afalse is returned for a negative liability
1061:             * 
1062:             * @throws Exception
1063:             */
1064:            public void testIsDebit_errorCorrection_target_liability_negativeAmount()
1065:                    throws Exception {
1066:                AccountingDocument accountingDocument = IsDebitTestUtils
1067:                        .getErrorCorrectionDocument(SpringContext
1068:                                .getBean(DocumentService.class),
1069:                                InternalBillingDocument.class);
1070:                AccountingLine accountingLine = IsDebitTestUtils
1071:                        .getLiabilityLine(accountingDocument,
1072:                                TargetAccountingLine.class, NEGATIVE);
1073:
1074:                assertFalse(IsDebitTestUtils.isDebit(SpringContext
1075:                        .getBean(DocumentTypeService.class), SpringContext
1076:                        .getBean(DataDictionaryService.class),
1077:                        accountingDocument, accountingLine));
1078:            }
1079:
1080:            /**
1081:             * tests an <code>IllegalStateException</code> is thrown for a zero liability
1082:             * 
1083:             * @throws Exception
1084:             */
1085:            public void testIsDebit_errorCorrection_target_liability_zeroAmount()
1086:                    throws Exception {
1087:                AccountingDocument accountingDocument = IsDebitTestUtils
1088:                        .getErrorCorrectionDocument(SpringContext
1089:                                .getBean(DocumentService.class),
1090:                                InternalBillingDocument.class);
1091:                AccountingLine accountingLine = IsDebitTestUtils
1092:                        .getLiabilityLine(accountingDocument,
1093:                                TargetAccountingLine.class, KualiDecimal.ZERO);
1094:
1095:                assertTrue(IsDebitTestUtils.isDebitIllegalStateException(
1096:                        SpringContext.getBean(DocumentTypeService.class),
1097:                        SpringContext.getBean(DataDictionaryService.class),
1098:                        accountingDocument, accountingLine));
1099:            }
1100:
1101:            /*
1102:             * TODO Commented out until we get data in the db that matches what we need, or we can modify the objects directly
1103:             * (mock-testing) public final void testApplyAddAccountingLineBusinessRulesInvalidStudentFeeContinueEduc() throws Exception {
1104:             * triggerInvalidAddAccountingLineEvents ( getAccountingDocument().getSourceAccountingLines() );
1105:             * triggerInvalidAddAccountingLineEvents ( getAccountingDocument().getTargetAccountingLines() ); } public final void
1106:             * testApplyAddAccountingLineBusinessRulesValidStudentFeeContinueEduc() throws Exception { triggerValidAddAccountingLineEvents (
1107:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents (
1108:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1109:             * testApplyAddAccountingLineBusinessRulesInvalidCapObjCodes() throws Exception { triggerValidAddAccountingLineEvents (
1110:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents (
1111:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1112:             * testApplyAddAccountingLineBusinessRulesValidCapObjCodes() throws Exception { triggerValidAddAccountingLineEvents(
1113:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1114:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1115:             * testApplyAddAccountingLineBusinessRulesInvalidConsolidatedObjCode() throws Exception { triggerValidAddAccountingLineEvents(
1116:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1117:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1118:             * testApplyAddAccountingLineBusinessRulesValidConsolidatedObjCode() throws Exception { triggerValidAddAccountingLineEvents(
1119:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1120:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1121:             * testApplyAddAccountingLineBusinessRulesInvalidObjCodeSubTypes() throws Exception { triggerValidAddAccountingLineEvents(
1122:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1123:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1124:             * testApplyAddAccountingLineBusinessRulesValidObjCodeSubTypes() throws Exception { triggerValidAddAccountingLineEvents(
1125:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1126:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1127:             * testApplyAddAccountingLineBusinessRulesInvalidObjLevelCode() throws Exception { triggerValidAddAccountingLineEvents(
1128:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1129:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1130:             * testApplyAddAccountingLineBusinessRulesValidObjLevelCode() throws Exception { triggerValidAddAccountingLineEvents(
1131:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1132:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1133:             * testApplyAddAccountingLineBusinessRulesInvalidObjType() throws Exception { triggerValidAddAccountingLineEvents(
1134:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1135:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1136:             * testApplyAddAccountingLineBusinessRulesValidObjType() throws Exception { triggerValidAddAccountingLineEvents(
1137:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1138:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1139:             * testApplyAddAccountingLineBusinessRulesInvalidObjSubTypeAssessOrTransOfFunds() throws Exception {
1140:             * triggerValidAddAccountingLineEvents( getAccountingDocument().getSourceAccountingLines() );
1141:             * triggerInvalidAddAccountingLineEvents( getAccountingDocument().getTargetAccountingLines() ); } public final void
1142:             * testApplyAddAccountingLineBusinessRulesValidObjSubTypeAssessOrTransOfFunds() throws Exception {
1143:             * triggerValidAddAccountingLineEvents( getAccountingDocument().getSourceAccountingLines() );
1144:             * triggerInvalidAddAccountingLineEvents( getAccountingDocument().getTargetAccountingLines() ); } public final void
1145:             * testApplyAddAccountingLineBusinessRulesInvalidFundGroup() throws Exception { triggerValidAddAccountingLineEvents(
1146:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1147:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1148:             * testApplyAddAccountingLineBusinessRulesValidFundGroup() throws Exception { triggerValidAddAccountingLineEvents(
1149:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1150:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1151:             * testApplyAddAccountingLineBusinessRulesInvalidSubFundGroup() throws Exception { triggerValidAddAccountingLineEvents(
1152:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1153:             * getAccountingDocument().getTargetAccountingLines() ); } public final void
1154:             * testApplyAddAccountingLineBusinessRulesValidSubFundGroup() throws Exception { triggerValidAddAccountingLineEvents(
1155:             * getAccountingDocument().getSourceAccountingLines() ); triggerInvalidAddAccountingLineEvents(
1156:             * getAccountingDocument().getTargetAccountingLines() ); }
1157:             */
1158:
1159:            /*
1160:             * This following block of commented out code contains valuable data that should be used for this rule class when we get to this
1161:             * document. This data needs to be transformed into the new xml based fixtures framework. public void fixturesDefault() {
1162:             * addFixture( KualiRuleTestCase.ACCOUNT, "1912610" ); addFixture( KualiRuleTestCase.BALANCE_TYPE,
1163:             * AccountingDocumentRuleBase.BALANCE_TYPE_CODE.ACTUAL ); addFixture( KualiRuleTestCase.CHART, "UA" ); addFixture(
1164:             * KualiRuleTestCase.OBJECT_TYPE_CODE, AccountingDocumentRuleBase.OBJECT_TYPE_CODE.CASH_NOT_INCOME ); addFixture(
1165:             * KualiRuleTestCase.POSTING_YEAR, new Integer( 2005 ) ); addFixture( KualiRuleTestCase.PROJECT, "BOB" ); addFixture(
1166:             * KualiRuleTestCase.SUBACCOUNT, "BEER" ); } public void
1167:             * fixturesApplyAddAccountingLineBusinessRulesInvalidStudentFeeContinueEduc() throws Exception { List sourceLines = new
1168:             * ArrayList(); List targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1169:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1170:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1171:             * "0967", "1000" ); sourceLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STUDENT_FEES);
1172:             * //sourceLine1.getAccount().setSubFundGroupCode("FAIL"); sourceLines.add( sourceLine1 ); addFixture(
1173:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureSourceAccountingLine( "0967",
1174:             * "1000" ); targetLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STUDENT_FEES);
1175:             * //sourceLine1.getAccount().setSubFundGroupCode("FAIL"); targetLines.add( sourceLine1 ); addFixture(
1176:             * KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1177:             * fixturesApplyAddAccountingLineBusinessRulesValidStudentFeeContinueEduc() throws Exception { List sourceLines = new
1178:             * ArrayList(); List targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1179:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1180:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1181:             * "0967", "1000" ); sourceLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STUDENT_FEES);
1182:             * SubFundGroup sfg = new SubFundGroup(); sfg.setSubFundGroupCode(SUB_FUND_GROUP_CODE.CONTINUE_EDUC);
1183:             * sourceLine1.getAccount().setSubFundGroup(sfg); sourceLines.add( sourceLine1 ); addFixture(
1184:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureSourceAccountingLine( "0967",
1185:             * "1000" ); targetLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STUDENT_FEES);
1186:             * //sourceLine1.getAccount().setSubFundGroupCode("FAIL"); targetLines.add( sourceLine1 ); addFixture(
1187:             * KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1188:             * fixturesApplyAddAccountingLineBusinessRulesInvalidCapObjCodes() throws Exception { List sourceLines = new ArrayList(); List
1189:             * targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1190:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1191:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1192:             * "1696", "1000" ); AccountingLine sourceLine2 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine3 =
1193:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine4 = fixtureSourceAccountingLine( "1696", "1000" );
1194:             * AccountingLine sourceLine5 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine6 =
1195:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine7 = fixtureSourceAccountingLine( "1696", "1000" );
1196:             * sourceLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP);
1197:             * sourceLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP_FED_FUND);
1198:             * sourceLine3.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP_OTHER_OWN);
1199:             * sourceLine4.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CONSTRUCTION_IN_PROG);
1200:             * sourceLine5.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED);
1201:             * sourceLine6.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED_FED_FUND);
1202:             * sourceLine7.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED_FED_OWN);
1203:             * sourceLines.add( sourceLine1 ); sourceLines.add(sourceLine2); sourceLines.add(sourceLine3); sourceLines.add(sourceLine4);
1204:             * sourceLines.add(sourceLine5); sourceLines.add(sourceLine6); sourceLines.add(sourceLine7); addFixture(
1205:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696",
1206:             * "1000" ); AccountingLine targetLine2 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine3 =
1207:             * fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine4 = fixtureTargetAccountingLine( "1696", "1000" );
1208:             * AccountingLine targetLine5 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine6 =
1209:             * fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine7 = fixtureTargetAccountingLine( "1696", "1000" );
1210:             * targetLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP);
1211:             * targetLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP_FED_FUND);
1212:             * targetLine3.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CAP_MOVE_EQUIP_OTHER_OWN);
1213:             * targetLine4.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CONSTRUCTION_IN_PROG);
1214:             * targetLine5.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED);
1215:             * targetLine6.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED_FED_FUND);
1216:             * targetLine7.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.UNIV_CONSTRUCTED_FED_OWN);
1217:             * targetLines.add( targetLine1 ); targetLines.add(targetLine2); targetLines.add(targetLine3); targetLines.add(targetLine4);
1218:             * targetLines.add(targetLine5); targetLines.add(targetLine6); targetLines.add(targetLine7); addFixture(
1219:             * KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1220:             * fixturesApplyAddAccountingLineBusinessRulesValidCapObjCodes() throws Exception { } public void
1221:             * fixturesApplyAddAccountingLineBusinessRulesInvalidConsolidatedObjCode() throws Exception { List sourceLines = new
1222:             * ArrayList(); List targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1223:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1224:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1225:             * "1696", "1000" ); AccountingLine sourceLine2 = fixtureSourceAccountingLine( "1696", "1000" ); ObjectCons consolidatedObj1 =
1226:             * new ObjectCons(); consolidatedObj1.setFinConsolidationObjectCode(CONSOLIDATED_OBJECT_CODE.ASSETS); ObjectCons
1227:             * consolidatedObj2 = new ObjectCons(); consolidatedObj2.setFinConsolidationObjectCode(CONSOLIDATED_OBJECT_CODE.LIABILITIES);
1228:             * sourceLine1.getObjectCode().getFinancialObjectLevel().setFinancialConsolidationObject(consolidatedObj1);
1229:             * sourceLine2.getObjectCode().getFinancialObjectLevel().setFinancialConsolidationObject(consolidatedObj2); sourceLines.add(
1230:             * sourceLine1 ); sourceLines.add(sourceLine2); addFixture( KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines );
1231:             * AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine2 =
1232:             * fixtureTargetAccountingLine( "1696", "1000" );
1233:             * targetLine1.getObjectCode().getFinancialObjectLevel().setFinancialConsolidationObject(consolidatedObj1);
1234:             * targetLine2.getObjectCode().getFinancialObjectLevel().setFinancialConsolidationObject(consolidatedObj2); targetLines.add(
1235:             * targetLine1 ); targetLines.add(targetLine2); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public
1236:             * void fixturesApplyAddAccountingLineBusinessRulesInvalidObjCodeSubTypes() throws Exception { List sourceLines = new
1237:             * ArrayList(); List targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1238:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1239:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1240:             * "1696", "1000" ); AccountingLine sourceLine2 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine3 =
1241:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine4 = fixtureSourceAccountingLine( "1696", "1000" );
1242:             * AccountingLine sourceLine5 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine6 =
1243:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine7 = fixtureSourceAccountingLine( "1696", "1000" );
1244:             * AccountingLine sourceLine8 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine9 =
1245:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine10 = fixtureSourceAccountingLine( "1696", "1000" );
1246:             * AccountingLine sourceLine11 = fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine12 =
1247:             * fixtureSourceAccountingLine( "1696", "1000" ); AccountingLine sourceLine13 = fixtureSourceAccountingLine( "1696", "1000" );
1248:             * sourceLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.BUDGET_ONLY);
1249:             * sourceLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CONSTRUCTION_IN_PROG);
1250:             * sourceLine3.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.HOURLY_WAGES);
1251:             * sourceLine4.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.MANDATORY_TRANSFER);
1252:             * sourceLine5.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.RESERVES);
1253:             * sourceLine6.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.WRITE_OFF);
1254:             * sourceLine7.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.SALARIES_WAGES);
1255:             * sourceLine8.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STATE_APP);
1256:             * sourceLine9.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.SALARIES);
1257:             * sourceLine10.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.PLANT);
1258:             * sourceLine11.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.INVEST);
1259:             * sourceLine12.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.FRINGE_BEN);
1260:             * sourceLine13.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.NON_MANDATORY_TRANSFER);
1261:             * sourceLines.add( sourceLine1 ); sourceLines.add(sourceLine2); sourceLines.add(sourceLine3); sourceLines.add(sourceLine4);
1262:             * sourceLines.add(sourceLine5); sourceLines.add(sourceLine6); sourceLines.add(sourceLine7); sourceLines.add(sourceLine8);
1263:             * sourceLines.add(sourceLine9); sourceLines.add(sourceLine10); sourceLines.add(sourceLine11); sourceLines.add(sourceLine12);
1264:             * sourceLines.add(sourceLine13); addFixture( KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine
1265:             * targetLine1 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine2 = fixtureTargetAccountingLine(
1266:             * "1696", "1000" ); AccountingLine targetLine3 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine4 =
1267:             * fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine5 = fixtureTargetAccountingLine( "1696", "1000" );
1268:             * AccountingLine targetLine6 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine7 =
1269:             * fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine8 = fixtureTargetAccountingLine( "1696", "1000" );
1270:             * AccountingLine targetLine9 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine10 =
1271:             * fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine11 = fixtureTargetAccountingLine( "1696", "1000" );
1272:             * AccountingLine targetLine12 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine13 =
1273:             * fixtureTargetAccountingLine( "1696", "1000" );
1274:             * targetLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.BUDGET_ONLY);
1275:             * targetLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.CONSTRUCTION_IN_PROG);
1276:             * targetLine3.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.HOURLY_WAGES);
1277:             * targetLine4.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.MANDATORY_TRANSFER);
1278:             * targetLine5.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.RESERVES);
1279:             * targetLine6.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.WRITE_OFF);
1280:             * targetLine7.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.SALARIES_WAGES);
1281:             * targetLine8.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.STATE_APP);
1282:             * targetLine9.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.SALARIES);
1283:             * targetLine10.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.PLANT);
1284:             * targetLine11.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.INVEST);
1285:             * targetLine12.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.FRINGE_BEN);
1286:             * targetLine13.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.NON_MANDATORY_TRANSFER);
1287:             * targetLines.add( targetLine1 ); targetLines.add(targetLine2); targetLines.add(targetLine3); targetLines.add(targetLine4);
1288:             * targetLines.add(targetLine5); targetLines.add(targetLine6); targetLines.add(targetLine7); targetLines.add(targetLine8);
1289:             * targetLines.add(targetLine9); targetLines.add(targetLine10); targetLines.add(targetLine11); targetLines.add(targetLine12);
1290:             * targetLines.add(targetLine13); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1291:             * fixturesApplyAddAccountingLineBusinessRulesValidObjCodeSubTypes() throws Exception { } public void
1292:             * fixturesApplyAddAccountingLineBusinessRulesInvalidObjLevelCode() throws Exception { List sourceLines = new ArrayList(); List
1293:             * targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1294:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1295:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1296:             * "1696", "1000" ); ObjLevel level = new ObjLevel(); level.setFinancialObjectLevelCode(OBJECT_LEVEL_CODE.CONTRACT_GRANTS);
1297:             * sourceLine1.getObjectCode().setFinancialObjectLevel(level); sourceLines.add( sourceLine1 ); addFixture(
1298:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696",
1299:             * "1000" ); targetLine1.getObjectCode().setFinancialObjectLevel(level); targetLines.add( targetLine1 ); addFixture(
1300:             * KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1301:             * fixturesApplyAddAccountingLineBusinessRulesValidObjLevelCode() throws Exception { } public void
1302:             * fixturesApplyAddAccountingLineBusinessRulesInvalidObjType() throws Exception { List sourceLines = new ArrayList(); List
1303:             * targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1304:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1305:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1306:             * "1696", "1000" ); AccountingLine sourceLine2 = fixtureSourceAccountingLine( "1696", "1000" );
1307:             * sourceLine1.getObjectCode().setFinancialObjectCode(OBJECT_TYPE_CODE.INCOME_NOT_CASH);
1308:             * sourceLine2.getObjectCode().setFinancialObjectCode(OBJECT_TYPE_CODE.EXPENSE_NOT_EXPENDITURE); sourceLines.add( sourceLine1 );
1309:             * sourceLines.add(sourceLine2); addFixture( KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine
1310:             * targetLine1 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine2 = fixtureTargetAccountingLine(
1311:             * "1696", "1000" ); targetLine1.getObjectCode().setFinancialObjectCode(OBJECT_TYPE_CODE.INCOME_NOT_CASH);
1312:             * targetLine2.getObjectCode().setFinancialObjectCode(OBJECT_TYPE_CODE.EXPENSE_NOT_EXPENDITURE); targetLines.add( targetLine1 );
1313:             * targetLines.add(targetLine2); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1314:             * fixturesApplyAddAccountingLineBusinessRulesValidObjType() throws Exception { } public void
1315:             * fixturesApplyAddAccountingLineBusinessRulesInvalidObjSubTypeAssessOrTransOfFunds() throws Exception { List sourceLines = new
1316:             * ArrayList(); List targetLines = new ArrayList(); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture(
1317:             * KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with invalid
1318:             * sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 = fixtureSourceAccountingLine(
1319:             * "1696", "1000" ); AccountingLine sourceLine2 = fixtureSourceAccountingLine( "1696", "1000" );
1320:             * sourceLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.ASSESSMENT);
1321:             * sourceLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.TRANSFER_OF_FUNDS); sourceLines.add(
1322:             * sourceLine1 ); sourceLines.add(sourceLine2); addFixture( KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines );
1323:             * AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696", "1000" ); AccountingLine targetLine2 =
1324:             * fixtureTargetAccountingLine( "1696", "1000" );
1325:             * targetLine1.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.ASSESSMENT);
1326:             * targetLine2.getObjectCode().getFinancialObjectSubType().setCode(OBJECT_SUB_TYPE_CODE.TRANSFER_OF_FUNDS); targetLines.add(
1327:             * targetLine1 ); targetLines.add(targetLine2); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public
1328:             * void fixturesApplyAddAccountingLineBusinessRulesValidObjSubTypeAssessOrTransOfFunds() throws Exception { } public void
1329:             * fixturesApplyAddAccountingLineBusinessRulesInvalidFundGroup() throws Exception { List sourceLines = new ArrayList(); List
1330:             * targetLines = new ArrayList(); //This sub fund group needs to have a fund group //code of FUND_GROUP_CODE.LOAN_FUND This may
1331:             * not be necessary if we have an appropriate account BusinessObjectService boService =
1332:             * SpringContext.getBean(BusinessObjectService.class); String subFundGroupCode = "SOME_CODE"; Map subFundGroupId = new
1333:             * HashMap(); subFundGroupId.put("code", subFundGroupCode); SubFundGroup sfg = (SubFundGroup)
1334:             * boService.findByPrimaryKey(SubFundGroup.class, subFundGroupId); addFixture( KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" );
1335:             * addFixture( KualiRuleTestCase.EXPLANATION, "This is a test document, testing invalid object sub-type (Student Fees) " + "with
1336:             * invalid sub-fund group (DCEDU) " + "accounting line business rules." ); AccountingLine sourceLine1 =
1337:             * fixtureSourceAccountingLine( "1696", "1000" ); sourceLines.add( sourceLine1 ); addFixture(
1338:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696",
1339:             * "1000" ); targetLines.add( targetLine1 ); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); } public void
1340:             * fixturesApplyAddAccountingLineBusinessRulesInvalidSubFundGroup() throws Exception { //Doing this test requires grabbing
1341:             * //SUB_FUND_GROUP_CODE.CODE_RETIRE_INDEBT.equals(subFundGroup) //||
1342:             * SUB_FUND_GROUP_CODE.CODE_INVESTMENT_PLANT.equals(subFundGroup) List sourceLines = new ArrayList(); List targetLines = new
1343:             * ArrayList(); //This sub fund group needs to have a fund group //code of FUND_GROUP_CODE.LOAN_FUND This may not be necessary
1344:             * if we have an appropriate account BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
1345:             * String subFundGroupCode = "SOME_CODE"; Map subFundGroupId = new HashMap(); subFundGroupId.put("code", subFundGroupCode);
1346:             * SubFundGroup sfg = (SubFundGroup) boService.findByPrimaryKey(SubFundGroup.class, subFundGroupId); addFixture(
1347:             * KualiRuleTestCase.DOCUMENT_DESCRIPTION, "test" ); addFixture( KualiRuleTestCase.EXPLANATION, "This is a test document,
1348:             * testing invalid object sub-type (Student Fees) " + "with invalid sub-fund group (DCEDU) " + "accounting line business rules." );
1349:             * AccountingLine sourceLine1 = fixtureSourceAccountingLine( "1696", "1000" ); sourceLines.add( sourceLine1 ); addFixture(
1350:             * KualiRuleTestCase.SOURCE_ACCOUNTING_LINES, sourceLines ); AccountingLine targetLine1 = fixtureTargetAccountingLine( "1696",
1351:             * "1000" ); targetLines.add( targetLine1 ); addFixture( KualiRuleTestCase.TARGET_ACCOUNTING_LINES, targetLines ); }
1352:             */
1353:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.