0001: /*
0002: * Copyright 2006-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.gl.service;
0017:
0018: import java.util.Calendar;
0019:
0020: import org.kuali.core.service.PersistenceService;
0021: import org.kuali.kfs.context.SpringContext;
0022: import org.kuali.module.gl.OriginEntryTestBase;
0023: import org.kuali.module.gl.bo.OriginEntrySource;
0024: import org.kuali.test.ConfigureContext;
0025:
0026: /**
0027: * Tests the ScrubberService
0028: */
0029: @ConfigureContext
0030: public class ScrubberServiceTest extends OriginEntryTestBase {
0031: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
0032: .getLogger(ScrubberServiceTest.class);
0033:
0034: private ScrubberService scrubberService = null;
0035:
0036: @Override
0037: protected void setUp() throws Exception {
0038: super .setUp();
0039:
0040: LOG.debug("setUp() started");
0041:
0042: scrubberService = SpringContext.getBean(ScrubberService.class);
0043: scrubberService.setDateTimeService(dateTimeService);
0044: persistenceService = SpringContext
0045: .getBean(PersistenceService.class);
0046:
0047: // Get the test date time service so we can specify the date/time of the run
0048: Calendar c = Calendar.getInstance();
0049: c.set(Calendar.DAY_OF_MONTH, 1);
0050: c.set(Calendar.MONTH, Calendar.JANUARY);
0051: c.set(Calendar.YEAR, 2006);
0052:
0053: // since the cutoff time is set to 10am (KFSP1/Scrubber+cutoff+time+configuration)
0054: // we want to ensure that the time is always after that time so the cutoff algorithm is not invoked
0055: c.set(Calendar.HOUR_OF_DAY, 23);
0056: c.set(Calendar.MINUTE, 59);
0057: c.set(Calendar.SECOND, 59);
0058:
0059: date = c.getTime();
0060: dateTimeService.setCurrentDate(date);
0061: }
0062:
0063: /**
0064: * Tests the scrubber considers entries with certain fields blank as errors
0065: *
0066: * @throws Exception thrown if any exception is encountered for any reason
0067: */
0068: public void testMiscellaneousBlankFields() throws Exception {
0069:
0070: String[] stringInput = new String[] {
0071: "2007 6044900-----5300---ACEE07CHKDPDBLANKCHAR 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
0072: "2007BA -----5300---ACEE07CHKDPDBLANKACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
0073: "2007BA6044900----- ---ACEE07CHKDPDBLANKOBJ 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
0074: "2007BA6044900-----5300---ACEE07 PDBLANKDOCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
0075: "2007BA6044900-----5300---ACEE07CHKD BLANKORIG 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
0076: "2007BA6044900-----5300---ACEE07CHKDPD 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ", };
0077:
0078: // Add inputs to expected output ...
0079: EntryHolder output[] = new EntryHolder[12];
0080: for (int i = 0; i < stringInput.length; i++) {
0081: output[i] = new EntryHolder(OriginEntrySource.BACKUP,
0082: stringInput[i]);
0083: }
0084:
0085: int c = stringInput.length;
0086: output[c++] = new EntryHolder(
0087: OriginEntrySource.SCRUBBER_ERROR,
0088: "2007BA -----5300---ACEE07CHKDPDBLANKACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0089: output[c++] = new EntryHolder(
0090: OriginEntrySource.SCRUBBER_ERROR,
0091: "2007 6044900-----5300---ACEE07CHKDPDBLANKCHAR 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0092: output[c++] = new EntryHolder(
0093: OriginEntrySource.SCRUBBER_ERROR,
0094: "2007BA6044900----- ---ACEE07CHKDPDBLANKOBJ 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0095: output[c++] = new EntryHolder(
0096: OriginEntrySource.SCRUBBER_ERROR,
0097: "2007BA6044900-----5300---ACEE07CHKDPD 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0098: output[c++] = new EntryHolder(
0099: OriginEntrySource.SCRUBBER_ERROR,
0100: "2007BA6044900-----5300---ACEE07CHKD BLANKORIG 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0101: output[c++] = new EntryHolder(
0102: OriginEntrySource.SCRUBBER_ERROR,
0103: "2007BA6044900-----5300---ACEE07 PDBLANKDOCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ");
0104:
0105: scrub(stringInput);
0106: assertOriginEntries(4, output);
0107: }
0108:
0109: /**
0110: * Tests that the scrubber generates cost share encumbrances for pre-encumbrance entries
0111: * @throws Exception thrown if any exception is encountered for any reason
0112: */
0113: public void testCostShareEncumbrancesForPreEncumbrances()
0114: throws Exception {
0115:
0116: // Inputs.
0117: String[] stringInput = new String[] {
0118: "2007BL4631625CS0018000---PEAS07PE 01CSENCPE 00000TP Generated Offset 1650.00C2006-01-05 ---------- D ",
0119: "2007BL4631625CS0014866---PEEX07PE 01CSENCPE 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D " };
0120:
0121: // Add inputs to expected output ...
0122: EntryHolder output[] = new EntryHolder[6];
0123: for (int i = 0; i < stringInput.length; i++) {
0124: output[i] = new EntryHolder(OriginEntrySource.BACKUP,
0125: stringInput[i]);
0126: }
0127:
0128: // ... add expected output ...
0129: output[2] = new EntryHolder(
0130: OriginEntrySource.SCRUBBER_VALID,
0131: "2007BL1031400-----9940---CEEX07PE 01CSENCPE 00000Correction to: 01-PU3355206 FR-BL4631625 1650.00D2006-01-01 ---------- D ");
0132: output[3] = new EntryHolder(
0133: OriginEntrySource.SCRUBBER_VALID,
0134: "2007BL1031400-----9893---CEFB07PE 01CSENCPE 00000GENERATED OFFSET 1650.00C2006-01-01 ---------- ");
0135: output[4] = new EntryHolder(
0136: OriginEntrySource.SCRUBBER_VALID,
0137: "2007BL4631625CS0014866---PEEX07PE 01CSENCPE 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D ");
0138: output[5] = new EntryHolder(
0139: OriginEntrySource.SCRUBBER_VALID,
0140: "2007BL4631625CS0018000---PEAS07PE 01CSENCPE 00000TP Generated Offset 1650.00C2006-01-05 ---------- D ");
0141:
0142: scrub(stringInput);
0143:
0144: assertOriginEntries(4, output);
0145: }
0146:
0147: /**
0148: * Tests that the scrubber generates cost share encumbrances for internal encumbrances entries
0149: * @throws Exception thrown if any exception is encountered for any reason
0150: */
0151: public void testCostShareEncumbrancesForInternalEncumbrances()
0152: throws Exception {
0153:
0154: String[] stringInput = new String[] {
0155: "2007BL4631618CS0014190---IEEX07PAYE01CSENCIE 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- D ",
0156: "2007BL4631618CS0018000---IEAS07PAYE01CSENCIE 00000TP Generated Offset 40.72D2006-01-05 ---------- D " };
0157:
0158: // Add inputs to expected output ...
0159: EntryHolder[] output = new EntryHolder[6];
0160: for (int i = 0; i < stringInput.length; i++) {
0161: output[i] = new EntryHolder(OriginEntrySource.BACKUP,
0162: stringInput[i]);
0163: }
0164:
0165: // ... add expected output ...
0166: output[2] = new EntryHolder(
0167: OriginEntrySource.SCRUBBER_VALID,
0168: "2007BL1031400-----9940---CEEX07PAYE01CSENCIE 00000THOMAS BUSEY/NEWEGG COMPUTERFR-BL4631618 40.72C2006-01-01 ---------- D ");
0169: output[3] = new EntryHolder(
0170: OriginEntrySource.SCRUBBER_VALID,
0171: "2007BL1031400-----9893---CEFB07PAYE01CSENCIE 00000GENERATED OFFSET 40.72D2006-01-01 ---------- ");
0172: output[4] = new EntryHolder(
0173: OriginEntrySource.SCRUBBER_VALID,
0174: "2007BL4631618CS0014190---IEEX07PAYE01CSENCIE 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- D ");
0175: output[5] = new EntryHolder(
0176: OriginEntrySource.SCRUBBER_VALID,
0177: "2007BL4631618CS0018000---IEAS07PAYE01CSENCIE 00000TP Generated Offset 40.72D2006-01-05 ---------- D ");
0178:
0179: // ... and run the test.
0180: scrub(stringInput);
0181: assertOriginEntries(4, output);
0182: }
0183:
0184: /**
0185: * Tests that the scrubber generates cost share encumbrances for external encumbrance entries
0186: * @throws Exception thrown if any exception is encountered for any reason
0187: */
0188: public void testCostShareEncumbrancesForExternalEncumbrances()
0189: throws Exception {
0190:
0191: String[] stringInput = new String[] {
0192: "2007BL4631601CS0011800---EXIN07EXENLGCSENCEX 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D ",
0193: "2007BL4631601CS0019041---EXLI07EXENLGCSENCEX 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D " };
0194:
0195: // Add inputs to expected output ...
0196: EntryHolder output[] = new EntryHolder[4];
0197: for (int i = 0; i < stringInput.length; i++) {
0198: output[i] = new EntryHolder(OriginEntrySource.BACKUP,
0199: stringInput[i]);
0200: }
0201:
0202: int c = stringInput.length;
0203: output[c++] = new EntryHolder(
0204: OriginEntrySource.SCRUBBER_VALID,
0205: "2007BL4631601CS0011800---EXIN07EXENLGCSENCEX 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D ");
0206: output[c++] = new EntryHolder(
0207: OriginEntrySource.SCRUBBER_VALID,
0208: "2007BL4631601CS0019041---EXLI07EXENLGCSENCEX 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D ");
0209:
0210: scrub(stringInput);
0211: assertOriginEntries(4, output);
0212: }
0213:
0214: /**
0215: * Tests that the scrubber does not generate cost share encumbrances for entries with cost share encumbrances
0216: * @throws Exception thrown if any exception is encountered for any reason
0217: */
0218: public void testNoCostShareEncumbrancesForCostShareEncumbrances()
0219: throws Exception {
0220:
0221: String[] stringInput = new String[] {
0222: "2007BL4631625CS0018000---CEAS07EXEN01NOCSENCE 00000TP Generated Offset 1650.00C2006-01-05 ---------- D ",
0223: "2007BL4631625CS0014866---CEEX07EXEN01NOCSENCE 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D " };
0224:
0225: EntryHolder output[] = new EntryHolder[] {
0226: new EntryHolder(OriginEntrySource.BACKUP,
0227: stringInput[0]),
0228: new EntryHolder(OriginEntrySource.BACKUP,
0229: stringInput[1]),
0230: new EntryHolder(
0231: OriginEntrySource.SCRUBBER_VALID,
0232: "2007BL4631625CS0014866---CEEX07EXEN01NOCSENCE 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D "),
0233: new EntryHolder(
0234: OriginEntrySource.SCRUBBER_VALID,
0235: "2007BL4631625CS0018000---CEAS07EXEN01NOCSENCE 00000TP Generated Offset 1650.00C2006-01-05 ---------- D ") };
0236:
0237: scrub(stringInput);
0238: assertOriginEntries(4, output);
0239:
0240: }
0241:
0242: /**
0243: * Tests that the scrubber does not generate cost share encumbrances for entries created by the journal voucher document
0244: * @throws Exception thrown if any exception is encountered for any reason
0245: */
0246: public void testNoCostShareEncumbrancesForJournalVoucher()
0247: throws Exception {
0248:
0249: String[] input = new String[] {
0250: "2007BL4631618CS0014190---EXEX07JV 01NOCSENJV 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- D ",
0251: "2007BL4631618CS0018000---EXAS07JV 01NOCSENJV 00000TP Generated Offset 40.72D2006-01-05 ---------- D " };
0252:
0253: EntryHolder[] output = new EntryHolder[] {
0254: new EntryHolder(
0255: OriginEntrySource.BACKUP,
0256: "2007BL4631618CS0014190---EXEX07JV 01NOCSENJV 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- D "),
0257: new EntryHolder(
0258: OriginEntrySource.BACKUP,
0259: "2007BL4631618CS0018000---EXAS07JV 01NOCSENJV 00000TP Generated Offset 40.72D2006-01-05 ---------- D "),
0260: new EntryHolder(
0261: OriginEntrySource.SCRUBBER_VALID,
0262: "2007BL4631618CS0014190---EXEX07JV 01NOCSENJV 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- D "),
0263: new EntryHolder(
0264: OriginEntrySource.SCRUBBER_VALID,
0265: "2007BL4631618CS0018000---EXAS07JV 01NOCSENJV 00000TP Generated Offset 40.72D2006-01-05 ---------- D "), };
0266:
0267: scrub(input);
0268: assertOriginEntries(4, output);
0269: }
0270:
0271: /**
0272: * Tests that the scrubber does not generate cost share encumbrances for beginning balance entries
0273: * @throws Exception thrown if any exception is encountered for any reason
0274: */
0275: public void testNoCostShareEncumbrancesForBeginningBalances()
0276: throws Exception {
0277:
0278: String[] input = new String[] {
0279: "2007BL4631601CS0011800---EXINCBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D ",
0280: "2007BL4631601CS0019041---EXLICBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D " };
0281:
0282: EntryHolder[] output = new EntryHolder[] {
0283: new EntryHolder(
0284: OriginEntrySource.BACKUP,
0285: "2007BL4631601CS0011800---EXINCBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D "),
0286: new EntryHolder(
0287: OriginEntrySource.BACKUP,
0288: "2007BL4631601CS0019041---EXLICBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D "),
0289: new EntryHolder(
0290: OriginEntrySource.SCRUBBER_VALID,
0291: "2007BL4631601CS0011800---EXINCBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D "),
0292: new EntryHolder(
0293: OriginEntrySource.SCRUBBER_VALID,
0294: "2007BL4631601CS0019041---EXLICBTOPSLGNOCSENCB 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D ") };
0295:
0296: scrub(input);
0297: assertOriginEntries(4, output);
0298: }
0299:
0300: /**
0301: * Tests that the scrubber does not generate cost share encumbrances for entries with a balance type of "actual"
0302: * @throws Exception thrown if any exception is encountered for any reason
0303: */
0304: public void testNoCostShareEncumbrancesForActuals()
0305: throws Exception {
0306:
0307: String[] input = new String[] {
0308: "2007BL4631625CS0018000---ACAS07IB 01NOCSENAC 00000TP Generated Offset 1650.00C2006-01-05 ---------- D ",
0309: "2007BL4631625CS0014866---ACEX07IB 01NOCSENAC 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D " };
0310:
0311: EntryHolder[] output = new EntryHolder[] {
0312: new EntryHolder(
0313: OriginEntrySource.BACKUP,
0314: "2007BL4631625CS0018000---ACAS07IB 01NOCSENAC 00000TP Generated Offset 1650.00C2006-01-05 ---------- D "),
0315: new EntryHolder(
0316: OriginEntrySource.BACKUP,
0317: "2007BL4631625CS0014866---ACEX07IB 01NOCSENAC 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- D "),
0318: new EntryHolder(
0319: OriginEntrySource.SCRUBBER_VALID,
0320: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 1650.00C2006-01-01 ---------- "),
0321: new EntryHolder(
0322: OriginEntrySource.SCRUBBER_VALID,
0323: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 1650.00D2006-01-01 ---------- "),
0324: new EntryHolder(
0325: OriginEntrySource.SCRUBBER_VALID,
0326: "2007BL1031400-----9940---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 1650.00D2006-01-01 ---------- "),
0327: new EntryHolder(
0328: OriginEntrySource.SCRUBBER_VALID,
0329: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 1650.00C2006-01-01 ---------- "),
0330: new EntryHolder(
0331: OriginEntrySource.SCRUBBER_VALID,
0332: "2007BL4631625CS0014866---ACEX07IB 01NOCSENAC 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- "),
0333: new EntryHolder(
0334: OriginEntrySource.SCRUBBER_VALID,
0335: "2007BL4631625CS0018000---ACAS07IB 01NOCSENAC 00000TP Generated Offset 1650.00C2006-01-05 ---------- ") };
0336:
0337: scrub(input);
0338: assertOriginEntries(4, output);
0339: }
0340:
0341: /**
0342: * Tests that the scrubber does not generate cost share encumbrances for entries with budget balance types
0343: * @throws Exception thrown if any exception is encountered for any reason
0344: */
0345: public void testNoCostShareEncumbrancesForBudget() throws Exception {
0346:
0347: String[] input = new String[] {
0348: "2007BL4631618CS0014190---BBEX07GEC 01NOCSENBB 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72 2006-01-05 ---------- D ",
0349: "2007BL4631618CS0018000---BBAS07GEC 01NOCSENBB 00000TP Generated Offset 40.72 2006-01-05 ---------- D " };
0350:
0351: EntryHolder[] output = new EntryHolder[] {
0352: new EntryHolder(
0353: OriginEntrySource.BACKUP,
0354: "2007BL4631618CS0014190---BBEX07GEC 01NOCSENBB 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72 2006-01-05 ---------- D "),
0355: new EntryHolder(
0356: OriginEntrySource.BACKUP,
0357: "2007BL4631618CS0018000---BBAS07GEC 01NOCSENBB 00000TP Generated Offset 40.72 2006-01-05 ---------- D "),
0358: new EntryHolder(
0359: OriginEntrySource.SCRUBBER_VALID,
0360: "2007BL4631618CS0014190---BBEX07GEC 01NOCSENBB 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72 2006-01-05 ---------- "),
0361: new EntryHolder(
0362: OriginEntrySource.SCRUBBER_VALID,
0363: "2007BL4631618CS0018000---BBAS07GEC 01NOCSENBB 00000TP Generated Offset 40.72 2006-01-05 ---------- ") };
0364:
0365: scrub(input);
0366: assertOriginEntries(4, output);
0367: }
0368:
0369: /**
0370: * Tests that the scrubber does not generate cost share encumbrances for entries that do not represent expenses
0371: * @throws Exception thrown if any exception is encountered for any reason
0372: */
0373: public void testNoCostShareForEncumbrancesNonExpenses()
0374: throws Exception {
0375:
0376: String[] input = new String[] {
0377: "2007BL4631601CS0011800---EXIN07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D ",
0378: "2007BL4631601CS0019041---EXLI07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D ", };
0379:
0380: EntryHolder[] output = new EntryHolder[] {
0381: new EntryHolder(
0382: OriginEntrySource.BACKUP,
0383: "2007BL4631601CS0011800---EXIN07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D "),
0384: new EntryHolder(
0385: OriginEntrySource.BACKUP,
0386: "2007BL4631601CS0019041---EXLI07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D "),
0387: new EntryHolder(
0388: OriginEntrySource.SCRUBBER_VALID,
0389: "2007BL4631601CS0011800---EXIN07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- D "),
0390: new EntryHolder(
0391: OriginEntrySource.SCRUBBER_VALID,
0392: "2007BL4631601CS0019041---EXLI07TOPSLGNOCSENIN 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- D ") };
0393:
0394: scrub(input);
0395: assertOriginEntries(4, output);
0396: }
0397:
0398: /**
0399: * Tests that the scrubber generates miscellaneous cost share entries
0400: * @throws Exception thrown if any exception is encountered for any reason
0401: */
0402: public void testCostShareOther() throws Exception {
0403:
0404: String[] input = new String[] {
0405: "2007BL4631625CS0014000---ACEX07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
0406: "2007BL4631625CS0018000---ACAS07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
0407:
0408: EntryHolder[] output = new EntryHolder[] {
0409: new EntryHolder(
0410: OriginEntrySource.BACKUP,
0411: "2007BL4631625CS0014000---ACEX07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0412: new EntryHolder(
0413: OriginEntrySource.BACKUP,
0414: "2007BL4631625CS0018000---ACAS07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
0415: new EntryHolder(
0416: OriginEntrySource.SCRUBBER_VALID,
0417: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
0418: new EntryHolder(
0419: OriginEntrySource.SCRUBBER_VALID,
0420: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
0421: new EntryHolder(
0422: OriginEntrySource.SCRUBBER_VALID,
0423: "2007BL1031400-----9940---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
0424: new EntryHolder(
0425: OriginEntrySource.SCRUBBER_VALID,
0426: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
0427: new EntryHolder(
0428: OriginEntrySource.SCRUBBER_VALID,
0429: "2007BL4631625CS0014000---ACEX07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0430: new EntryHolder(
0431: OriginEntrySource.SCRUBBER_VALID,
0432: "2007BL4631625CS0018000---ACAS07DI EUCSHROTHER 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
0433:
0434: scrub(input);
0435: assertOriginEntries(4, output);
0436: }
0437:
0438: /**
0439: * Tests that the scrubber generates cost share entries for entries with object code level == "TRIN"
0440: * @throws Exception thrown if any exception is encountered for any reason
0441: */
0442: public void testCostShareForLevelTrin() throws Exception {
0443:
0444: String[] input = new String[] {
0445: "2007BL4631618CS0019915---ACEX07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
0446: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
0447:
0448: EntryHolder[] output = new EntryHolder[] {
0449: new EntryHolder(
0450: OriginEntrySource.BACKUP,
0451: "2007BL4631618CS0019915---ACEX07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0452: new EntryHolder(
0453: OriginEntrySource.BACKUP,
0454: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0455: new EntryHolder(
0456: OriginEntrySource.SCRUBBER_VALID,
0457: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0458: new EntryHolder(
0459: OriginEntrySource.SCRUBBER_VALID,
0460: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
0461: new EntryHolder(
0462: OriginEntrySource.SCRUBBER_VALID,
0463: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
0464: new EntryHolder(
0465: OriginEntrySource.SCRUBBER_VALID,
0466: "2007BL1031400-----9915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
0467: new EntryHolder(
0468: OriginEntrySource.SCRUBBER_VALID,
0469: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
0470: new EntryHolder(
0471: OriginEntrySource.SCRUBBER_VALID,
0472: "2007BL4631618CS0019915---ACEX07DI 01CSHRTRIN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "), };
0473:
0474: scrub(input);
0475: assertOriginEntries(4, output);
0476: }
0477:
0478: /**
0479: * Tests that the scrubber generates cost share entries for entries with object code level == "TREX"
0480: * @throws Exception thrown if any exception is encountered for any reason
0481: */
0482: public void testCostShareForLevelTrex() throws Exception {
0483:
0484: String[] input = new String[] {
0485: "2007BL4631601CS0019900---ACEX07CR 01CSHRTREX 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
0486: "2007BL4631601CS0018000---ACAS07CR 01CSHRTREX 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
0487:
0488: EntryHolder[] output = new EntryHolder[] {
0489: new EntryHolder(
0490: OriginEntrySource.BACKUP,
0491: "2007BL4631601CS0019900---ACEX07CR 01CSHRTREX 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0492: new EntryHolder(
0493: OriginEntrySource.BACKUP,
0494: "2007BL4631601CS0018000---ACAS07CR 01CSHRTREX 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0495: new EntryHolder(
0496: OriginEntrySource.SCRUBBER_VALID,
0497: "2007BL4631601CS0018000---ACAS07CR 01CSHRTREX 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0498: new EntryHolder(
0499: OriginEntrySource.SCRUBBER_VALID,
0500: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
0501: new EntryHolder(
0502: OriginEntrySource.SCRUBBER_VALID,
0503: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
0504: new EntryHolder(
0505: OriginEntrySource.SCRUBBER_VALID,
0506: "2007BL1031400-----9959---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
0507: new EntryHolder(
0508: OriginEntrySource.SCRUBBER_VALID,
0509: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
0510: new EntryHolder(
0511: OriginEntrySource.SCRUBBER_VALID,
0512: "2007BL4631601CS0019900---ACEX07CR 01CSHRTREX 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "), };
0513:
0514: scrub(input);
0515: assertOriginEntries(4, output);
0516: }
0517:
0518: /**
0519: * Tests that the scrubber generates cost share entries for entries with object code level == "TRAV"
0520: * @throws Exception thrown if any exception is encountered for any reason
0521: */
0522: public void testCostShareForLevelTrav() throws Exception {
0523:
0524: String[] input = new String[] {
0525: "2007BL4631625CS0016000---ACEX07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
0526: "2007BL4631625CS0018000---ACAS07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
0527:
0528: EntryHolder[] output = new EntryHolder[] {
0529: new EntryHolder(
0530: OriginEntrySource.BACKUP,
0531: "2007BL4631625CS0016000---ACEX07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0532: new EntryHolder(
0533: OriginEntrySource.BACKUP,
0534: "2007BL4631625CS0018000---ACAS07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
0535: new EntryHolder(
0536: OriginEntrySource.SCRUBBER_VALID,
0537: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
0538: new EntryHolder(
0539: OriginEntrySource.SCRUBBER_VALID,
0540: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
0541: new EntryHolder(
0542: OriginEntrySource.SCRUBBER_VALID,
0543: "2007BL1031400-----9960---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
0544: new EntryHolder(
0545: OriginEntrySource.SCRUBBER_VALID,
0546: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
0547: new EntryHolder(
0548: OriginEntrySource.SCRUBBER_VALID,
0549: "2007BL4631625CS0016000---ACEX07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0550: new EntryHolder(
0551: OriginEntrySource.SCRUBBER_VALID,
0552: "2007BL4631625CS0018000---ACAS07DI EUCSHRTRAV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
0553:
0554: scrub(input);
0555: assertOriginEntries(4, output);
0556: }
0557:
0558: /**
0559: * Tests that the scrubber generates cost share entries for entries with object code level == "TRAN"
0560: * @throws Exception thrown if any exception is encountered for any reason
0561: */
0562: public void testCostShareForLevelTran() throws Exception {
0563:
0564: String[] input = new String[] {
0565: "2007BL4631618CS0015199---ACEX07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
0566: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
0567:
0568: EntryHolder[] output = new EntryHolder[] {
0569: new EntryHolder(
0570: OriginEntrySource.BACKUP,
0571: "2007BL4631618CS0015199---ACEX07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0572: new EntryHolder(
0573: OriginEntrySource.BACKUP,
0574: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0575: new EntryHolder(
0576: OriginEntrySource.SCRUBBER_VALID,
0577: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
0578: new EntryHolder(
0579: OriginEntrySource.SCRUBBER_VALID,
0580: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
0581: new EntryHolder(
0582: OriginEntrySource.SCRUBBER_VALID,
0583: "2007BL1031400-----9959---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
0584: new EntryHolder(
0585: OriginEntrySource.SCRUBBER_VALID,
0586: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
0587: new EntryHolder(
0588: OriginEntrySource.SCRUBBER_VALID,
0589: "2007BL4631618CS0015199---ACEX07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0590: new EntryHolder(
0591: OriginEntrySource.SCRUBBER_VALID,
0592: "2007BL4631618CS0019041---ACLI07DI 01CSHRTRAN 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- ") };
0593:
0594: scrub(input);
0595: assertOriginEntries(4, output);
0596: }
0597:
0598: /**
0599: * Tests that the scrubber generates cost share entries for entries with object code level == "SAAP"
0600: * @throws Exception thrown if any exception is encountered for any reason
0601: */
0602: public void testCostShareForLevelSaap() throws Exception {
0603:
0604: String[] input = new String[] {
0605: "2007BL4631601CS0012350---ACEX07CR 01CSHRSAAP 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
0606: "2007BL4631601CS0018000---ACAS07CR 01CSHRSAAP 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
0607:
0608: EntryHolder[] output = new EntryHolder[] {
0609: new EntryHolder(
0610: OriginEntrySource.BACKUP,
0611: "2007BL4631601CS0012350---ACEX07CR 01CSHRSAAP 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0612: new EntryHolder(
0613: OriginEntrySource.BACKUP,
0614: "2007BL4631601CS0018000---ACAS07CR 01CSHRSAAP 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0615: new EntryHolder(
0616: OriginEntrySource.SCRUBBER_VALID,
0617: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
0618: new EntryHolder(
0619: OriginEntrySource.SCRUBBER_VALID,
0620: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
0621: new EntryHolder(
0622: OriginEntrySource.SCRUBBER_VALID,
0623: "2007BL1031400-----9923---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
0624: new EntryHolder(
0625: OriginEntrySource.SCRUBBER_VALID,
0626: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
0627: new EntryHolder(
0628: OriginEntrySource.SCRUBBER_VALID,
0629: "2007BL4631601CS0012350---ACEX07CR 01CSHRSAAP 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0630: new EntryHolder(
0631: OriginEntrySource.SCRUBBER_VALID,
0632: "2007BL4631601CS0018000---ACAS07CR 01CSHRSAAP 00000TP Generated Offset 20.00D2006-01-05 ---------- ") };
0633:
0634: scrub(input);
0635: assertOriginEntries(4, output);
0636: }
0637:
0638: /**
0639: * Tests that the scrubber generates cost share entries for entries with object code level == "RESV"
0640: * @throws Exception thrown if any exception is encountered for any reason
0641: */
0642: public void testCostShareForLevelResv() throws Exception {
0643:
0644: String[] input = new String[] {
0645: "2007BL4631625CS0017900---ACEX07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
0646: "2007BL4631625CS0018000---ACAS07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
0647:
0648: EntryHolder[] output = new EntryHolder[] {
0649: new EntryHolder(
0650: OriginEntrySource.BACKUP,
0651: "2007BL4631625CS0017900---ACEX07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0652: new EntryHolder(
0653: OriginEntrySource.BACKUP,
0654: "2007BL4631625CS0018000---ACAS07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
0655: new EntryHolder(
0656: OriginEntrySource.SCRUBBER_VALID,
0657: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
0658: new EntryHolder(
0659: OriginEntrySource.SCRUBBER_VALID,
0660: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
0661: new EntryHolder(
0662: OriginEntrySource.SCRUBBER_VALID,
0663: "2007BL1031400-----9979---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
0664: new EntryHolder(
0665: OriginEntrySource.SCRUBBER_VALID,
0666: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
0667: new EntryHolder(
0668: OriginEntrySource.SCRUBBER_VALID,
0669: "2007BL4631625CS0017900---ACEX07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0670: new EntryHolder(
0671: OriginEntrySource.SCRUBBER_VALID,
0672: "2007BL4631625CS0018000---ACAS07DI EUCSHRRESV 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
0673:
0674: scrub(input);
0675: assertOriginEntries(4, output);
0676: }
0677:
0678: /**
0679: * Tests that the scrubber generates cost share entries for entries with object code level == "PRSA"
0680: * @throws Exception thrown if any exception is encountered for any reason
0681: */
0682: public void testCostShareForLevelPrsa() throws Exception {
0683:
0684: String[] input = new String[] {
0685: "2007BL4631618CS0012400---ACEX07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
0686: "2007BL4631618CS0019041---ACLI07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
0687:
0688: EntryHolder[] output = new EntryHolder[] {
0689: new EntryHolder(
0690: OriginEntrySource.BACKUP,
0691: "2007BL4631618CS0012400---ACEX07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0692: new EntryHolder(
0693: OriginEntrySource.BACKUP,
0694: "2007BL4631618CS0019041---ACLI07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0695: new EntryHolder(
0696: OriginEntrySource.SCRUBBER_VALID,
0697: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
0698: new EntryHolder(
0699: OriginEntrySource.SCRUBBER_VALID,
0700: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
0701: new EntryHolder(
0702: OriginEntrySource.SCRUBBER_VALID,
0703: "2007BL1031400-----9924---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
0704: new EntryHolder(
0705: OriginEntrySource.SCRUBBER_VALID,
0706: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
0707: new EntryHolder(
0708: OriginEntrySource.SCRUBBER_VALID,
0709: "2007BL4631618CS0012400---ACEX07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0710: new EntryHolder(
0711: OriginEntrySource.SCRUBBER_VALID,
0712: "2007BL4631618CS0019041---ACLI07DI 01CSHRPRSA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- ") };
0713:
0714: scrub(input);
0715: assertOriginEntries(4, output);
0716: }
0717:
0718: /**
0719: * Tests that the scrubber generates cost share entries for entries with object code level == "PART"
0720: * @throws Exception thrown if any exception is encountered for any reason
0721: */
0722: public void testCostShareForLevelPart() throws Exception {
0723:
0724: String[] input = new String[] {
0725: "2007BL4631601CS0012300---ACEX07CR 01CSHRPART 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
0726: "2007BL4631601CS0018000---ACAS07CR 01CSHRPART 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
0727:
0728: EntryHolder[] output = new EntryHolder[] {
0729: new EntryHolder(
0730: OriginEntrySource.BACKUP,
0731: "2007BL4631601CS0012300---ACEX07CR 01CSHRPART 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0732: new EntryHolder(
0733: OriginEntrySource.BACKUP,
0734: "2007BL4631601CS0018000---ACAS07CR 01CSHRPART 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0735: new EntryHolder(
0736: OriginEntrySource.SCRUBBER_VALID,
0737: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
0738: new EntryHolder(
0739: OriginEntrySource.SCRUBBER_VALID,
0740: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
0741: new EntryHolder(
0742: OriginEntrySource.SCRUBBER_VALID,
0743: "2007BL1031400-----9923---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
0744: new EntryHolder(
0745: OriginEntrySource.SCRUBBER_VALID,
0746: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
0747: new EntryHolder(
0748: OriginEntrySource.SCRUBBER_VALID,
0749: "2007BL4631601CS0012300---ACEX07CR 01CSHRPART 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0750: new EntryHolder(
0751: OriginEntrySource.SCRUBBER_VALID,
0752: "2007BL4631601CS0018000---ACAS07CR 01CSHRPART 00000TP Generated Offset 20.00D2006-01-05 ---------- ") };
0753:
0754: scrub(input);
0755: assertOriginEntries(4, output);
0756: }
0757:
0758: /**
0759: * Tests that the scrubber generates cost share entries for entries with object code level == "ICOE"
0760: * @throws Exception thrown if any exception is encountered for any reason
0761: */
0762: public void testCostShareForLevelIcoe() throws Exception {
0763:
0764: String[] input = new String[] {
0765: "2007BL4631625CS0015500---ACEX07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
0766: "2007BL4631625CS0018000---ACAS07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
0767:
0768: EntryHolder[] output = new EntryHolder[] {
0769: new EntryHolder(
0770: OriginEntrySource.BACKUP,
0771: "2007BL4631625CS0015500---ACEX07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0772: new EntryHolder(
0773: OriginEntrySource.BACKUP,
0774: "2007BL4631625CS0018000---ACAS07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
0775: new EntryHolder(
0776: OriginEntrySource.SCRUBBER_VALID,
0777: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
0778: new EntryHolder(
0779: OriginEntrySource.SCRUBBER_VALID,
0780: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
0781: new EntryHolder(
0782: OriginEntrySource.SCRUBBER_VALID,
0783: "2007BL1031400-----9955---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
0784: new EntryHolder(
0785: OriginEntrySource.SCRUBBER_VALID,
0786: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
0787: new EntryHolder(
0788: OriginEntrySource.SCRUBBER_VALID,
0789: "2007BL4631625CS0015500---ACEX07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0790: new EntryHolder(
0791: OriginEntrySource.SCRUBBER_VALID,
0792: "2007BL4631625CS0018000---ACAS07DI EUCSHRICOE 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
0793:
0794: scrub(input);
0795: assertOriginEntries(4, output);
0796: }
0797:
0798: /**
0799: * Tests that the scrubber generates cost share entries for entries with object code level == "HRCO"
0800: * @throws Exception thrown if any exception is encountered for any reason
0801: */
0802: public void testCostShareForLevelHrco() throws Exception {
0803:
0804: String[] input = new String[] {
0805: "2007BL4631618CS0013000---ACEX07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
0806: "2007BL4631618CS0019041---ACLI07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
0807:
0808: EntryHolder[] output = new EntryHolder[] {
0809: new EntryHolder(
0810: OriginEntrySource.BACKUP,
0811: "2007BL4631618CS0013000---ACEX07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0812: new EntryHolder(
0813: OriginEntrySource.BACKUP,
0814: "2007BL4631618CS0019041---ACLI07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0815: new EntryHolder(
0816: OriginEntrySource.SCRUBBER_VALID,
0817: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
0818: new EntryHolder(
0819: OriginEntrySource.SCRUBBER_VALID,
0820: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
0821: new EntryHolder(
0822: OriginEntrySource.SCRUBBER_VALID,
0823: "2007BL1031400-----9930---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
0824: new EntryHolder(
0825: OriginEntrySource.SCRUBBER_VALID,
0826: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
0827: new EntryHolder(
0828: OriginEntrySource.SCRUBBER_VALID,
0829: "2007BL4631618CS0013000---ACEX07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0830: new EntryHolder(
0831: OriginEntrySource.SCRUBBER_VALID,
0832: "2007BL4631618CS0019041---ACLI07DI 01CSHRHRCO 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "), };
0833:
0834: scrub(input);
0835: assertOriginEntries(4, output);
0836: }
0837:
0838: /**
0839: * Tests that the scrubber generates cost share entries for entries with object code level == "FINA2"
0840: * @throws Exception thrown if any exception is encountered for any reason
0841: */
0842: public void testCostShareForLevelFina2() throws Exception {
0843:
0844: String[] input = new String[] {
0845: "2007BL4631601CS0015800---ACEX07CR 01CSHRFINA2 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
0846: "2007BL4631601CS0018000---ACAS07CR 01CSHRFINA2 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
0847:
0848: EntryHolder[] output = new EntryHolder[] {
0849: new EntryHolder(
0850: OriginEntrySource.BACKUP,
0851: "2007BL4631601CS0015800---ACEX07CR 01CSHRFINA2 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0852: new EntryHolder(
0853: OriginEntrySource.BACKUP,
0854: "2007BL4631601CS0018000---ACAS07CR 01CSHRFINA2 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0855: new EntryHolder(
0856: OriginEntrySource.SCRUBBER_VALID,
0857: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
0858: new EntryHolder(
0859: OriginEntrySource.SCRUBBER_VALID,
0860: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
0861: new EntryHolder(
0862: OriginEntrySource.SCRUBBER_VALID,
0863: "2007BL1031400-----9958---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
0864: new EntryHolder(
0865: OriginEntrySource.SCRUBBER_VALID,
0866: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
0867: new EntryHolder(
0868: OriginEntrySource.SCRUBBER_VALID,
0869: "2007BL4631601CS0015800---ACEX07CR 01CSHRFINA2 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0870: new EntryHolder(
0871: OriginEntrySource.SCRUBBER_VALID,
0872: "2007BL4631601CS0018000---ACAS07CR 01CSHRFINA2 00000TP Generated Offset 20.00D2006-01-05 ---------- ") };
0873:
0874: scrub(input);
0875: assertOriginEntries(4, output);
0876: }
0877:
0878: /**
0879: * Tests that the scrubber generates cost share entries for entries with object code level == "FINA1"
0880: * @throws Exception thrown if any exception is encountered for any reason
0881: */
0882: public void testCostShareForLevelFina1() throws Exception {
0883:
0884: String[] input = new String[] {
0885: "2007BL4631625CS0015400---ACEX07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
0886: "2007BL4631625CS0018000---ACAS07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
0887:
0888: EntryHolder[] output = new EntryHolder[] {
0889: new EntryHolder(
0890: OriginEntrySource.BACKUP,
0891: "2007BL4631625CS0015400---ACEX07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0892: new EntryHolder(
0893: OriginEntrySource.BACKUP,
0894: "2007BL4631625CS0018000---ACAS07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
0895: new EntryHolder(
0896: OriginEntrySource.SCRUBBER_VALID,
0897: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
0898: new EntryHolder(
0899: OriginEntrySource.SCRUBBER_VALID,
0900: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
0901: new EntryHolder(
0902: OriginEntrySource.SCRUBBER_VALID,
0903: "2007BL1031400-----9954---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
0904: new EntryHolder(
0905: OriginEntrySource.SCRUBBER_VALID,
0906: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
0907: new EntryHolder(
0908: OriginEntrySource.SCRUBBER_VALID,
0909: "2007BL4631625CS0015400---ACEX07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
0910: new EntryHolder(
0911: OriginEntrySource.SCRUBBER_VALID,
0912: "2007BL4631625CS0018000---ACAS07DI EUCSHRFINA1 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
0913:
0914: scrub(input);
0915: assertOriginEntries(4, output);
0916: }
0917:
0918: /**
0919: * Tests that the scrubber generates cost share entries for entries with object code level == "CORI"
0920: * @throws Exception thrown if any exception is encountered for any reason
0921: */
0922: public void testCostShareForLevelCori() throws Exception {
0923:
0924: String[] input = new String[] {
0925: "2007BL4631618CS0019912---ACEX07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
0926: "2007BL4631618CS0019041---ACLI07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
0927:
0928: EntryHolder[] output = new EntryHolder[] {
0929: new EntryHolder(
0930: OriginEntrySource.BACKUP,
0931: "2007BL4631618CS0019912---ACEX07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
0932: new EntryHolder(
0933: OriginEntrySource.BACKUP,
0934: "2007BL4631618CS0019041---ACLI07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0935: new EntryHolder(
0936: OriginEntrySource.SCRUBBER_VALID,
0937: "2007BL4631618CS0019041---ACLI07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
0938: new EntryHolder(
0939: OriginEntrySource.SCRUBBER_VALID,
0940: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
0941: new EntryHolder(
0942: OriginEntrySource.SCRUBBER_VALID,
0943: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
0944: new EntryHolder(
0945: OriginEntrySource.SCRUBBER_VALID,
0946: "2007BL1031400-----9912---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
0947: new EntryHolder(
0948: OriginEntrySource.SCRUBBER_VALID,
0949: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
0950: new EntryHolder(
0951: OriginEntrySource.SCRUBBER_VALID,
0952: "2007BL4631618CS0019912---ACEX07DI 01CSHRCORI 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "), };
0953:
0954: scrub(input);
0955: assertOriginEntries(4, output);
0956: }
0957:
0958: /**
0959: * Tests that the scrubber generates cost share entries for entries with object code level == "CORE"
0960: * @throws Exception thrown if any exception is encountered for any reason
0961: */
0962: public void testCostShareForLevelCore() throws Exception {
0963:
0964: String[] input = new String[] {
0965: "2007BL4631601CS0019951---ACEX07CR 01CSHRCORE 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
0966: "2007BL4631601CS0018000---ACAS07CR 01CSHRCORE 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
0967:
0968: EntryHolder[] output = new EntryHolder[] {
0969: new EntryHolder(
0970: OriginEntrySource.BACKUP,
0971: "2007BL4631601CS0019951---ACEX07CR 01CSHRCORE 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
0972: new EntryHolder(
0973: OriginEntrySource.BACKUP,
0974: "2007BL4631601CS0018000---ACAS07CR 01CSHRCORE 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0975: new EntryHolder(
0976: OriginEntrySource.SCRUBBER_VALID,
0977: "2007BL4631601CS0018000---ACAS07CR 01CSHRCORE 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
0978: new EntryHolder(
0979: OriginEntrySource.SCRUBBER_VALID,
0980: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
0981: new EntryHolder(
0982: OriginEntrySource.SCRUBBER_VALID,
0983: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
0984: new EntryHolder(
0985: OriginEntrySource.SCRUBBER_VALID,
0986: "2007BL1031400-----9951---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
0987: new EntryHolder(
0988: OriginEntrySource.SCRUBBER_VALID,
0989: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
0990: new EntryHolder(
0991: OriginEntrySource.SCRUBBER_VALID,
0992: "2007BL4631601CS0019951---ACEX07CR 01CSHRCORE 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "), };
0993:
0994: scrub(input);
0995: assertOriginEntries(4, output);
0996: }
0997:
0998: /**
0999: * Tests that the scrubber generates cost share entries for entries with object code level == "CAP"
1000: * @throws Exception thrown if any exception is encountered for any reason
1001: */
1002: public void testCostShareForLevelCap() throws Exception {
1003:
1004: String[] input = new String[] {
1005: "2007BL4631625CS0017000---ACEX07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
1006: "2007BL4631625CS0018000---ACAS07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
1007:
1008: EntryHolder[] output = new EntryHolder[] {
1009: new EntryHolder(
1010: OriginEntrySource.BACKUP,
1011: "2007BL4631625CS0017000---ACEX07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
1012: new EntryHolder(
1013: OriginEntrySource.BACKUP,
1014: "2007BL4631625CS0018000---ACAS07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
1015: new EntryHolder(
1016: OriginEntrySource.SCRUBBER_VALID,
1017: "2007BL9520004-----8610---ACAS07DI EUCSHRCAP 00000GENERATED CAPITALIZATION 241.75D2005-11-30 ---------- "),
1018: new EntryHolder(
1019: OriginEntrySource.SCRUBBER_VALID,
1020: "2007BL9520004-----9899---ACFB07DI EUCSHRCAP 00000GENERATED CAPITALIZATION 241.75C2005-11-30 ---------- "),
1021: new EntryHolder(
1022: OriginEntrySource.SCRUBBER_VALID,
1023: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
1024: new EntryHolder(
1025: OriginEntrySource.SCRUBBER_VALID,
1026: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
1027: new EntryHolder(
1028: OriginEntrySource.SCRUBBER_VALID,
1029: "2007BL1031400-----9970---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
1030: new EntryHolder(
1031: OriginEntrySource.SCRUBBER_VALID,
1032: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
1033: new EntryHolder(
1034: OriginEntrySource.SCRUBBER_VALID,
1035: "2007BL4631625CS0017000---ACEX07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
1036: new EntryHolder(
1037: OriginEntrySource.SCRUBBER_VALID,
1038: "2007BL4631625CS0018000---ACAS07DI EUCSHRCAP 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
1039:
1040: scrub(input);
1041: assertOriginEntries(4, output);
1042: }
1043:
1044: /**
1045: * Tests that the scrubber generates cost share entries for entries with object code level == "BISA"
1046: * @throws Exception thrown if any exception is encountered for any reason
1047: */
1048: public void testCostShareForLevelBisa() throws Exception {
1049:
1050: String[] input = new String[] {
1051: "2007BL4631618CS0012500---ACEX07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
1052: "2007BL4631618CS0019041---ACLI07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
1053:
1054: EntryHolder[] output = new EntryHolder[] {
1055: new EntryHolder(
1056: OriginEntrySource.BACKUP,
1057: "2007BL4631618CS0012500---ACEX07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1058: new EntryHolder(
1059: OriginEntrySource.BACKUP,
1060: "2007BL4631618CS0019041---ACLI07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
1061: new EntryHolder(
1062: OriginEntrySource.SCRUBBER_VALID,
1063: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
1064: new EntryHolder(
1065: OriginEntrySource.SCRUBBER_VALID,
1066: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
1067: new EntryHolder(
1068: OriginEntrySource.SCRUBBER_VALID,
1069: "2007BL1031400-----9925---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
1070: new EntryHolder(
1071: OriginEntrySource.SCRUBBER_VALID,
1072: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
1073: new EntryHolder(
1074: OriginEntrySource.SCRUBBER_VALID,
1075: "2007BL4631618CS0012500---ACEX07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1076: new EntryHolder(
1077: OriginEntrySource.SCRUBBER_VALID,
1078: "2007BL4631618CS0019041---ACLI07DI 01CSHRBISA 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- ") };
1079:
1080: scrub(input);
1081: assertOriginEntries(4, output);
1082: }
1083:
1084: /**
1085: * Tests that the scrubber generates cost share entries for entries with object code level == "BENF6"
1086: * @throws Exception thrown if any exception is encountered for any reason
1087: */
1088: public void testCostShareForLevelBenf6() throws Exception {
1089: String[] input = new String[] {
1090: "2007BL4631625CS0015625---ACEX07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
1091: "2007BL4631625CS0018000---ACAS07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
1092:
1093: EntryHolder[] output = new EntryHolder[] {
1094: new EntryHolder(
1095: OriginEntrySource.BACKUP,
1096: "2007BL4631625CS0015625---ACEX07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
1097: new EntryHolder(
1098: OriginEntrySource.BACKUP,
1099: "2007BL4631625CS0018000---ACAS07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- "),
1100: new EntryHolder(
1101: OriginEntrySource.SCRUBBER_VALID,
1102: "2007BL4631625CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75C2006-01-01 ---------- "),
1103: new EntryHolder(
1104: OriginEntrySource.SCRUBBER_VALID,
1105: "2007BL4631625CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75D2006-01-01 ---------- "),
1106: new EntryHolder(
1107: OriginEntrySource.SCRUBBER_VALID,
1108: "2007BL1031400-----9956---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631625 241.75D2006-01-01 ---------- "),
1109: new EntryHolder(
1110: OriginEntrySource.SCRUBBER_VALID,
1111: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
1112: new EntryHolder(
1113: OriginEntrySource.SCRUBBER_VALID,
1114: "2007BL4631625CS0015625---ACEX07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- "),
1115: new EntryHolder(
1116: OriginEntrySource.SCRUBBER_VALID,
1117: "2007BL4631625CS0018000---ACAS07DI EUCSHRBENF6 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- ") };
1118:
1119: scrub(input);
1120: assertOriginEntries(4, output);
1121: }
1122:
1123: /**
1124: * Tests that the scrubber generates cost share entries for entries with object code level == "BASE"
1125: * @throws Exception thrown if any exception is encountered for any reason
1126: */
1127: public void testCostShareForLevelBase() throws Exception {
1128:
1129: String[] input = new String[] {
1130: "2007BL4631618CS0015509---ACEX07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
1131: "2007BL4631618CS0019041---ACLI07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
1132:
1133: EntryHolder[] output = new EntryHolder[] {
1134: new EntryHolder(
1135: OriginEntrySource.BACKUP,
1136: "2007BL4631618CS0015509---ACEX07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1137: new EntryHolder(
1138: OriginEntrySource.BACKUP,
1139: "2007BL4631618CS0019041---ACLI07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
1140: new EntryHolder(
1141: OriginEntrySource.SCRUBBER_VALID,
1142: "2007BL4631618CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35C2006-01-01 ---------- "),
1143: new EntryHolder(
1144: OriginEntrySource.SCRUBBER_VALID,
1145: "2007BL4631618CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35D2006-01-01 ---------- "),
1146: new EntryHolder(
1147: OriginEntrySource.SCRUBBER_VALID,
1148: "2007BL1031400-----9959---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631618 94.35D2006-01-01 ---------- "),
1149: new EntryHolder(
1150: OriginEntrySource.SCRUBBER_VALID,
1151: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 94.35C2006-01-01 ---------- "),
1152: new EntryHolder(
1153: OriginEntrySource.SCRUBBER_VALID,
1154: "2007BL4631618CS0015509---ACEX07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1155: new EntryHolder(
1156: OriginEntrySource.SCRUBBER_VALID,
1157: "2007BL4631618CS0019041---ACLI07DI 01CSHRBASE 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- ") };
1158:
1159: scrub(input);
1160: assertOriginEntries(4, output);
1161: }
1162:
1163: /**
1164: * Tests that the scrubber generates cost share entries for entries with object code level == "ACSA"
1165: * @throws Exception thrown if any exception is encountered for any reason
1166: */
1167: public void testCostShareForLevelAcsa() throws Exception {
1168:
1169: String[] input = new String[] {
1170: "2007BL4631601CS0012000---ACEX07CR 01CSHRACSA 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
1171: "2007BL4631601CS0018000---ACAS07CR 01CSHRACSA 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
1172:
1173: EntryHolder[] output = new EntryHolder[] {
1174: new EntryHolder(
1175: OriginEntrySource.BACKUP,
1176: "2007BL4631601CS0012000---ACEX07CR 01CSHRACSA 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1177: new EntryHolder(
1178: OriginEntrySource.BACKUP,
1179: "2007BL4631601CS0018000---ACAS07CR 01CSHRACSA 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
1180: new EntryHolder(
1181: OriginEntrySource.SCRUBBER_VALID,
1182: "2007BL4631601CS0019915---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00D2006-01-01 ---------- "),
1183: new EntryHolder(
1184: OriginEntrySource.SCRUBBER_VALID,
1185: "2007BL4631601CS0018000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00C2006-01-01 ---------- "),
1186: new EntryHolder(
1187: OriginEntrySource.SCRUBBER_VALID,
1188: "2007BL1031400-----9920---ACTE07TF CSCSHR01/01 00000GENERATED COST SHARE FROM 4631601 20.00C2006-01-01 ---------- "),
1189: new EntryHolder(
1190: OriginEntrySource.SCRUBBER_VALID,
1191: "2007BL1031400-----8000---ACAS07TF CSCSHR01/01 00000GENERATED OFFSET 20.00D2006-01-01 ---------- "),
1192: new EntryHolder(
1193: OriginEntrySource.SCRUBBER_VALID,
1194: "2007BL4631601CS0012000---ACEX07CR 01CSHRACSA 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1195: new EntryHolder(
1196: OriginEntrySource.SCRUBBER_VALID,
1197: "2007BL4631601CS0018000---ACAS07CR 01CSHRACSA 00000TP Generated Offset 20.00D2006-01-05 ---------- "), };
1198:
1199: scrub(input);
1200: assertOriginEntries(4, output);
1201: }
1202:
1203: /**
1204: * Tests that the scrubber does not generate cost share entries for entries with certain document types
1205: * @throws Exception thrown if any exception is encountered for any reason
1206: */
1207: public void testNoCostShareTransfersForCertainDocumentTypes()
1208: throws Exception {
1209:
1210: String[] input = new String[] {
1211: "2007BL4631618CS0015000---ACEX07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
1212: "2007BL4631618CS0019041---ACLI07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
1213:
1214: EntryHolder[] output = new EntryHolder[] {
1215: new EntryHolder(
1216: OriginEntrySource.BACKUP,
1217: "2007BL4631618CS0015000---ACEX07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1218: new EntryHolder(
1219: OriginEntrySource.BACKUP,
1220: "2007BL4631618CS0019041---ACLI07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "),
1221: new EntryHolder(
1222: OriginEntrySource.SCRUBBER_VALID,
1223: "2007BL4631618CS0015000---ACEX07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- "),
1224: new EntryHolder(
1225: OriginEntrySource.SCRUBBER_VALID,
1226: "2007BL4631618CS0019041---ACLI07JV 01NOCSHRJV 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- "), };
1227:
1228: scrub(input);
1229: assertOriginEntries(4, output);
1230: }
1231:
1232: /**
1233: * Tests that the scrubber does not generate cost share entries for entries that are beginning balance transactions
1234: * @throws Exception thrown if any exception is encountered for any reason
1235: */
1236: public void testNoCostShareTransfersForBeginningBalanceTransactions()
1237: throws Exception {
1238:
1239: String[] input = new String[] {
1240: "2007BL4631601CS0015000---ACEXCBCR 01NOCSHRCB 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
1241: "2007BL4631601CS0018000---ACASCBCR 01NOCSHRCB 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
1242:
1243: EntryHolder[] output = new EntryHolder[] {
1244: new EntryHolder(
1245: OriginEntrySource.BACKUP,
1246: "2007BL4631601CS0015000---ACEXCBCR 01NOCSHRCB 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1247: new EntryHolder(
1248: OriginEntrySource.BACKUP,
1249: "2007BL4631601CS0018000---ACASCBCR 01NOCSHRCB 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
1250: new EntryHolder(
1251: OriginEntrySource.SCRUBBER_VALID,
1252: "2007BL4631601CS0015000---ACEXCBCR 01NOCSHRCB 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1253: new EntryHolder(
1254: OriginEntrySource.SCRUBBER_VALID,
1255: "2007BL4631601CS0018000---ACASCBCR 01NOCSHRCB 00000TP Generated Offset 20.00D2006-01-05 ---------- "), };
1256:
1257: scrub(input);
1258: assertOriginEntries(4, output);
1259: }
1260:
1261: /**
1262: * Tests that the scrubber does not generate cost share entries for encumbrance entries
1263: * @throws Exception thrown if any exception is encountered for any reason
1264: */
1265: public void testNoCostShareTransfersForEncumbranceTransactions()
1266: throws Exception {
1267:
1268: String[] input = new String[] {
1269: "2007BL4631625CS0014110---EXEX07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- D ",
1270: "2007BL4631625CS0018000---EXAS07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- D " };
1271:
1272: EntryHolder[] output = new EntryHolder[] {
1273: new EntryHolder(
1274: OriginEntrySource.BACKUP,
1275: "2007BL4631625CS0014110---EXEX07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- D "),
1276: new EntryHolder(
1277: OriginEntrySource.BACKUP,
1278: "2007BL4631625CS0018000---EXAS07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- D "),
1279: new EntryHolder(
1280: OriginEntrySource.SCRUBBER_VALID,
1281: "2007BL1031400-----9940---CEEX07EXENEUNOCSHREX 00000NOV-05 IMU Business Office FR-BL4631625 241.75D2006-01-01 ---------- D "),
1282: new EntryHolder(
1283: OriginEntrySource.SCRUBBER_VALID,
1284: "2007BL1031400-----9893---CEFB07EXENEUNOCSHREX 00000GENERATED OFFSET 241.75C2006-01-01 ---------- "),
1285: new EntryHolder(
1286: OriginEntrySource.SCRUBBER_VALID,
1287: "2007BL4631625CS0014110---EXEX07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- D "),
1288: new EntryHolder(
1289: OriginEntrySource.SCRUBBER_VALID,
1290: "2007BL4631625CS0018000---EXAS07EXENEUNOCSHREX 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- D ") };
1291:
1292: scrub(input);
1293: assertOriginEntries(4, output);
1294: }
1295:
1296: /**
1297: * Tests that the scrubber does not generate cost share entries for entries with budget balance types
1298: * @throws Exception thrown if any exception is encountered for any reason
1299: */
1300: public void testNoCostShareTransfersForBudgetTransactions()
1301: throws Exception {
1302:
1303: String[] input = new String[] {
1304: "2007BL4631618CS0015000---BBEX07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- ",
1305: "2007BL4631618CS0019041---BBLI07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- " };
1306:
1307: EntryHolder[] output = new EntryHolder[] {
1308: new EntryHolder(
1309: OriginEntrySource.BACKUP,
1310: "2007BL4631618CS0015000---BBEX07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- "),
1311: new EntryHolder(
1312: OriginEntrySource.BACKUP,
1313: "2007BL4631618CS0019041---BBLI07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- "),
1314: new EntryHolder(
1315: OriginEntrySource.SCRUBBER_VALID,
1316: "2007BL4631618CS0015000---BBEX07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- "),
1317: new EntryHolder(
1318: OriginEntrySource.SCRUBBER_VALID,
1319: "2007BL4631618CS0019041---BBLI07DI 01NOCSHRBB 00000Rite Quality Office Supplies Inc. 94.35 2006-01-05 ---------- ") };
1320:
1321: scrub(input);
1322: assertOriginEntries(4, output);
1323: }
1324:
1325: /**
1326: * Tests that the scrubber does not generate cost share entries for entries that are non-expense
1327: * @throws Exception thrown if any exception is encountered for any reason
1328: */
1329: public void testNoCostShareTransfersForNonExpense()
1330: throws Exception {
1331:
1332: String[] input = new String[] {
1333: "2007BL4631601CS0011800---ACIN07CR 01NOCSHRIN 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
1334: "2007BL4631601CS0018000---ACAS07CR 01NOCSHRIN 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
1335:
1336: EntryHolder[] output = new EntryHolder[] {
1337: new EntryHolder(
1338: OriginEntrySource.BACKUP,
1339: "2007BL4631601CS0011800---ACIN07CR 01NOCSHRIN 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1340: new EntryHolder(
1341: OriginEntrySource.BACKUP,
1342: "2007BL4631601CS0018000---ACAS07CR 01NOCSHRIN 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
1343: new EntryHolder(
1344: OriginEntrySource.SCRUBBER_VALID,
1345: "2007BL4631601CS0011800---ACIN07CR 01NOCSHRIN 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
1346: new EntryHolder(
1347: OriginEntrySource.SCRUBBER_VALID,
1348: "2007BL4631601CS0018000---ACAS07CR 01NOCSHRIN 00000TP Generated Offset 20.00D2006-01-05 ---------- ") };
1349:
1350: scrub(input);
1351: assertOriginEntries(4, output);
1352: }
1353:
1354: /**
1355: * Tests that the scrubber generates a plant endebtedness entries
1356: * @throws Exception thrown if any exception is encountered for any reason
1357: */
1358: public void testPlantIndebtedness() throws Exception {
1359:
1360: String[] input = new String[] {
1361: "2007BA9020204-----9100---ACLI07SB 01DEBTEDNES 00000Biology Stockroom 13.77D2006-01-05 ---------- ",
1362: "2007BA9020204-----8000---ACAS07SB 01DEBTEDNES 00000TP Generated Offset 13.77C2006-01-05 ---------- ",
1363: "2007BA9120657-----9120---ACLI07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- ",
1364: "2007BA9120657-----8000---ACAS07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- " };
1365:
1366: EntryHolder[] output = new EntryHolder[] {
1367: new EntryHolder(
1368: OriginEntrySource.BACKUP,
1369: "2007BA9020204-----9100---ACLI07SB 01DEBTEDNES 00000Biology Stockroom 13.77D2006-01-05 ---------- "),
1370: new EntryHolder(
1371: OriginEntrySource.BACKUP,
1372: "2007BA9020204-----8000---ACAS07SB 01DEBTEDNES 00000TP Generated Offset 13.77C2006-01-05 ---------- "),
1373: new EntryHolder(
1374: OriginEntrySource.BACKUP,
1375: "2007BA9120657-----9120---ACLI07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- "),
1376: new EntryHolder(
1377: OriginEntrySource.BACKUP,
1378: "2007BA9120657-----8000---ACAS07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- "),
1379: new EntryHolder(
1380: OriginEntrySource.SCRUBBER_VALID,
1381: "2007BA9020204-----8000---ACAS07SB 01DEBTEDNES 00000TP Generated Offset 13.77C2006-01-05 ---------- "),
1382: new EntryHolder(
1383: OriginEntrySource.SCRUBBER_VALID,
1384: "2007BA9020204-----9100---ACLI07SB 01DEBTEDNES 00000GENERATED TRANSFER TO NET PLANT 13.77C2006-01-05 ---------- "),
1385: new EntryHolder(
1386: OriginEntrySource.SCRUBBER_VALID,
1387: "2007BA9020204-----9899---ACFB07SB 01DEBTEDNES 00000GENERATED TRANSFER TO NET PLANT 13.77D2006-01-05 ---------- "),
1388: new EntryHolder(
1389: OriginEntrySource.SCRUBBER_VALID,
1390: "2007BA9544900-----9100---ACLI07SB 01DEBTEDNES 00000GENERATED TRANSFER FROM BA 9020204 13.77D2006-01-05 ---------- "),
1391: new EntryHolder(
1392: OriginEntrySource.SCRUBBER_VALID,
1393: "2007BA9544900-----9899---ACFB07SB 01DEBTEDNES 00000GENERATED TRANSFER FROM BA 9020204 13.77C2006-01-05 ---------- "),
1394: new EntryHolder(
1395: OriginEntrySource.SCRUBBER_VALID,
1396: "2007BA9020204-----9100---ACLI07SB 01DEBTEDNES 00000Biology Stockroom 13.77D2006-01-05 ---------- "),
1397: new EntryHolder(
1398: OriginEntrySource.SCRUBBER_VALID,
1399: "2007BA9120657-----8000---ACAS07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- "),
1400: new EntryHolder(
1401: OriginEntrySource.SCRUBBER_VALID,
1402: "2007BA9120657-----9120---ACLI07ST EUDEBTEDNES 00000GENERATED TRANSFER TO NET PLANT 620.00D2006-01-05 ---------- "),
1403: new EntryHolder(
1404: OriginEntrySource.SCRUBBER_VALID,
1405: "2007BA9120657-----9899---ACFB07ST EUDEBTEDNES 00000GENERATED TRANSFER TO NET PLANT 620.00C2006-01-05 ---------- "),
1406: new EntryHolder(
1407: OriginEntrySource.SCRUBBER_VALID,
1408: "2007BA9544900-----9120---ACLI07ST EUDEBTEDNES 00000GENERATED TRANSFER FROM BA 9120657 620.00C2006-01-05 ---------- "),
1409: new EntryHolder(
1410: OriginEntrySource.SCRUBBER_VALID,
1411: "2007BA9544900-----9899---ACFB07ST EUDEBTEDNES 00000GENERATED TRANSFER FROM BA 9120657 620.00D2006-01-05 ---------- "),
1412: new EntryHolder(
1413: OriginEntrySource.SCRUBBER_VALID,
1414: "2007BA9120657-----9120---ACLI07ST EUDEBTEDNES 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- "), };
1415:
1416: scrub(input);
1417: assertOriginEntries(4, output);
1418: }
1419:
1420: /**
1421: * Tests that the scrubber does not generate a plant endebtedness entry for entries with financial sub object == "P2"
1422: * @throws Exception thrown if any exception is encountered for any reason
1423: */
1424: public void testNoIndebtednessForObjectSubTypeP2() throws Exception {
1425:
1426: String[] input = new String[] {
1427: "2007BA9120657-----9100---ACLI07DI EUNODEBTP2 00000BALDWIN WALLACE COLLEGE 3375.00C2006-01-05 ---------- ",
1428: "2007BA9120657-----8000---ACAS07DI EUNODEBTP2 00000TP Generated Offset 3375.00D2006-01-05 ---------- " };
1429:
1430: EntryHolder[] output = new EntryHolder[] {
1431: new EntryHolder(
1432: OriginEntrySource.BACKUP,
1433: "2007BA9120657-----9100---ACLI07DI EUNODEBTP2 00000BALDWIN WALLACE COLLEGE 3375.00C2006-01-05 ---------- "),
1434: new EntryHolder(
1435: OriginEntrySource.BACKUP,
1436: "2007BA9120657-----8000---ACAS07DI EUNODEBTP2 00000TP Generated Offset 3375.00D2006-01-05 ---------- "),
1437: new EntryHolder(
1438: OriginEntrySource.SCRUBBER_VALID,
1439: "2007BA9120657-----8000---ACAS07DI EUNODEBTP2 00000TP Generated Offset 3375.00D2006-01-05 ---------- "),
1440: new EntryHolder(
1441: OriginEntrySource.SCRUBBER_VALID,
1442: "2007BA9120657-----9100---ACLI07DI EUNODEBTP2 00000GENERATED TRANSFER TO NET PLANT 3375.00D2006-01-05 ---------- "),
1443: new EntryHolder(
1444: OriginEntrySource.SCRUBBER_VALID,
1445: "2007BA9120657-----9899---ACFB07DI EUNODEBTP2 00000GENERATED TRANSFER TO NET PLANT 3375.00C2006-01-05 ---------- "),
1446: new EntryHolder(
1447: OriginEntrySource.SCRUBBER_VALID,
1448: "2007BA9544900-----9100---ACLI07DI EUNODEBTP2 00000GENERATED TRANSFER FROM BA 9120657 3375.00C2006-01-05 ---------- "),
1449: new EntryHolder(
1450: OriginEntrySource.SCRUBBER_VALID,
1451: "2007BA9544900-----9899---ACFB07DI EUNODEBTP2 00000GENERATED TRANSFER FROM BA 9120657 3375.00D2006-01-05 ---------- "),
1452: new EntryHolder(
1453: OriginEntrySource.SCRUBBER_VALID,
1454: "2007BA9120657-----9100---ACLI07DI EUNODEBTP2 00000BALDWIN WALLACE COLLEGE 3375.00C2006-01-05 ---------- "), };
1455:
1456: scrub(input);
1457: assertOriginEntries(4, output);
1458: }
1459:
1460: /**
1461: * Tests that the scrubber does not generate a plant endebtedness entry for entries with financial sub object == "P1"
1462: * @throws Exception thrown if any exception is encountered for any reason
1463: */
1464: public void testNoIndebtednessForObjectSubTypeP1() throws Exception {
1465:
1466: String[] input = new String[] {
1467: "2007BL2231423-----9100---ACIN CR PLNODEBTP1 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- ",
1468: "2007BL2231423-----8000---ACAS CR PLNODEBTP1 00000TP Generated Offset 45995.84D2006-01-05 ---------- " };
1469:
1470: EntryHolder[] output = new EntryHolder[] {
1471: new EntryHolder(
1472: OriginEntrySource.BACKUP,
1473: "2007BL2231423-----9100---ACIN CR PLNODEBTP1 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- "),
1474: new EntryHolder(
1475: OriginEntrySource.BACKUP,
1476: "2007BL2231423-----8000---ACAS CR PLNODEBTP1 00000TP Generated Offset 45995.84D2006-01-05 ---------- "),
1477: new EntryHolder(
1478: OriginEntrySource.SCRUBBER_VALID,
1479: "2006BL2231423-----8000---ACAS07CR PLNODEBTP1 00000TP Generated Offset 45995.84D2006-01-05 ---------- "),
1480: new EntryHolder(
1481: OriginEntrySource.SCRUBBER_VALID,
1482: "2006BL2231423-----9100---ACIN07CR PLNODEBTP1 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- "), };
1483:
1484: scrub(input);
1485: assertOriginEntries(4, output);
1486: }
1487:
1488: /**
1489: * Tests that the scrubber does not generate a plant endebtedness entry for encumbrance entries
1490: * @throws Exception thrown if any exception is encountered for any reason
1491: */
1492: public void testNoIndebtednessForEncumbranceEntries()
1493: throws Exception {
1494:
1495: String[] input = new String[] {
1496: "2007BA9021004-----9120---EXLI07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- D ",
1497: "2007BA9021004-----8000---EXAS07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- D " };
1498:
1499: EntryHolder[] output = new EntryHolder[] {
1500: new EntryHolder(
1501: OriginEntrySource.BACKUP,
1502: "2007BA9021004-----9120---EXLI07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- D "),
1503: new EntryHolder(
1504: OriginEntrySource.BACKUP,
1505: "2007BA9021004-----8000---EXAS07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- D "),
1506: new EntryHolder(
1507: OriginEntrySource.SCRUBBER_VALID,
1508: "2007BA9021004-----8000---EXAS07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- D "),
1509: new EntryHolder(
1510: OriginEntrySource.SCRUBBER_VALID,
1511: "2007BA9021004-----9120---EXLI07TOPSEUNODEBTEX 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- D "), };
1512:
1513: scrub(input);
1514: assertOriginEntries(4, output);
1515: }
1516:
1517: /**
1518: * Tests that the scrubber does not generate a plant endebtedness entry for entries with budget balance types
1519: * @throws Exception thrown if any exception is encountered for any reason
1520: */
1521: public void testNoIndebtednessForBudgetTransactions()
1522: throws Exception {
1523:
1524: String[] input = new String[] {
1525: "2007BA9020204-----9100---BBLI07SB 01NODEBTBB 00000Biology Stockroom 13.77 2006-01-05 ---------- ",
1526: "2007BA9020204-----8000---BBAS07SB 01NODEBTBB 00000TP Generated Offset 13.77 2006-01-05 ---------- " };
1527:
1528: EntryHolder[] output = new EntryHolder[] {
1529: new EntryHolder(
1530: OriginEntrySource.BACKUP,
1531: "2007BA9020204-----9100---BBLI07SB 01NODEBTBB 00000Biology Stockroom 13.77 2006-01-05 ---------- "),
1532: new EntryHolder(
1533: OriginEntrySource.BACKUP,
1534: "2007BA9020204-----8000---BBAS07SB 01NODEBTBB 00000TP Generated Offset 13.77 2006-01-05 ---------- "),
1535: new EntryHolder(
1536: OriginEntrySource.SCRUBBER_VALID,
1537: "2007BA9020204-----8000---BBAS07SB 01NODEBTBB 00000TP Generated Offset 13.77 2006-01-05 ---------- "),
1538: new EntryHolder(
1539: OriginEntrySource.SCRUBBER_VALID,
1540: "2007BA9020204-----9100---BBLI07SB 01NODEBTBB 00000Biology Stockroom 13.77 2006-01-05 ---------- "), };
1541:
1542: scrub(input);
1543: assertOriginEntries(4, output);
1544: }
1545:
1546: /**
1547: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "CL"
1548: * @throws Exception thrown if any exception is encountered for any reason
1549: */
1550: public void testCapitalizationForObjectSubTypeCL() throws Exception {
1551:
1552: String[] input = new String[] {
1553: "2007BA6044900-----7099---ACEE07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- ",
1554: "2007BA6044900-----8000---ACAS07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- " };
1555:
1556: EntryHolder[] output = new EntryHolder[] {
1557: new EntryHolder(
1558: OriginEntrySource.BACKUP,
1559: "2007BA6044900-----7099---ACEE07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1560: new EntryHolder(
1561: OriginEntrySource.BACKUP,
1562: "2007BA6044900-----8000---ACAS07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "),
1563: new EntryHolder(
1564: OriginEntrySource.SCRUBBER_VALID,
1565: "2007BA9544900-----9603---ACLI07CD PDCAPITALCL 00000GENERATED LIABILITY 1445.00D2006-01-05 ---------- "),
1566: new EntryHolder(
1567: OriginEntrySource.SCRUBBER_VALID,
1568: "2007BA9544900-----9899---ACFB07CD PDCAPITALCL 00000GENERATED LIABILITY 1445.00C2006-01-05 ---------- "),
1569: new EntryHolder(
1570: OriginEntrySource.SCRUBBER_VALID,
1571: "2007BA6044900-----7099---ACEE07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1572: new EntryHolder(
1573: OriginEntrySource.SCRUBBER_VALID,
1574: "2007BA6044900-----8000---ACAS07CD PDCAPITALCL 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- ") };
1575:
1576: scrub(input);
1577: assertOriginEntries(4, output);
1578: }
1579:
1580: /**
1581: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "LR"
1582: * @throws Exception thrown if any exception is encountered for any reason
1583: */
1584: public void testCapitalizationForObjectSubTypeLR() throws Exception {
1585:
1586: String[] input = new String[] {
1587: "2007BA6044913-----7465---ACEE07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1588: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1589:
1590: EntryHolder[] output = new EntryHolder[] {
1591: new EntryHolder(
1592: OriginEntrySource.BACKUP,
1593: "2007BA6044913-----7465---ACEE07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1594: new EntryHolder(
1595: OriginEntrySource.BACKUP,
1596: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1597: new EntryHolder(
1598: OriginEntrySource.SCRUBBER_VALID,
1599: "2007BA9544900-----8665---ACAS07GEC 01CAPITALLR 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1600: new EntryHolder(
1601: OriginEntrySource.SCRUBBER_VALID,
1602: "2007BA9544900-----9899---ACFB07GEC 01CAPITALLR 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1603: new EntryHolder(
1604: OriginEntrySource.SCRUBBER_VALID,
1605: "2007BA6044913-----7465---ACEE07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1606: new EntryHolder(
1607: OriginEntrySource.SCRUBBER_VALID,
1608: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLR 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1609:
1610: scrub(input);
1611: assertOriginEntries(4, output);
1612: }
1613:
1614: /**
1615: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "LI"
1616: * @throws Exception thrown if any exception is encountered for any reason
1617: */
1618: public void testCapitalizationForObjectSubTypeLI() throws Exception {
1619:
1620: String[] input = new String[] {
1621: "2007BA6044906-----7100---ACEE07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1622: "2007BA6044906-----9041---ACLI07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1623:
1624: EntryHolder[] output = new EntryHolder[] {
1625: new EntryHolder(
1626: OriginEntrySource.BACKUP,
1627: "2007BA6044906-----7100---ACEE07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1628: new EntryHolder(
1629: OriginEntrySource.BACKUP,
1630: "2007BA6044906-----9041---ACLI07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1631: new EntryHolder(
1632: OriginEntrySource.SCRUBBER_VALID,
1633: "2007BA9544900-----8613---ACAS07TOPS01CAPITALLI 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1634: new EntryHolder(
1635: OriginEntrySource.SCRUBBER_VALID,
1636: "2007BA9544900-----9899---ACFB07TOPS01CAPITALLI 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1637: new EntryHolder(
1638: OriginEntrySource.SCRUBBER_VALID,
1639: "2007BA6044906-----7100---ACEE07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1640: new EntryHolder(
1641: OriginEntrySource.SCRUBBER_VALID,
1642: "2007BA6044906-----9041---ACLI07TOPS01CAPITALLI 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1643:
1644: scrub(input);
1645: assertOriginEntries(4, output);
1646: }
1647:
1648: /**
1649: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "LE"
1650: * @throws Exception thrown if any exception is encountered for any reason
1651: */
1652: public void testCapitalizationForObjectSubTypeLE() throws Exception {
1653:
1654: String[] input = new String[] {
1655: "2007BA6044900-----7800---ACEE07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- ",
1656: "2007BA6044900-----8000---ACAS07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- " };
1657:
1658: EntryHolder[] output = new EntryHolder[] {
1659: new EntryHolder(
1660: OriginEntrySource.BACKUP,
1661: "2007BA6044900-----7800---ACEE07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1662: new EntryHolder(
1663: OriginEntrySource.BACKUP,
1664: "2007BA6044900-----8000---ACAS07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "),
1665: new EntryHolder(
1666: OriginEntrySource.SCRUBBER_VALID,
1667: "2007BA9544900-----8608---ACAS07CD PDCAPITALLE 00000GENERATED CAPITALIZATION 1445.00D2006-01-05 ---------- "),
1668: new EntryHolder(
1669: OriginEntrySource.SCRUBBER_VALID,
1670: "2007BA9544900-----9899---ACFB07CD PDCAPITALLE 00000GENERATED CAPITALIZATION 1445.00C2006-01-05 ---------- "),
1671: new EntryHolder(
1672: OriginEntrySource.SCRUBBER_VALID,
1673: "2007BA6044900-----7800---ACEE07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1674: new EntryHolder(
1675: OriginEntrySource.SCRUBBER_VALID,
1676: "2007BA6044900-----8000---ACAS07CD PDCAPITALLE 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- ") };
1677:
1678: scrub(input);
1679: assertOriginEntries(4, output);
1680: }
1681:
1682: /**
1683: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "LA"
1684: * @throws Exception thrown if any exception is encountered for any reason
1685: */
1686: public void testCapitalizationForObjectSubTypeLA() throws Exception {
1687:
1688: String[] input = new String[] {
1689: "2007BA6044913-----7200---ACEE07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1690: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- ", };
1691:
1692: EntryHolder[] output = new EntryHolder[] {
1693: new EntryHolder(
1694: OriginEntrySource.BACKUP,
1695: "2007BA6044913-----7200---ACEE07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1696: new EntryHolder(
1697: OriginEntrySource.BACKUP,
1698: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1699: new EntryHolder(
1700: OriginEntrySource.SCRUBBER_VALID,
1701: "2007BA9544900-----8603---ACAS07GEC 01CAPITALLA 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1702: new EntryHolder(
1703: OriginEntrySource.SCRUBBER_VALID,
1704: "2007BA9544900-----9899---ACFB07GEC 01CAPITALLA 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1705: new EntryHolder(
1706: OriginEntrySource.SCRUBBER_VALID,
1707: "2007BA6044913-----7200---ACEE07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1708: new EntryHolder(
1709: OriginEntrySource.SCRUBBER_VALID,
1710: "2007BA6044913-----9041---ACLI07GEC 01CAPITALLA 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1711:
1712: scrub(input);
1713: assertOriginEntries(4, output);
1714: }
1715:
1716: /**
1717: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "EF"
1718: * @throws Exception thrown if any exception is encountered for any reason
1719: */
1720: public void testCapitalizationForObjectSubTypeEF() throws Exception {
1721:
1722: String[] input = new String[] {
1723: "2007BA6044906-----7400---ACEE07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1724: "2007BA6044906-----9041---ACLI07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1725:
1726: EntryHolder[] output = new EntryHolder[] {
1727: new EntryHolder(
1728: OriginEntrySource.BACKUP,
1729: "2007BA6044906-----7400---ACEE07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1730: new EntryHolder(
1731: OriginEntrySource.BACKUP,
1732: "2007BA6044906-----9041---ACLI07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1733: new EntryHolder(
1734: OriginEntrySource.SCRUBBER_VALID,
1735: "2007BA9544900-----8604---ACAS07TOPS01CAPITALIF 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1736: new EntryHolder(
1737: OriginEntrySource.SCRUBBER_VALID,
1738: "2007BA9544900-----9899---ACFB07TOPS01CAPITALIF 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1739: new EntryHolder(
1740: OriginEntrySource.SCRUBBER_VALID,
1741: "2007BA6044906-----7400---ACEE07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1742: new EntryHolder(
1743: OriginEntrySource.SCRUBBER_VALID,
1744: "2007BA6044906-----9041---ACLI07TOPS01CAPITALIF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- ") };
1745:
1746: scrub(input);
1747: assertOriginEntries(4, output);
1748: }
1749:
1750: /**
1751: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "ES"
1752: * @throws Exception thrown if any exception is encountered for any reason
1753: */
1754: public void testCapitalizationForObjectSubTypeES() throws Exception {
1755:
1756: String[] input = new String[] {
1757: "2007BA6044900-----7098---ACEE07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- ",
1758: "2007BA6044900-----8000---ACAS07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- " };
1759:
1760: EntryHolder[] output = new EntryHolder[] {
1761: new EntryHolder(
1762: OriginEntrySource.BACKUP,
1763: "2007BA6044900-----7098---ACEE07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1764: new EntryHolder(
1765: OriginEntrySource.BACKUP,
1766: "2007BA6044900-----8000---ACAS07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "),
1767: new EntryHolder(
1768: OriginEntrySource.SCRUBBER_VALID,
1769: "2007BA9544900-----8630---ACAS07CD PDCAPITALES 00000GENERATED CAPITALIZATION 1445.00D2006-01-05 ---------- "),
1770: new EntryHolder(
1771: OriginEntrySource.SCRUBBER_VALID,
1772: "2007BA9544900-----9899---ACFB07CD PDCAPITALES 00000GENERATED CAPITALIZATION 1445.00C2006-01-05 ---------- "),
1773: new EntryHolder(
1774: OriginEntrySource.SCRUBBER_VALID,
1775: "2007BA6044900-----7098---ACEE07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1776: new EntryHolder(
1777: OriginEntrySource.SCRUBBER_VALID,
1778: "2007BA6044900-----8000---ACAS07CD PDCAPITALES 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "), };
1779:
1780: scrub(input);
1781: assertOriginEntries(4, output);
1782: }
1783:
1784: /**
1785: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "CF"
1786: * @throws Exception thrown if any exception is encountered for any reason
1787: */
1788: public void testCapitalizationForObjectSubTypeCF() throws Exception {
1789:
1790: String[] input = new String[] {
1791: "2007BA6044913-----7030---ACEE07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1792: "2007BA6044913-----9041---ACLI07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1793:
1794: EntryHolder[] output = new EntryHolder[] {
1795: new EntryHolder(
1796: OriginEntrySource.BACKUP,
1797: "2007BA6044913-----7030---ACEE07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1798: new EntryHolder(
1799: OriginEntrySource.BACKUP,
1800: "2007BA6044913-----9041---ACLI07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1801: new EntryHolder(
1802: OriginEntrySource.SCRUBBER_VALID,
1803: "2007BA9544900-----8611---ACAS07GEC 01CAPITALCF 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1804: new EntryHolder(
1805: OriginEntrySource.SCRUBBER_VALID,
1806: "2007BA9544900-----9899---ACFB07GEC 01CAPITALCF 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1807: new EntryHolder(
1808: OriginEntrySource.SCRUBBER_VALID,
1809: "2007BA6044913-----7030---ACEE07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1810: new EntryHolder(
1811: OriginEntrySource.SCRUBBER_VALID,
1812: "2007BA6044913-----9041---ACLI07GEC 01CAPITALCF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1813:
1814: scrub(input);
1815: assertOriginEntries(4, output);
1816: }
1817:
1818: /**
1819: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "CM"
1820: * @throws Exception thrown if any exception is encountered for any reason
1821: */
1822: public void testCapitalizationForObjectSubTypeCM() throws Exception {
1823:
1824: String[] input = new String[] {
1825: "2007BA6044906-----7000---ACEE07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1826: "2007BA6044906-----9041---ACLI07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1827:
1828: EntryHolder[] output = new EntryHolder[] {
1829: new EntryHolder(
1830: OriginEntrySource.BACKUP,
1831: "2007BA6044906-----7000---ACEE07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1832: new EntryHolder(
1833: OriginEntrySource.BACKUP,
1834: "2007BA6044906-----9041---ACLI07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1835: new EntryHolder(
1836: OriginEntrySource.SCRUBBER_VALID,
1837: "2007BA9544900-----8610---ACAS07TOPS01CAPITALCM 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1838: new EntryHolder(
1839: OriginEntrySource.SCRUBBER_VALID,
1840: "2007BA9544900-----9899---ACFB07TOPS01CAPITALCM 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1841: new EntryHolder(
1842: OriginEntrySource.SCRUBBER_VALID,
1843: "2007BA6044906-----7000---ACEE07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1844: new EntryHolder(
1845: OriginEntrySource.SCRUBBER_VALID,
1846: "2007BA6044906-----9041---ACLI07TOPS01CAPITALCM 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1847:
1848: scrub(input);
1849: assertOriginEntries(4, output);
1850: }
1851:
1852: /**
1853: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "BF"
1854: * @throws Exception thrown if any exception is encountered for any reason
1855: */
1856: public void testCapitalizationForObjectSubTypeBF() throws Exception {
1857:
1858: String[] input = new String[] {
1859: "2007BA6044913-----7305---ACEE07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1860: "2007BA6044913-----9041---ACLI07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1861:
1862: EntryHolder[] output = new EntryHolder[] {
1863: new EntryHolder(
1864: OriginEntrySource.BACKUP,
1865: "2007BA6044913-----7305---ACEE07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1866: new EntryHolder(
1867: OriginEntrySource.BACKUP,
1868: "2007BA6044913-----9041---ACLI07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1869: new EntryHolder(
1870: OriginEntrySource.SCRUBBER_VALID,
1871: "2007BA9544900-----8605---ACAS07GEC 01CAPITALBF 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1872: new EntryHolder(
1873: OriginEntrySource.SCRUBBER_VALID,
1874: "2007BA9544900-----9899---ACFB07GEC 01CAPITALBF 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1875: new EntryHolder(
1876: OriginEntrySource.SCRUBBER_VALID,
1877: "2007BA6044913-----7305---ACEE07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1878: new EntryHolder(
1879: OriginEntrySource.SCRUBBER_VALID,
1880: "2007BA6044913-----9041---ACLI07GEC 01CAPITALBF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1881:
1882: scrub(input);
1883: assertOriginEntries(4, output);
1884: }
1885:
1886: /**
1887: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "BD"
1888: * @throws Exception thrown if any exception is encountered for any reason
1889: */
1890: public void testCapitalizationForObjectSubTypeBD() throws Exception {
1891:
1892: String[] input = new String[] {
1893: "2007BA6044906-----7300---ACEE07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1894: "2007BA6044906-----9041---ACLI07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1895:
1896: EntryHolder[] output = new EntryHolder[] {
1897: new EntryHolder(
1898: OriginEntrySource.BACKUP,
1899: "2007BA6044906-----7300---ACEE07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1900: new EntryHolder(
1901: OriginEntrySource.BACKUP,
1902: "2007BA6044906-----9041---ACLI07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
1903: new EntryHolder(
1904: OriginEntrySource.SCRUBBER_VALID,
1905: "2007BA9544900-----8601---ACAS07TOPS01CAPITALBD 00000GENERATED CAPITALIZATION 48.53C2006-01-05 ---------- "),
1906: new EntryHolder(
1907: OriginEntrySource.SCRUBBER_VALID,
1908: "2007BA9544900-----9899---ACFB07TOPS01CAPITALBD 00000GENERATED CAPITALIZATION 48.53D2006-01-05 ---------- "),
1909: new EntryHolder(
1910: OriginEntrySource.SCRUBBER_VALID,
1911: "2007BA6044906-----7300---ACEE07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1912: new EntryHolder(
1913: OriginEntrySource.SCRUBBER_VALID,
1914: "2007BA6044906-----9041---ACLI07TOPS01CAPITALBD 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
1915:
1916: scrub(input);
1917: assertOriginEntries(4, output);
1918: }
1919:
1920: /**
1921: * Tests that the scrubber generates a capitalization entry for entries with object sub type == "AM"
1922: * @throws Exception thrown if any exception is encountered for any reason
1923: */
1924: public void testCapitalizationForObjectSubTypeAM() throws Exception {
1925:
1926: String[] input = new String[] {
1927: "2007BA6044900-----7677---ACEE07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- ",
1928: "2007BA6044900-----8000---ACAS07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- " };
1929:
1930: EntryHolder[] output = new EntryHolder[] {
1931: new EntryHolder(
1932: OriginEntrySource.BACKUP,
1933: "2007BA6044900-----7677---ACEE07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1934: new EntryHolder(
1935: OriginEntrySource.BACKUP,
1936: "2007BA6044900-----8000---ACAS07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "),
1937: new EntryHolder(
1938: OriginEntrySource.SCRUBBER_VALID,
1939: "2007BA9544900-----8615---ACAS07CD PDCAPITALAM 00000GENERATED CAPITALIZATION 1445.00D2006-01-05 ---------- "),
1940: new EntryHolder(
1941: OriginEntrySource.SCRUBBER_VALID,
1942: "2007BA9544900-----9899---ACFB07CD PDCAPITALAM 00000GENERATED CAPITALIZATION 1445.00C2006-01-05 ---------- "),
1943: new EntryHolder(
1944: OriginEntrySource.SCRUBBER_VALID,
1945: "2007BA6044900-----7677---ACEE07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05 ---------- "),
1946: new EntryHolder(
1947: OriginEntrySource.SCRUBBER_VALID,
1948: "2007BA6044900-----8000---ACAS07CD PDCAPITALAM 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05 ---------- "), };
1949:
1950: scrub(input);
1951: assertOriginEntries(4, output);
1952: }
1953:
1954: /**
1955: * Tests that the scrubber does not generate a capitalization entry for entries that occurred in certain periods
1956: * @throws Exception thrown if any exception is encountered for any reason
1957: */
1958: public void testNoCapitalizationForCertainFiscalPeriods()
1959: throws Exception {
1960:
1961: String[] input = new String[] {
1962: "2007BA6044900-----7000---ACEECBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ACCDEFGHIJ----------12345678 ",
1963: "2007BA6044900-----8000---ACASCBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 " };
1964:
1965: EntryHolder[] output = new EntryHolder[] {
1966: new EntryHolder(
1967: OriginEntrySource.BACKUP,
1968: "2007BA6044900-----7000---ACEECBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ACCDEFGHIJ----------12345678 "),
1969: new EntryHolder(
1970: OriginEntrySource.BACKUP,
1971: "2007BA6044900-----8000---ACASCBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "),
1972: new EntryHolder(
1973: OriginEntrySource.SCRUBBER_VALID,
1974: "2007BA6044900-----7000---ACEECBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ACCDEFGHIJ----------12345678 "),
1975: new EntryHolder(
1976: OriginEntrySource.SCRUBBER_VALID,
1977: "2007BA6044900-----8000---ACASCBCD PDNOCAPCB 00000214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "), };
1978:
1979: scrub(input);
1980: assertOriginEntries(4, output);
1981: }
1982:
1983: /**
1984: * Tests that the scrubber does not generate a capitalization entry for entries with certain document types
1985: * @throws Exception thrown if any exception is encountered for any reason
1986: */
1987: public void testNoCapitalizationForCertainDocumentTypes()
1988: throws Exception {
1989:
1990: String[] input = new String[] {
1991: "2007BA6044913-----7300---ACEE07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
1992: "2007BA6044913-----9041---ACLI07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
1993:
1994: EntryHolder[] output = new EntryHolder[] {
1995: new EntryHolder(
1996: OriginEntrySource.BACKUP,
1997: "2007BA6044913-----7300---ACEE07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
1998: new EntryHolder(
1999: OriginEntrySource.BACKUP,
2000: "2007BA6044913-----9041---ACLI07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
2001: new EntryHolder(
2002: OriginEntrySource.SCRUBBER_VALID,
2003: "2007BA6044913-----7300---ACEE07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
2004: new EntryHolder(
2005: OriginEntrySource.SCRUBBER_VALID,
2006: "2007BA6044913-----9041---ACLI07TF LGNOCAPTF 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
2007:
2008: scrub(input);
2009: assertOriginEntries(4, output);
2010: }
2011:
2012: /**
2013: * Tests that the scrubber does not generate a capitalization entry for encumbrance entries
2014: * @throws Exception thrown if any exception is encountered for any reason
2015: */
2016: public void testNoCapitalizationForEncumbranceEntry()
2017: throws Exception {
2018:
2019: String[] input = new String[] {
2020: "2007BA6044906-----7300---EXEE07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D ",
2021: "2007BA6044906-----9041---EXLI07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D " };
2022:
2023: EntryHolder[] output = new EntryHolder[] {
2024: new EntryHolder(
2025: OriginEntrySource.BACKUP,
2026: "2007BA6044906-----7300---EXEE07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D "),
2027: new EntryHolder(
2028: OriginEntrySource.BACKUP,
2029: "2007BA6044906-----9041---EXLI07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D "),
2030: new EntryHolder(
2031: OriginEntrySource.SCRUBBER_VALID,
2032: "2007BA6044906-----7300---EXEE07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D "),
2033: new EntryHolder(
2034: OriginEntrySource.SCRUBBER_VALID,
2035: "2007BA6044906-----9041---EXLI07TOPSLGNOCAPEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D "), };
2036:
2037: scrub(input);
2038: assertOriginEntries(4, output);
2039: }
2040:
2041: /**
2042: * Tests that the scrubber generates the correct offset entries, even when there are mulitple period codes involved
2043: * @throws Exception thrown if any exception is encountered for any reason
2044: */
2045: public void testOffsetGenerationAcrossMultipleFiscalPeriods()
2046: throws Exception {
2047:
2048: String[] input = new String[] {
2049: "2007BL1031497-----4190---ACEX07GEC 01OFFSETPER 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- ",
2050: "2007BL1031497-----8000---ACAS08GEC 01OFFSETPER 00000TP Generated Offset 40.72D2006-01-05 ---------- " };
2051:
2052: EntryHolder[] output = new EntryHolder[] {
2053: new EntryHolder(
2054: OriginEntrySource.BACKUP,
2055: "2007BL1031497-----4190---ACEX07GEC 01OFFSETPER 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- "),
2056: new EntryHolder(
2057: OriginEntrySource.BACKUP,
2058: "2007BL1031497-----8000---ACAS08GEC 01OFFSETPER 00000TP Generated Offset 40.72D2006-01-05 ---------- "),
2059: new EntryHolder(
2060: OriginEntrySource.SCRUBBER_VALID,
2061: "2007BL1031497-----4190---ACEX07GEC 01OFFSETPER 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- "),
2062: new EntryHolder(
2063: OriginEntrySource.SCRUBBER_VALID,
2064: "2007BL1031497-----8000---ACAS07GEC 01OFFSETPER 00000GENERATED OFFSET 40.72D2006-01-01 ---------- "),
2065: new EntryHolder(
2066: OriginEntrySource.SCRUBBER_VALID,
2067: "2007BL1031497-----8000---ACAS08GEC 01OFFSETPER 00000TP Generated Offset 40.72D2006-01-05 ---------- "),
2068: new EntryHolder(
2069: OriginEntrySource.SCRUBBER_VALID,
2070: "2007BL1031497-----8000---ACAS08GEC 01OFFSETPER 00000GENERATED OFFSET 40.72C2006-01-01 ---------- "), };
2071:
2072: scrub(input);
2073: assertOriginEntries(4, output);
2074: }
2075:
2076: /**
2077: * Tests that the scrubber generates the correct offset entries, even when there are mulitple reversal dates involved
2078: * @throws Exception thrown if any exception is encountered for any reason
2079: */
2080: public void testOffsetGenerationAcrossMultipleReversalDates()
2081: throws Exception {
2082:
2083: String[] input = new String[] {
2084: "2007BA6044913-----1800---ACIN07CR 01OFFSETREV 00000Poplars Garage Fees 20.00D2006-01-05 ---------- 2005-01-31 ",
2085: "2007BA6044913-----8000---ACAS07CR 01OFFSETREV 00000TP Generated Offset 20.00C2006-01-05 ---------- 2005-02-01 " };
2086:
2087: EntryHolder[] output = new EntryHolder[] {
2088: new EntryHolder(
2089: OriginEntrySource.BACKUP,
2090: "2007BA6044913-----1800---ACIN07CR 01OFFSETREV 00000Poplars Garage Fees 20.00D2006-01-05 ---------- 2005-01-31 "),
2091: new EntryHolder(
2092: OriginEntrySource.BACKUP,
2093: "2007BA6044913-----8000---ACAS07CR 01OFFSETREV 00000TP Generated Offset 20.00C2006-01-05 ---------- 2005-02-01 "),
2094: new EntryHolder(
2095: OriginEntrySource.SCRUBBER_VALID,
2096: "2007BA6044913-----1800---ACIN07CR 01OFFSETREV 00000Poplars Garage Fees 20.00D2006-01-05 ---------- 2005-01-31 "),
2097: new EntryHolder(
2098: OriginEntrySource.SCRUBBER_VALID,
2099: "2007BA6044913-----8000---ACAS07CR 01OFFSETREV 00000GENERATED OFFSET 20.00C2006-01-01 ---------- 2005-01-31 "),
2100: new EntryHolder(
2101: OriginEntrySource.SCRUBBER_VALID,
2102: "2007BA6044913-----8000---ACAS07CR 01OFFSETREV 00000TP Generated Offset 20.00C2006-01-05 ---------- 2005-02-01 "),
2103: new EntryHolder(
2104: OriginEntrySource.SCRUBBER_VALID,
2105: "2007BA6044913-----8000---ACAS07CR 01OFFSETREV 00000GENERATED OFFSET 20.00D2006-01-01 ---------- 2005-02-01 "), };
2106:
2107: scrub(input);
2108: assertOriginEntries(4, output);
2109: }
2110:
2111: // This test fails in anthill but runs in dev
2112: // public void testOffsetGenerationAcrossMultipleBalanceTypes() throws Exception {
2113: //
2114: // String[] input = new String[] {
2115: // "2007BA9120656-----4035---EXEX07EXEN01OFFSETBAL 00000pymts recd 12/28/05 25.15C2006-01-05 ---------- D ",
2116: // "2007BA9120656-----8000---ACAS07TOPS01OFFSETBAL 00000TP Generated Offset 25.15D2006-01-05 ---------- " };
2117: //
2118: // EntryHolder[] output = new EntryHolder[] {
2119: // new EntryHolder(OriginEntrySource.BACKUP, "2007BA9120656-----4035---EXEX07EXEN01OFFSETBAL 00000pymts recd 12/28/05
2120: // 25.15C2006-01-05 ---------- D "),
2121: // new EntryHolder(OriginEntrySource.BACKUP, "2007BA9120656-----8000---ACAS07TOPS01OFFSETBAL 00000TP Generated Offset
2122: // 25.15D2006-01-05 ---------- "),
2123: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID, "2007BA9120656-----4035---EXEX07EXEN01OFFSETBAL 00000pymts recd 12/28/05
2124: // 25.15C2006-01-05 ---------- D "),
2125: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID, "2007BA9120656-----9892---EXFB07EXEN01OFFSETBAL 00000GENERATED OFFSET
2126: // 25.15D2006-01-01 ---------- "),
2127: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID, "2007BA9120656-----8000---ACAS07TOPS01OFFSETBAL 00000TP Generated Offset
2128: // 25.15D2006-01-05 ---------- "),
2129: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID, "2007BA9120656-----8000---ACAS07TOPS01OFFSETBAL 00000GENERATED OFFSET
2130: // 25.15C2006-01-01 ---------- "), };
2131: //
2132: // scrub(input);
2133: // assertOriginEntries(4, output);
2134: // }
2135:
2136: // This test fails in anthill but runs in dev
2137: // public void testOffsetGenerationAcrossMultipleSubAccountNumbers() throws Exception {
2138: //
2139: // String[] input = new String[] {
2140: // "2007BL1031400ADV 5000---ACEX07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- ",
2141: // "2007BL1031400AHD 9041---ACLI07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- "
2142: // };
2143: //
2144: // EntryHolder[] output = new EntryHolder[] {
2145: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400ADV 5000---ACEX07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON
2146: // ASSOCIATES IN 1200.00D2006-01-05 ---------- "),
2147: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400AHD 9041---ACLI07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON
2148: // ASSOCIATES IN 1200.00C2006-01-05 ---------- "),
2149: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400ADV 5000---ACEX07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON
2150: // ASSOCIATES IN 1200.00D2006-01-05 ---------- "),
2151: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400ADV 8000---ACAS07TOPSLGOFFSETSAC00000GENERATED OFFSET
2152: // 1200.00C2006-01-01 ---------- "),
2153: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400AHD 9041---ACLI07TOPSLGOFFSETSAC00000225050007 WILLIAMS DOTSON
2154: // ASSOCIATES IN 1200.00C2006-01-05 ---------- "),
2155: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400AHD 8000---ACAS07TOPSLGOFFSETSAC00000GENERATED OFFSET
2156: // 1200.00D2006-01-01 ---------- "),
2157: // };
2158: //
2159: // scrub(input);
2160: // assertOriginEntries(4,output);
2161: // }
2162:
2163: // This test fails in anthill but runs in dev
2164: // public void testOffsetGenerationAcrossMultipleDocumentNumbers() throws Exception {
2165: //
2166: // String[] input = new String[] {
2167: // "2007BA6044913-----1466---ACIC07AVAD01OFFSETDC100000online permit sales for 01/03/06 240.00D2006-01-05 ---------- ",
2168: // "2007BA6044913-----5000---ACEX07AVAD01OFFSETDC100000online permit sales for 01/03/06 3880.00C2006-01-05 ---------- ",
2169: // "2007BA6044913-----4100---ACEX07AVAD01OFFSETDC200000online permit sales for 01/03/06 725.00C2006-01-05 ---------- ",
2170: // "2007BA6044913-----1800---ACIC07AVAD01OFFSETDC200000online permit sales for 01/03/06 3395.00D2006-01-05 ---------- "
2171: // };
2172: //
2173: // EntryHolder[] output = new EntryHolder[] {
2174: // new EntryHolder(OriginEntrySource.BACKUP,"2007BA6044913-----1466---ACIC07AVAD01OFFSETDC100000online permit sales for
2175: // 01/03/06 240.00D2006-01-05 ---------- "),
2176: // new EntryHolder(OriginEntrySource.BACKUP,"2007BA6044913-----5000---ACEX07AVAD01OFFSETDC100000online permit sales for
2177: // 01/03/06 3880.00C2006-01-05 ---------- "),
2178: // new EntryHolder(OriginEntrySource.BACKUP,"2007BA6044913-----4100---ACEX07AVAD01OFFSETDC200000online permit sales for
2179: // 01/03/06 725.00C2006-01-05 ---------- "),
2180: // new EntryHolder(OriginEntrySource.BACKUP,"2007BA6044913-----1800---ACIC07AVAD01OFFSETDC200000online permit sales for
2181: // 01/03/06 3395.00D2006-01-05 ---------- "),
2182: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----1466---ACIC07AVAD01OFFSETDC100000online permit sales for
2183: // 01/03/06 240.00D2006-01-05 ---------- "),
2184: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----5000---ACEX07AVAD01OFFSETDC100000online permit sales for
2185: // 01/03/06 3880.00C2006-01-05 ---------- "),
2186: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----9897---ACFB07AVAD01OFFSETDC100000GENERATED OFFSET
2187: // 3640.00D2006-01-01 ---------- "),
2188: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----1800---ACIC07AVAD01OFFSETDC200000online permit sales for
2189: // 01/03/06 3395.00D2006-01-05 ---------- "),
2190: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----4100---ACEX07AVAD01OFFSETDC200000online permit sales for
2191: // 01/03/06 725.00C2006-01-05 ---------- "),
2192: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BA6044913-----9897---ACFB07AVAD01OFFSETDC200000GENERATED OFFSET
2193: // 2670.00C2006-01-01 ---------- "),
2194: // };
2195: //
2196: // scrub(input);
2197: // assertOriginEntries(4,output);
2198: // }
2199:
2200: /**
2201: * Tests that the scrubber generates the correct offset entries, even with there are multiple origin codes involved
2202: * @throws Exception thrown if any exception is encountered for any reason
2203: */
2204: public void testOffsetGenerationAcrossMultipleOriginCodes()
2205: throws Exception {
2206:
2207: String[] input = new String[] {
2208: "2007BA6044906-----4010---ACEX07DI 01OFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- ",
2209: "2007BA6044906-----5000---ACEX07DI EUOFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- " };
2210:
2211: EntryHolder[] output = new EntryHolder[] {
2212: new EntryHolder(
2213: OriginEntrySource.BACKUP,
2214: "2007BA6044906-----4010---ACEX07DI 01OFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- "),
2215: new EntryHolder(
2216: OriginEntrySource.BACKUP,
2217: "2007BA6044906-----5000---ACEX07DI EUOFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- "),
2218: new EntryHolder(
2219: OriginEntrySource.SCRUBBER_VALID,
2220: "2007BA6044906-----4010---ACEX07DI 01OFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- "),
2221: new EntryHolder(
2222: OriginEntrySource.SCRUBBER_VALID,
2223: "2007BA6044906-----8000---ACAS07DI 01OFFSETORG 00000GENERATED OFFSET 294.64C2006-01-01 ---------- "),
2224: new EntryHolder(
2225: OriginEntrySource.SCRUBBER_VALID,
2226: "2007BA6044906-----5000---ACEX07DI EUOFFSETORG 00000OFFICE SUPPLY CHARGEBACKS 294.64D2006-01-05 ---------- "),
2227: new EntryHolder(
2228: OriginEntrySource.SCRUBBER_VALID,
2229: "2007BA6044906-----8000---ACAS07DI EUOFFSETORG 00000GENERATED OFFSET 294.64C2006-01-01 ---------- "), };
2230:
2231: scrub(input);
2232: assertOriginEntries(4, output);
2233: }
2234:
2235: // This test doesn't work in anthill for some reason
2236: // public void testOffsetGenerationAcrossMultipleDocumentTypes() throws Exception {
2237: //
2238: // String[] input = new String[] {
2239: // "2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC GENERAL/INSIGHT CABLE 44.95C2006-01-05 ---------- ",
2240: // "2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC GENERAL/SULLIVAN S FASHIONS FO 540.00C2006-01-05 ---------- ",
2241: // "2007BL1031400-----4021---ACEX07GEC 01OFFSETDTP00000SOM/MUSIC GENERAL/INSIGHT CABLE 44.95C2006-01-05 ---------- ",
2242: // "2007BL1031400-----1800---ACIN07GEC 01OFFSETDTP00000SOM/MUSIC GENERAL/SULLIVAN S FASHIONS FO 547.00D2006-01-05 ---------- "
2243: // };
2244: //
2245: // EntryHolder[] output = new EntryHolder[] {
2246: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC GENERAL/INSIGHT
2247: // CABLE 44.95C2006-01-05 ---------- "),
2248: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC GENERAL/SULLIVAN S
2249: // FASHIONS FO 540.00C2006-01-05 ---------- "),
2250: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400-----4021---ACEX07GEC 01OFFSETDTP00000SOM/MUSIC GENERAL/INSIGHT
2251: // CABLE 44.95C2006-01-05 ---------- "),
2252: // new EntryHolder(OriginEntrySource.BACKUP,"2007BL1031400-----1800---ACIN07GEC 01OFFSETDTP00000SOM/MUSIC GENERAL/SULLIVAN S
2253: // FASHIONS FO 547.00D2006-01-05 ---------- "),
2254: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----1800---ACIN07GEC 01OFFSETDTP00000SOM/MUSIC
2255: // GENERAL/SULLIVAN S FASHIONS FO 547.00D2006-01-05 ---------- "),
2256: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----4021---ACEX07GEC 01OFFSETDTP00000SOM/MUSIC
2257: // GENERAL/INSIGHT CABLE 44.95C2006-01-05 ---------- "),
2258: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----8000---ACAS07GEC 01OFFSETDTP00000GENERATED OFFSET
2259: // 502.05C2006-01-01 ---------- "),
2260: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC
2261: // GENERAL/INSIGHT CABLE 44.95C2006-01-05 ---------- "),
2262: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----4190---ACEX07PCDO01OFFSETDTP00000SOM/MUSIC
2263: // GENERAL/SULLIVAN S FASHIONS FO 540.00C2006-01-05 ---------- "),
2264: // new EntryHolder(OriginEntrySource.SCRUBBER_VALID,"2007BL1031400-----8000---ACAS07PCDO01OFFSETDTP00000GENERATED OFFSET
2265: // 584.95D2006-01-01 ---------- "),
2266: // };
2267: //
2268: // scrub(input);
2269: // assertOriginEntries(4,output);
2270: // }
2271:
2272: /**
2273: * Tests that the scrubber considers entries with closed accounts to be valid
2274: * @throws Exception thrown if any exception is encountered for any reason
2275: */
2276: public void testClosedAccount() throws Exception {
2277:
2278: String[] input = new String[] {
2279: "2007BA6044909-----1800---ACIN07CR UBCLOSACCT 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
2280: "2007BA6044909-----8000---ACAS07CR UBCLOSACCT 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
2281:
2282: EntryHolder[] output = new EntryHolder[] {
2283: new EntryHolder(
2284: OriginEntrySource.BACKUP,
2285: "2007BA6044909-----1800---ACIN07CR UBCLOSACCT 00000Poplars Garage Fees 20.00C2006-01-05 ---------- "),
2286: new EntryHolder(
2287: OriginEntrySource.BACKUP,
2288: "2007BA6044909-----8000---ACAS07CR UBCLOSACCT 00000TP Generated Offset 20.00D2006-01-05 ---------- "),
2289: new EntryHolder(
2290: OriginEntrySource.SCRUBBER_VALID,
2291: "2007BA6044900-----1800---ACIN07CR UBCLOSACCT 00000AUTO FR BA6044909Poplars Garage Fees 20.00C2006-01-05 ---------- "),
2292: new EntryHolder(
2293: OriginEntrySource.SCRUBBER_VALID,
2294: "2007BA6044900-----8000---ACAS07CR UBCLOSACCT 00000AUTO FR BA6044909TP Generated Offset 20.00D2006-01-05 ---------- "),
2295: new EntryHolder(
2296: OriginEntrySource.SCRUBBER_EXPIRED,
2297: "2007BA6044900-----1800---ACIN07CR UBCLOSACCT 00000AUTO FR BA6044909Poplars Garage Fees 20.00C2006-01-05 ---------- "),
2298: new EntryHolder(
2299: OriginEntrySource.SCRUBBER_EXPIRED,
2300: "2007BA6044900-----8000---ACAS07CR UBCLOSACCT 00000AUTO FR BA6044909TP Generated Offset 20.00D2006-01-05 ---------- "), };
2301:
2302: scrub(input);
2303: assertOriginEntries(4, output);
2304: }
2305:
2306: /**
2307: * Tests that the scrubber considers entries with accounts expired by document type to be valid
2308: * @throws Exception thrown if any exception is encountered for any reason
2309: */
2310: public void testExpiredAccountByDocumentType() throws Exception {
2311:
2312: String[] input = new String[] {
2313: "2007BL4631557-----4100---ACEX07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
2314: "2007BL4631557-----9041---ACLI07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
2315:
2316: EntryHolder[] output = new EntryHolder[] {
2317: new EntryHolder(
2318: OriginEntrySource.BACKUP,
2319: "2007BL4631557-----4100---ACEX07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
2320: new EntryHolder(
2321: OriginEntrySource.BACKUP,
2322: "2007BL4631557-----9041---ACLI07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
2323: new EntryHolder(
2324: OriginEntrySource.SCRUBBER_VALID,
2325: "2007BL4631557-----4100---ACEX07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
2326: new EntryHolder(
2327: OriginEntrySource.SCRUBBER_VALID,
2328: "2007BL4631557-----9041---ACLI07LOCRLGEXPRACTLC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
2329:
2330: scrub(input);
2331: assertOriginEntries(4, output);
2332: }
2333:
2334: /**
2335: * Tests that the scrubber considers entries with accounts, expired by the balance type, to be valid
2336: * @throws Exception thrown if any exception is encountered for any reason
2337: */
2338: public void testExpiredAccountByBalanceType() throws Exception {
2339:
2340: String[] input = new String[] {
2341: "2007BL4131407-----4100---EXEX07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D ",
2342: "2007BL4131407-----9041---EXLI07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D " };
2343:
2344: EntryHolder[] output = new EntryHolder[] {
2345: new EntryHolder(
2346: OriginEntrySource.BACKUP,
2347: "2007BL4131407-----4100---EXEX07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D "),
2348: new EntryHolder(
2349: OriginEntrySource.BACKUP,
2350: "2007BL4131407-----9041---EXLI07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D "),
2351: new EntryHolder(
2352: OriginEntrySource.SCRUBBER_VALID,
2353: "2007BL4131407-----4100---EXEX07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- D "),
2354: new EntryHolder(
2355: OriginEntrySource.SCRUBBER_VALID,
2356: "2007BL4131407-----9041---EXLI07TOPSLGEXPRACTEX 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- D "), };
2357:
2358: scrub(input);
2359: assertOriginEntries(4, output);
2360: }
2361:
2362: /**
2363: * Tests that the scrubber considers entries with accounts expired by origin code to be valid
2364: * @throws Exception thrown if any exception is encountered for any reason
2365: */
2366: public void testExpiredAccountByOriginCode() throws Exception {
2367:
2368: String[] input = new String[] {
2369: "2007BL1031467-----5300---ACEE07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
2370: "2007BL1031467-----8000---ACAS07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 ", };
2371:
2372: EntryHolder[] output = new EntryHolder[] {
2373: new EntryHolder(
2374: OriginEntrySource.BACKUP,
2375: "2007BL1031467-----5300---ACEE07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 "),
2376: new EntryHolder(
2377: OriginEntrySource.BACKUP,
2378: "2007BL1031467-----8000---ACAS07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "),
2379: new EntryHolder(
2380: OriginEntrySource.SCRUBBER_VALID,
2381: "2007BL1031467-----5300---ACEE07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 "),
2382: new EntryHolder(
2383: OriginEntrySource.SCRUBBER_VALID,
2384: "2007BL1031467-----8000---ACAS07DD 01EXPRACT01 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "), };
2385:
2386: scrub(input);
2387: assertOriginEntries(4, output);
2388: }
2389:
2390: /**
2391: * Tests that the scrubber considers entries with expired c&g accounts to be valid
2392: * @throws Exception thrown if any exception is encountered for any reason
2393: */
2394: public void testExpiredContractAndGrantAccount() throws Exception {
2395:
2396: String[] input = new String[] {
2397: "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
2398: "2007BL4131407-----9041---ACLI07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
2399: EntryHolder[] output = new EntryHolder[] {
2400: new EntryHolder(
2401: OriginEntrySource.BACKUP,
2402: "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
2403: new EntryHolder(
2404: OriginEntrySource.BACKUP,
2405: "2007BL4131407-----9041---ACLI07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "),
2406: new EntryHolder(
2407: OriginEntrySource.SCRUBBER_VALID,
2408: "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- "),
2409: new EntryHolder(
2410: OriginEntrySource.SCRUBBER_VALID,
2411: "2007BL4131407-----9041---ACLI07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- "), };
2412:
2413: scrub(input);
2414: assertOriginEntries(4, output);
2415: }
2416:
2417: /**
2418: * Tests that the scrubber considers entries with expired accounts to be valid
2419: * @throws Exception thrown if any exception is encountered for any reason
2420: */
2421: public void testExpiredAccount() throws Exception {
2422:
2423: String[] input = new String[] {
2424: "2007BL1031467-----5300---ACEE07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
2425: "2007BL1031467-----8000---ACAS07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 " };
2426:
2427: EntryHolder[] output = new EntryHolder[] {
2428: new EntryHolder(
2429: OriginEntrySource.BACKUP,
2430: "2007BL1031467-----5300---ACEE07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 "),
2431: new EntryHolder(
2432: OriginEntrySource.BACKUP,
2433: "2007BL1031467-----8000---ACAS07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "),
2434: new EntryHolder(
2435: OriginEntrySource.SCRUBBER_VALID,
2436: "2007BL1031467-----5300---ACEE07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 "),
2437: new EntryHolder(
2438: OriginEntrySource.SCRUBBER_VALID,
2439: "2007BL1031467-----8000---ACAS07CD PDEXPIRACCT 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345679 "), };
2440:
2441: scrub(input);
2442: assertOriginEntries(4, output);
2443: }
2444:
2445: // ************************************************************** Tests for error conditions below.
2446:
2447: /**
2448: * Tests that the scrubber considers invalid encumbrance update codes to be errors
2449: * @throws Exception thrown if any exception is encountered for any reason
2450: */
2451: public void testInvalidEncumbranceUpdateCode() throws Exception {
2452:
2453: String[] inputTransactions = {
2454: "2007BL1031420-----4110---IEEX07PAYEEUINVALENCC 00000NOV-05 IMU Business Office 2224 241.75C2005-11-30 ---------- X ",
2455: "2007BL1031420-----9892---IEAS07PAYEEUINVALENCC 00000NOV-05 IMU Business Office 2237 241.75D2005-11-30 ---------- X " };
2456:
2457: EntryHolder[] outputTransactions = {
2458: new EntryHolder(OriginEntrySource.BACKUP,
2459: inputTransactions[0]),
2460: new EntryHolder(OriginEntrySource.BACKUP,
2461: inputTransactions[1]),
2462: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2463: inputTransactions[0]),
2464: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2465: inputTransactions[1]) };
2466:
2467: scrub(inputTransactions);
2468: assertOriginEntries(4, outputTransactions);
2469: }
2470:
2471: /**
2472: * Tests that the scrubber considers blank encumbrance update codes to be errors
2473: * @throws Exception thrown if any exception is encountered for any reason
2474: */
2475: public void testBlankEncumbranceUpdateCodeOnEncumbranceRecord()
2476: throws Exception {
2477:
2478: String[] inputTransactions = {
2479: "2007BL1031400-----4100---PEEX07TF 01BLANKENCC 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
2480: "2007BL1031400-----9891---PEFB07TF 01BLANKENCC 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
2481:
2482: EntryHolder[] outputTransactions = {
2483: new EntryHolder(OriginEntrySource.BACKUP,
2484: inputTransactions[0]),
2485: new EntryHolder(OriginEntrySource.BACKUP,
2486: inputTransactions[1]),
2487: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2488: inputTransactions[0]),
2489: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2490: inputTransactions[1]) };
2491:
2492: scrub(inputTransactions);
2493: assertOriginEntries(4, outputTransactions);
2494: }
2495:
2496: /**
2497: * Tests that the scrubber considers entries with blank reference numbers but an encumbrance update code that requires a reference document to be errors
2498: * @throws Exception thrown if any exception is encountered for any reason
2499: */
2500: public void testBlankReferenceDocumentNumberWithEncumbranceUpdateCodeOfR()
2501: throws Exception {
2502:
2503: String[] inputTransactions = {
2504: "2007BA6044900-----1599---EXIN07TOPSLGBLANKRDOC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- CR 01 R ",
2505: "2007BA6044900-----9041---EXLI07TOPSLDBLANKRDOC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- CR 01 R " };
2506:
2507: EntryHolder[] outputTransactions = {
2508: new EntryHolder(OriginEntrySource.BACKUP,
2509: inputTransactions[0]),
2510: new EntryHolder(OriginEntrySource.BACKUP,
2511: inputTransactions[1]),
2512: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2513: inputTransactions[1]),
2514: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2515: inputTransactions[0]) };
2516:
2517: scrub(inputTransactions);
2518: assertOriginEntries(4, outputTransactions);
2519: }
2520:
2521: /**
2522: * Tests that the scrubber considers entries with a document number present but no other document data to be errors
2523: * @throws Exception thrown if any exception is encountered for any reason
2524: */
2525: public void testReferenceDocumentNumberPresentWithoutOtherFields()
2526: throws Exception {
2527:
2528: String[] inputTransactions = {
2529: "2007BA6044906-----5300---ACEE07CHKDPDLONERDOC 12345TEST KUALI SCRUBBER EDITS 1445.00D2006-01-05ABCDEFGHIJ----------12345678 123456789 ",
2530: "2007BA6044906-----8000---ACAS07CHKDPDLONERDOC 12345TEST KUALI SCRUBBER EDITS 1445.00C2006-01-05ABCDEFGHIG----------12345678 123456789 " };
2531:
2532: EntryHolder[] outputTransactions = {
2533: new EntryHolder(OriginEntrySource.BACKUP,
2534: inputTransactions[0]),
2535: new EntryHolder(OriginEntrySource.BACKUP,
2536: inputTransactions[1]),
2537: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2538: inputTransactions[0]),
2539: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2540: inputTransactions[1]) };
2541:
2542: scrub(inputTransactions);
2543: assertOriginEntries(4, outputTransactions);
2544: }
2545:
2546: /**
2547: * Tests that the scrubber considers blank reference origin codes, in an entry with the encumbrance update code requiring reference documents, to be errors
2548: * @throws Exception thrown if any exception is encountered for any reason
2549: */
2550: public void testBlankReferenceOriginCodeWithEncumbranceUpdateCodeOfR()
2551: throws Exception {
2552:
2553: String[] inputTransactions = {
2554: "2007BL9120656-----5000---ACEX07INV EUBLANKRORG 00000BALDWIN WALLACE COLLEGE 3375.00C2006-01-05 ---------- DI 123456789 ",
2555: "2007BL9120656-----8000---ACAS07INV EUBLANKRORG 00000TP Generated Offset 3375.00D2006-01-05 ---------- DI 123456789 " };
2556:
2557: EntryHolder[] outputTransactions = {
2558: new EntryHolder(OriginEntrySource.BACKUP,
2559: inputTransactions[0]),
2560: new EntryHolder(OriginEntrySource.BACKUP,
2561: inputTransactions[1]),
2562: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2563: inputTransactions[0]),
2564: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2565: inputTransactions[1]) };
2566:
2567: scrub(inputTransactions);
2568: assertOriginEntries(4, outputTransactions);
2569: }
2570:
2571: /**
2572: * Tests that the scrubber considers invalid reference origin codes to be errors
2573: * @throws Exception thrown if any exception is encountered for any reason
2574: */
2575: public void testInvalidReferenceOriginCode() throws Exception {
2576:
2577: String[] inputTransactions = {
2578: "2007BL2231411-----2400---ACEX07ST EUINVALRORG 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- CD XX123456789 ",
2579: "2007BL2231411-----8000---ACAS07ST EUINVALRORG 00000PAYROLL EXPENSE TRANSFERS 620.00D2006-01-05 ---------- CD XX123456789 " };
2580:
2581: EntryHolder[] outputTransactions = {
2582: new EntryHolder(OriginEntrySource.BACKUP,
2583: inputTransactions[0]),
2584: new EntryHolder(OriginEntrySource.BACKUP,
2585: inputTransactions[1]),
2586: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2587: inputTransactions[0]),
2588: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2589: inputTransactions[1]) };
2590:
2591: scrub(inputTransactions);
2592: assertOriginEntries(4, outputTransactions);
2593: }
2594:
2595: /**
2596: * Tests that the scrubber considers blank reference document types, in an entry with the encumbrance update code that requiring reference documents, to be errors
2597: * @throws Exception thrown if any exception is encountered for any reason
2598: */
2599: public void testBlankReferenceDocumentTypeWithEncumbranceUpdateCodeOfR()
2600: throws Exception {
2601:
2602: String[] inputTransactions = {
2603: "2007BL2231408-----4035---ACEX07SB 01BLANKRDTP 00000Biology Stockroom 13.77D2006-01-05 ---------- LG123456789 ",
2604: "2007BL2231408-----8000---ACAS07SB 01BLANKRDTP 00000TP Generated Offset 13.77C2006-01-05 ---------- LG123456789 " };
2605:
2606: EntryHolder[] outputTransactions = {
2607: new EntryHolder(OriginEntrySource.BACKUP,
2608: inputTransactions[0]),
2609: new EntryHolder(OriginEntrySource.BACKUP,
2610: inputTransactions[1]),
2611: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2612: inputTransactions[0]),
2613: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2614: inputTransactions[1]) };
2615:
2616: scrub(inputTransactions);
2617: assertOriginEntries(4, outputTransactions);
2618: }
2619:
2620: /**
2621: * Tests that the scrubber considers invalid reference document types to be errors
2622: * @throws Exception thrown if any exception is encountered for any reason
2623: */
2624: public void testInvalidReferenceDocumentType() throws Exception {
2625: String[] inputTransactions = {
2626: "2007BL1031497-----4190---ACEX07GEC 01INVALRDTP 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- XXXXLG123456789 ",
2627: "2007BL1031497-----8000---ACAS07GEC 01INVALRDTP 00000TP Generated Offset 40.72D2006-01-05 ---------- XXXXLG123456789 " };
2628:
2629: EntryHolder[] outputTransactions = {
2630: new EntryHolder(OriginEntrySource.BACKUP,
2631: inputTransactions[0]),
2632: new EntryHolder(OriginEntrySource.BACKUP,
2633: inputTransactions[1]),
2634: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2635: inputTransactions[0]),
2636: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2637: inputTransactions[1]) };
2638:
2639: scrub(inputTransactions);
2640: assertOriginEntries(4, outputTransactions);
2641: }
2642:
2643: /**
2644: * Tests that the scrubber considers invalid project codes to be errors
2645: * @throws Exception thrown if any exception is encountered for any reason
2646: */
2647: public void testInvalidProjectCode() throws Exception {
2648: String[] inputTransactions = {
2649: "2007BL9120656-----4035---ACEX07CR 01INVALPROJ 00000pymts recd 12/28/05 25.15C2006-01-05 XXXXXXXXX ",
2650: "2007BL9120656-----8000---ACAS07CR 01INVALPROJ 00000TP Generated Offset 25.15D2006-01-05 XXXXXXXXX " };
2651:
2652: EntryHolder[] outputTransactions = {
2653: new EntryHolder(OriginEntrySource.BACKUP,
2654: inputTransactions[0]),
2655: new EntryHolder(OriginEntrySource.BACKUP,
2656: inputTransactions[1]),
2657: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2658: inputTransactions[0]),
2659: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2660: inputTransactions[1]) };
2661:
2662: scrub(inputTransactions);
2663: assertOriginEntries(4, outputTransactions);
2664: }
2665:
2666: /**
2667: * Tests that the scrubber considers invalid transaction dates to be errors.
2668: * @throws Exception thrown if any exception is encountered for any reason
2669: */
2670: public void testInvalidTransactionDate() throws Exception {
2671: String[] inputTransactions = {
2672: "2007BL1031497-----4100---ACEX07PO LGINVALDATE 00000Rite Quality Office Supplies Inc. 43.42D2096-02-11 ---------- ",
2673: "2007BL1031497-----9892---ACFB07PO LGINVALDATE 00000Rite Quality Office Supplies Inc. 43.42C1006-12-23 ---------- " };
2674:
2675: EntryHolder[] outputTransactions = {
2676: new EntryHolder(OriginEntrySource.BACKUP,
2677: inputTransactions[0]),
2678: new EntryHolder(OriginEntrySource.BACKUP,
2679: inputTransactions[1]),
2680: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2681: inputTransactions[0]),
2682: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2683: inputTransactions[1]) };
2684:
2685: scrub(inputTransactions);
2686: assertOriginEntries(4, outputTransactions);
2687: }
2688:
2689: /**
2690: * Tests that the scrubber considers invalid debit/credit codes to be errors
2691: * @throws Exception thrown if any exception is encountered for any reason
2692: */
2693: public void testInvalidDebitCreditCode() throws Exception {
2694: String[] inputTransactions = {
2695: "2007BL1031420-----4110---ACEX07DI EUINVALDBCR 00000NOV-05 IMU Business Office 2224 241.75X2005-11-30 ---------- ",
2696: "2007BL1031420-----8000---ACAS07DI EUINVALDBCR 00000NOV-05 IMU Business Office 2237 241.75X2005-11-30 ---------- " };
2697:
2698: EntryHolder[] outputTransactions = {
2699: new EntryHolder(OriginEntrySource.BACKUP,
2700: inputTransactions[0]),
2701: new EntryHolder(OriginEntrySource.BACKUP,
2702: inputTransactions[1]),
2703: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2704: inputTransactions[0]),
2705: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2706: inputTransactions[1]) };
2707:
2708: scrub(inputTransactions);
2709: assertOriginEntries(4, outputTransactions);
2710: }
2711:
2712: /**
2713: * Tests that the scrubber considers non blank debit/credit codes on entries not requiring offsets to be errors
2714: * @throws Exception thrown if any exception is encountered for any reason
2715: */
2716: public void testDebitCreditCodeOnTransactionNotRequiringOffset()
2717: throws Exception {
2718: String[] inputTransactions = {
2719: "2007BL1031400-----4100---MBEX07BA 01WRONGDBCR 00000Rite Quality Office Supplies Inc. 94.35D2006-01-05 ---------- ",
2720: "2007BL1031400-----1800---MBLI07BA 01WRONGDBCR 00000Rite Quality Office Supplies Inc. 94.35C2006-01-05 ---------- " };
2721:
2722: EntryHolder[] outputTransactions = {
2723: new EntryHolder(OriginEntrySource.BACKUP,
2724: inputTransactions[0]),
2725: new EntryHolder(OriginEntrySource.BACKUP,
2726: inputTransactions[1]),
2727: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2728: inputTransactions[1]),
2729: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2730: inputTransactions[0]) };
2731:
2732: scrub(inputTransactions);
2733: assertOriginEntries(4, outputTransactions);
2734: }
2735:
2736: /**
2737: * Tests that the scrubber considers blank debit/credit codes on entries requiring offsets to be errors
2738: * @throws Exception thrown if any exception is encountered for any reason
2739: */
2740: public void testBlankDebitCreditCodeOnTransactionRequiringOffset()
2741: throws Exception {
2742: String[] inputTransactions = {
2743: "2007BA6044913-----1470---ACIN07CR 01BLANKDBCR 00000Poplars Garage Fees 20.00 2006-01-05 ---------- ",
2744: "2007BA6044913-----8000---ACAS07CR 01BLANKDBCR 00000TP Generated Offset 20.00 2006-01-05 ---------- " };
2745: EntryHolder[] outputTransactions = {
2746: new EntryHolder(OriginEntrySource.BACKUP,
2747: inputTransactions[0]),
2748: new EntryHolder(OriginEntrySource.BACKUP,
2749: inputTransactions[1]),
2750: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2751: inputTransactions[0]),
2752: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2753: inputTransactions[1]) };
2754:
2755: scrub(inputTransactions);
2756: assertOriginEntries(4, outputTransactions);
2757: }
2758:
2759: /**
2760: * Tests that the scrubber considers blank document numbers to be errors
2761: * @throws Exception thrown if any exception is encountered for any reason
2762: */
2763: public void testBlankDocumentNumber() throws Exception {
2764: String[] inputTransactions = {
2765: "2007BL2231423-----1800---ACIN CR PL 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- ",
2766: "2007BL2231423-----8000---ACAS CR PL 00000TP Generated Offset 45995.84D2006-01-05 ---------- " };
2767:
2768: EntryHolder[] outputTransactions = {
2769: new EntryHolder(OriginEntrySource.BACKUP,
2770: inputTransactions[0]),
2771: new EntryHolder(OriginEntrySource.BACKUP,
2772: inputTransactions[1]),
2773: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2774: inputTransactions[0]),
2775: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2776: inputTransactions[1]) };
2777:
2778: scrub(inputTransactions);
2779: assertOriginEntries(4, outputTransactions);
2780: }
2781:
2782: /**
2783: * Tests that the scrubber considers invalid origin codes to be errors
2784: * @throws Exception thrown if any exception is encountered for any reason
2785: */
2786: public void testInvalidOriginCode() throws Exception {
2787: String[] inputTransactions = { "2007BA9120656-----5000---ACEX07INV XXINVALORIG 00000BALDWIN WALLACE COLLEGE 3375.00C2006-01-05 ---------- ", };
2788:
2789: EntryHolder[] outputTransactions = {
2790: new EntryHolder(OriginEntrySource.BACKUP,
2791: inputTransactions[0]),
2792: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2793: inputTransactions[0]), };
2794:
2795: scrub(inputTransactions);
2796: assertOriginEntries(4, outputTransactions);
2797: }
2798:
2799: /**
2800: * Tests that the scrubber considers blank origin codes to be errors
2801: *
2802: * @throws Exception thrown if any exception is encountered for any reason
2803: */
2804: public void testBlankOriginCode() throws Exception {
2805:
2806: String[] inputTransactions = { "2007BL2231411-----2400---ACEX07ST BLANKORIG 00000PAYROLL EXPENSE TRANSFERS 620.00C2006-01-05 ---------- ", };
2807:
2808: EntryHolder[] outputTransactions = {
2809: new EntryHolder(OriginEntrySource.BACKUP,
2810: inputTransactions[0]),
2811: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2812: inputTransactions[0]), };
2813:
2814: scrub(inputTransactions);
2815: assertOriginEntries(4, outputTransactions);
2816: }
2817:
2818: /**
2819: * Tests that the scrubber considers invalid document types to be errors
2820: *
2821: * @throws Exception thrown if any exception is encountered for any reason
2822: */
2823: public void testInvalidDocumentType() throws Exception {
2824: String[] inputTransactions = {
2825: "2007BL2231408-----4035---ACEX07XXX 01INVALDTYP 00000Biology Stockroom 13.77D2006-01-05 ---------- ",
2826: "2007BL2231408-----8000---ACAS07XXX 01INVALDTYP 00000TP Generated Offset 13.77C2006-01-05 ---------- " };
2827:
2828: EntryHolder[] outputTransactions = {
2829: new EntryHolder(OriginEntrySource.BACKUP,
2830: inputTransactions[0]),
2831: new EntryHolder(OriginEntrySource.BACKUP,
2832: inputTransactions[1]),
2833: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2834: inputTransactions[0]),
2835: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2836: inputTransactions[1]) };
2837:
2838: scrub(inputTransactions);
2839: assertOriginEntries(4, outputTransactions);
2840: }
2841:
2842: /**
2843: * Tests that the scrubber considers blank document types to be errors
2844: *
2845: * @throws Exception thrown if any exception is encountered for any reason
2846: */
2847: public void testBlankDocumentType() throws Exception {
2848: String[] inputTransactions = {
2849: "2007BA6044900-----8000---ACAS07 01BLANKDTYP 00000TP Generated Offset 1650.00C2006-01-05 ---------- ",
2850: "2007BL6044900-----4866---ACEX07 01BLANKDTYP 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- " };
2851:
2852: EntryHolder[] outputTransactions = {
2853: new EntryHolder(OriginEntrySource.BACKUP,
2854: inputTransactions[0]),
2855: new EntryHolder(OriginEntrySource.BACKUP,
2856: inputTransactions[1]),
2857: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2858: inputTransactions[0]),
2859: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2860: inputTransactions[1]) };
2861:
2862: scrub(inputTransactions);
2863: assertOriginEntries(4, outputTransactions);
2864: }
2865:
2866: /**
2867: * Tests that the scrubber considers invalid fiscal periods to be errors
2868: *
2869: * @throws Exception thrown if any exception is encountered for any reason
2870: */
2871: public void testInvalidFiscalPeriod() throws Exception {
2872: String[] inputTransactions = {
2873: "2007BL1031497-----4190---ACEX14GEC 01INVALPER 00000THOMAS BUSEY/NEWEGG COMPUTERS 40.72C2006-01-05 ---------- ",
2874: "2007BL1031497-----8000---ACASXXGEC 01INVALPER 00000TP Generated Offset 40.72D2006-01-05 ---------- " };
2875:
2876: EntryHolder[] outputTransactions = {
2877: new EntryHolder(OriginEntrySource.BACKUP,
2878: inputTransactions[0]),
2879: new EntryHolder(OriginEntrySource.BACKUP,
2880: inputTransactions[1]),
2881: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2882: inputTransactions[0]),
2883: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2884: inputTransactions[1]) };
2885:
2886: scrub(inputTransactions);
2887: assertOriginEntries(4, outputTransactions);
2888: }
2889:
2890: /**
2891: * Tests that the scrubber considers closed fiscal periods to be errors
2892: *
2893: * @throws Exception thrown if any exception is encountered for any reason
2894: */
2895: public void testClosedFiscalPeriod() throws Exception {
2896: String[] inputTransactions = {
2897: "2003BA9120656-----4035---ACEX01CR 01CLOSEPER 00000pymts recd 12/28/05 25.15C2006-01-05 ---------- ",
2898: "2003BA9120656-----8000---ACAS01CR 01CLOSEPER 00000TP Generated Offset 25.15D2006-01-05 ---------- " };
2899:
2900: EntryHolder[] outputTransactions = {
2901: new EntryHolder(OriginEntrySource.BACKUP,
2902: inputTransactions[0]),
2903: new EntryHolder(OriginEntrySource.BACKUP,
2904: inputTransactions[1]),
2905: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2906: inputTransactions[0]),
2907: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2908: inputTransactions[1]) };
2909:
2910: scrub(inputTransactions);
2911: assertOriginEntries(4, outputTransactions);
2912: }
2913:
2914: /**
2915: * Tests that the scrubber considers invalid object type codes to be errors
2916: *
2917: * @throws Exception thrown if any exception is encountered for any reason
2918: */
2919: public void testInvalidObjectType() throws Exception {
2920: String[] inputTransactions = {
2921: "2007BL1031400-----4100---ACXX07PO LGINVALOBTY 00000Rite Quality Office Supplies Inc. 43.42D2006-01-05 ---------- ",
2922: "2007BL1031400-----9892---ACFB07PO LGINVALOBTY 00000Rite Quality Office Supplies Inc. 43.42C2006-01-05 ---------- " };
2923:
2924: EntryHolder[] outputTransactions = {
2925: new EntryHolder(OriginEntrySource.BACKUP,
2926: inputTransactions[0]),
2927: new EntryHolder(OriginEntrySource.BACKUP,
2928: inputTransactions[1]),
2929: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2930: inputTransactions[0]),
2931: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2932: inputTransactions[1]) };
2933:
2934: scrub(inputTransactions);
2935: assertOriginEntries(4, outputTransactions);
2936: }
2937:
2938: /**
2939: * Tests that the scrubber considers invalid balance type codes to be errors
2940: *
2941: * @throws Exception thrown if any exception is encountered for any reason
2942: */
2943: public void testInvalidBalanceType() throws Exception {
2944:
2945: String[] inputTransactions = {
2946: "2007BL1031420-----4110---XXEX07DI EUINVALBALT 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
2947: "2007BL1031420-----8000---ACAS07DI EUINVALBALT 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
2948:
2949: EntryHolder[] outputTransactions = {
2950: new EntryHolder(OriginEntrySource.BACKUP,
2951: inputTransactions[0]),
2952: new EntryHolder(OriginEntrySource.BACKUP,
2953: inputTransactions[1]),
2954: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2955: inputTransactions[1]),
2956: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
2957: inputTransactions[0]) };
2958:
2959: scrub(inputTransactions);
2960: assertOriginEntries(4, outputTransactions);
2961: }
2962:
2963: /**
2964: * Tests that the scrubber considers invalid financial object codes to be errors
2965: *
2966: * @throws Exception thrown if any exception is encountered for any reason
2967: */
2968: public void testInvalidObjectCode() throws Exception {
2969: String[] inputTransactions = {
2970: "2007BL2231423-----XXXX---ACIN CR PLINVALOBJ 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- ",
2971: "2007BL2231423-----8000---ACAS CR PLINVALOBJ 00000TP Generated Offset 45995.84D2006-01-05 ---------- " };
2972:
2973: EntryHolder[] outputTransactions = {
2974: new EntryHolder(OriginEntrySource.BACKUP,
2975: inputTransactions[0]),
2976: new EntryHolder(OriginEntrySource.BACKUP,
2977: inputTransactions[1]),
2978: new EntryHolder(
2979: OriginEntrySource.SCRUBBER_ERROR,
2980: "2006BL2231423-----8000---ACAS07CR PLINVALOBJ 00000TP Generated Offset 45995.84D2006-01-05 ---------- "),
2981: new EntryHolder(
2982: OriginEntrySource.SCRUBBER_ERROR,
2983: "2007BL2231423-----XXXX---ACIN CR PLINVALOBJ 00000FRICKA FRACKA 45995.84C2006-01-05 ---------- ") };
2984:
2985: scrub(inputTransactions);
2986: assertOriginEntries(4, outputTransactions);
2987: }
2988:
2989: /**
2990: * Tests that the scrubber considers entries with invalid sub accounts to be errors
2991: *
2992: * @throws Exception thrown if any exception is encountered for any reason
2993: */
2994: public void testInvalidSubAccountNumber() throws Exception {
2995: String[] inputTransactions = {
2996: "2007BL2231408XXXX 4035---ACEX07SB 01INVALSACT 00000Biology Stockroom 13.77D2006-01-05 ---------- ",
2997: "2007BL2231408XXXX 8000---ACAS07SB 01INVALSACT 00000TP Generated Offset 13.77C2006-01-05 ---------- " };
2998:
2999: EntryHolder[] outputTransactions = {
3000: new EntryHolder(OriginEntrySource.BACKUP,
3001: inputTransactions[0]),
3002: new EntryHolder(OriginEntrySource.BACKUP,
3003: inputTransactions[1]),
3004: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3005: inputTransactions[0]),
3006: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3007: inputTransactions[1]) };
3008:
3009: scrub(inputTransactions);
3010: assertOriginEntries(4, outputTransactions);
3011: }
3012:
3013: /**
3014: * Tests that the scrubber considers entries with inactive sub accounts to be errors
3015: *
3016: * @throws Exception thrown if any exception is encountered for any reason
3017: */
3018: public void testInactiveSubAccountNumber() throws Exception {
3019: String[] inputTransactions = {
3020: "2007BA6044900ARREC8000---ACAS07IB 01INACTSACT 00000TP Generated Offset 1650.00C2006-01-05 ---------- ",
3021: "2007BL6044900ARREC4866---ACEX07IB 01INACTSACT 00000Correction to: 01-PU3355206 1650.00D2006-01-05 ---------- " };
3022:
3023: EntryHolder[] outputTransactions = {
3024: new EntryHolder(OriginEntrySource.BACKUP,
3025: inputTransactions[0]),
3026: new EntryHolder(OriginEntrySource.BACKUP,
3027: inputTransactions[1]),
3028: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3029: inputTransactions[0]),
3030: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3031: inputTransactions[1]) };
3032:
3033: scrub(inputTransactions);
3034: assertOriginEntries(4, outputTransactions);
3035: }
3036:
3037: /**
3038: * Tests that the scrubber considers invalid account numbers to be errors
3039: *
3040: * @throws Exception thrown if any exception is encountered for any reason
3041: */
3042: public void testInvalidAccountNumber() throws Exception {
3043: String[] inputTransactions = {
3044: "2007EA1234567-----4035---ACEX07CR 01INVALACCT 00000pymts recd 12/28/05 25.15C2006-01-05 ---------- ",
3045: "2007EA1234567-----8000---ACAS07CR 01INVALACCT 00000TP Generated Offset 25.15D2006-01-05 ---------- " };
3046:
3047: EntryHolder[] outputTransactions = {
3048: new EntryHolder(OriginEntrySource.BACKUP,
3049: inputTransactions[0]),
3050: new EntryHolder(OriginEntrySource.BACKUP,
3051: inputTransactions[1]),
3052: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3053: inputTransactions[0]),
3054: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3055: inputTransactions[1]) };
3056:
3057: scrub(inputTransactions);
3058: assertOriginEntries(4, outputTransactions);
3059: }
3060:
3061: /**
3062: * Tests that the scrubber considers blank account numbers to be errors
3063: *
3064: * @throws Exception thrown if any exception is encountered for any reason
3065: */
3066: public void testBlankAccountNumber() throws Exception {
3067: String[] inputTransactions = {
3068: "2007IN -----5000---ACEX07PO LGBLANKACCT 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00D2006-01-05 ---------- ",
3069: "2007IN -----9041---ACLI07PO LGBLANKACCT 00000225050007 WILLIAMS DOTSON ASSOCIATES IN 1200.00C2006-01-05 ---------- " };
3070:
3071: EntryHolder[] outputTransactions = {
3072: new EntryHolder(OriginEntrySource.BACKUP,
3073: inputTransactions[0]),
3074: new EntryHolder(OriginEntrySource.BACKUP,
3075: inputTransactions[1]),
3076: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3077: inputTransactions[0]),
3078: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3079: inputTransactions[1]) };
3080:
3081: scrub(inputTransactions);
3082: assertOriginEntries(4, outputTransactions);
3083: }
3084:
3085: /**
3086: * Tests that the scrubber considers invalid charts to be errors
3087: * @throws Exception thrown if any exception is encountered for any reason
3088: */
3089: public void testInvalidChart() throws Exception {
3090: String[] inputTransactions = {
3091: "2007XX1031420-----4110---ACEX07DI EUINVALCHAR 00000NOV-05 IMU Business Office 2224 241.75D2005-11-30 ---------- ",
3092: "2007XX1031420-----8000---ACAS07DI EUINVALCHAR 00000NOV-05 IMU Business Office 2237 241.75C2005-11-30 ---------- " };
3093:
3094: EntryHolder[] outputTransactions = {
3095: new EntryHolder(OriginEntrySource.BACKUP,
3096: inputTransactions[0]),
3097: new EntryHolder(OriginEntrySource.BACKUP,
3098: inputTransactions[1]),
3099: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3100: inputTransactions[0]),
3101: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3102: inputTransactions[1]) };
3103:
3104: scrub(inputTransactions);
3105: assertOriginEntries(4, outputTransactions);
3106: }
3107:
3108: /**
3109: * Tests that the scrubber considers invalid fiscal years to be errors. Note: this test will malfunction sometime in the year 2019
3110: *
3111: * @throws Exception thrown if any exception is encountered for any reason
3112: */
3113: public void testInvalidFiscalYear() throws Exception {
3114: String[] inputTransactions = {
3115: "2020BA6044913-----1470---ACIN07CR 01INVALFISC 00000Poplars Garage Fees 20.00C2006-01-05 ---------- ",
3116: "2020BA6044913-----8000---ACAS07CR 01INVALFISC 00000TP Generated Offset 20.00D2006-01-05 ---------- " };
3117:
3118: EntryHolder[] outputTransactions = {
3119: new EntryHolder(OriginEntrySource.BACKUP,
3120: inputTransactions[0]),
3121: new EntryHolder(OriginEntrySource.BACKUP,
3122: inputTransactions[1]),
3123: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3124: inputTransactions[0]),
3125: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3126: inputTransactions[1]) };
3127:
3128: scrub(inputTransactions);
3129: assertOriginEntries(4, outputTransactions);
3130: }
3131:
3132: /**
3133: * Entry with a closed fiscal period/year. These transactions should be marked as errors.
3134: *
3135: * @throws Exception thrown if any exception is encountered for any reason
3136: */
3137: public void testClosedFiscalYear() throws Exception {
3138: String[] inputTransactions = {
3139: "2003BA6044906-----4100---ACEX07TOPSLGCLOSEFISC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ",
3140: "2003BA6044906-----9041---ACLI07TOPSLGCLOSEFISC 00000CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- " };
3141:
3142: EntryHolder[] outputTransactions = {
3143: new EntryHolder(OriginEntrySource.BACKUP,
3144: inputTransactions[0]),
3145: new EntryHolder(OriginEntrySource.BACKUP,
3146: inputTransactions[1]),
3147: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3148: inputTransactions[0]),
3149: new EntryHolder(OriginEntrySource.SCRUBBER_ERROR,
3150: inputTransactions[1]) };
3151:
3152: scrub(inputTransactions);
3153: assertOriginEntries(4, outputTransactions);
3154:
3155: }
3156:
3157: /**
3158: * Entry with a null fiscal year. The fiscal year should be replaced with the default fiscal year. They should not be errors.
3159: *
3160: * @throws Exception thrown if any exception is encountered for any reason
3161: */
3162: public void testDefaultFiscalYear() throws Exception {
3163:
3164: String[] inputTransactions = {
3165: " BA6044900-----5300---ACEE07CHKDPDBLANKFISC 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 ",
3166: " BA6044900-----8000---ACAS07CHKDPDBLANKFISC 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345678 " };
3167:
3168: EntryHolder[] outputTransactions = {
3169: new EntryHolder(OriginEntrySource.BACKUP,
3170: inputTransactions[0]),
3171: new EntryHolder(OriginEntrySource.BACKUP,
3172: inputTransactions[1]),
3173: new EntryHolder(
3174: OriginEntrySource.SCRUBBER_VALID,
3175: "2006BA6044900-----5300---ACEE07CHKDPDBLANKFISC 12345214090047 EVERETT J PRESCOTT INC. 1445.00D2006-01-05ABCDEFGHIJ----------12345678 "),
3176: new EntryHolder(
3177: OriginEntrySource.SCRUBBER_VALID,
3178: "2006BA6044900-----8000---ACAS07CHKDPDBLANKFISC 12345214090047 EVERETT J PRESCOTT INC. 1445.00C2006-01-05ABCDEFGHIG----------12345678 ") };
3179:
3180: scrub(inputTransactions);
3181: assertOriginEntries(4, outputTransactions);
3182: }
3183:
3184: /**
3185: * Loads an array of String-formatted entries into the database, and then runs the scrubber on those entries
3186: *
3187: * @param inputTransactions an array of String-formatted entries to scrub
3188: */
3189: private void scrub(String[] inputTransactions) {
3190: clearOriginEntryTables();
3191: loadInputTransactions(OriginEntrySource.BACKUP,
3192: inputTransactions, date);
3193: persistenceService.clearCache();
3194: scrubberService.scrubEntries();
3195: }
3196: }
|