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