Search in sources :

Example 11 with FlatFilePrefixObjectSpecification

use of org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionOpenItemReference.

@Test
public void testParseLineIntoObjectAchIncomeFileTransactionOpenItemReference() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "type");
    setFlatFileProperty(parseProperties, 2, "invoiceNumber");
    setFlatFileProperty(parseProperties, 4, "netAmount", KualiDecimalFormatter.class);
    setFlatFileProperty(parseProperties, 5, "invoiceAmount", KualiDecimalFormatter.class);
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransactionOpenItemReference achIncomeFileTransactionOpenItemReference = new AchIncomeFileTransactionOpenItemReference();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, RMR_LINE, achIncomeFileTransactionOpenItemReference, 1);
    assertEquals("IV", achIncomeFileTransactionOpenItemReference.getType());
    assertEquals("20", achIncomeFileTransactionOpenItemReference.getInvoiceNumber());
    assertEquals(new KualiDecimal("3131.04"), achIncomeFileTransactionOpenItemReference.getNetAmount());
    assertEquals(new KualiDecimal("2424.65"), achIncomeFileTransactionOpenItemReference.getInvoiceAmount());
}
Also used : AchIncomeFileTransactionOpenItemReference(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference) FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Example 12 with FlatFilePrefixObjectSpecification

use of org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileGroupTrailer.

@Test
public void testParseLineIntoObjectAchIncomeFileGroupTrailer() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "totalTransactionSets", IntegerFormatter.class);
    setFlatFileProperty(parseProperties, 2, "groupControlNumber");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileGroupTrailer achIncomeFileGroupTrailer = new AchIncomeFileGroupTrailer();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, GE_LINE, achIncomeFileGroupTrailer, 1);
    assertEquals(1, achIncomeFileGroupTrailer.getTotalTransactionSets());
    assertEquals("092016170", achIncomeFileGroupTrailer.getGroupControlNumber());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) AchIncomeFileGroupTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Example 13 with FlatFilePrefixObjectSpecification

use of org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTrailer.

@Test
public void testParseLineIntoObjectAchIncomeFileTrailer() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "totalGroups", IntegerFormatter.class);
    setFlatFileProperty(parseProperties, 2, "interchangeControlNumber");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTrailer achIncomeFileTrailer = new AchIncomeFileTrailer();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, IEA_LINE, achIncomeFileTrailer, 1);
    assertEquals(1, achIncomeFileTrailer.getTotalGroups());
    assertEquals("092016170", achIncomeFileTrailer.getInterchangeControlNumber());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) AchIncomeFileTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer) ArrayList(java.util.ArrayList) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Example 14 with FlatFilePrefixObjectSpecification

use of org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionTrace.

@Test
public void testParseLineIntoObjectAchIncomeFileTransactionTrace() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 2, "traceNumber");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransactionTrace achIncomeFileTransactionTrace = new AchIncomeFileTransactionTrace();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, TRN_LINE, achIncomeFileTransactionTrace, 1);
    assertEquals("041036009100170", achIncomeFileTransactionTrace.getTraceNumber());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AchIncomeFileTransactionTrace(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionTrace) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Example 15 with FlatFilePrefixObjectSpecification

use of org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionDateTime.

@Test
public void testParseLineIntoObjectAchIncomeFileTransactionDateTime() throws Exception {
    AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
    List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
    setFlatFileProperty(parseProperties, 1, "type");
    setFlatFileProperty(parseProperties, 2, "dateTime");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransactionDateTime achIncomeFileTransactionDateTime = new AchIncomeFileTransactionDateTime();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, DTM_LINE, achIncomeFileTransactionDateTime, 1);
    assertEquals("097", achIncomeFileTransactionDateTime.getType());
    assertEquals("20160222", achIncomeFileTransactionDateTime.getDateTime());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AchIncomeFileTransactionDateTime(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)16 AbstractFlatFileObjectSpecification (org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification)16 DelimitedFlatFilePropertySpecification (org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification)16 FlatFilePrefixObjectSpecification (org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification)16 FlatFilePropertySpecification (org.kuali.kfs.sys.batch.FlatFilePropertySpecification)16 Test (org.junit.Test)15 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)3 AchIncomeFileTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction)2 AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)1 AchIncomeFileGroup (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup)1 AchIncomeFileGroupTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer)1 AchIncomeFileTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer)1 AchIncomeFileTransactionDateTime (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime)1 AchIncomeFileTransactionNote (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionNote)1 AchIncomeFileTransactionOpenItemReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference)1 AchIncomeFileTransactionPayerOrPayeeName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)1 AchIncomeFileTransactionPremiumPayersAdminsContact (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPremiumPayersAdminsContact)1 AchIncomeFileTransactionPremiumReceiverName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPremiumReceiverName)1 AchIncomeFileTransactionReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference)1 AchIncomeFileTransactionSet (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet)1