Examples of StringRecord


Examples of org.easybatch.core.util.StringRecord

    @Before
    public void setUp() throws Exception {
        int[] fieldsLength = {4, 2, 3};
        fixedLengthRecordMapper = new FixedLengthRecordMapper<Bean>(Bean.class, fieldsLength,
                new String[]{"field1", "field2", "field3"});
        stringRecord = new StringRecord(1, "aaaabbccc");
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

        stringRecord = new StringRecord(1, "aaaabbccc");
    }

    @Test (expected = Exception.class)
    public void testRecordWellFormednessKO() throws Exception {
        stringRecord = new StringRecord(1, "aaaabbcccd"); // unexpected record size
        fixedLengthRecordMapper.parseRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    @Before
    public void setUp() throws Exception {
        delimitedRecordMapper = new DelimitedRecordMapper<Person>(Person.class,
                new String[]{"firstName", "lastName", "age", "birthDate", "married"});
        stringRecord = new StringRecord(1, "foo,bar,30,1990-12-12,true");
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

        stringRecord = new StringRecord(1, "foo,bar,30,1990-12-12,true");
    }

    @Test(expected = Exception.class)
    public void testRecordWellFormednessKO() throws Exception {
        stringRecord = new StringRecord(1, "foo,bar,30,1990-12-12");// incorrect record size
        delimitedRecordMapper.parseRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }


    @Test
    public void testRecordSizeWithEmptyField() throws Exception {
        stringRecord = new StringRecord(1, "foo,bar,30,1990-12-12,");
        FlatFileRecord flatFileRecord = delimitedRecordMapper.parseRecord(stringRecord);
        assertEquals("", flatFileRecord.getFlatFileFields().get(4).getRawContent());
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }

    @Test
    public void testRecordParsingWithTrimmedWhitespaces() throws Exception {
        delimitedRecordMapper.setTrimWhitespaces(true);
        stringRecord = new StringRecord(1, "  foo ,    bar  ,  30  ,     1990-12-12  ,  true         ");
        validateRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }

    @Test
    public void testRecordParsingWithPipeDelimiter() throws Exception {
        delimitedRecordMapper.setDelimiter("|");
        stringRecord = new StringRecord(1, "foo|bar|30|1990-12-12|true");
        validateRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }

    @Test
    public void testRecordParsingWithSpaceDelimiter() throws Exception {
        delimitedRecordMapper.setDelimiter(" ");
        stringRecord = new StringRecord(1, "foo bar 30 1990-12-12 true");
        validateRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }

    @Test
    public void testRecordParsingWithTabDelimiter() throws Exception {
        delimitedRecordMapper.setDelimiter("\t");
        stringRecord = new StringRecord(1, "foo\tbar\t30\t1990-12-12\ttrue");
        validateRecord(stringRecord);
    }
View Full Code Here

Examples of org.easybatch.core.util.StringRecord

    }

    @Test
    public void testRecordParsingWithMultipleCharacterDelimiter() throws Exception {
        delimitedRecordMapper.setDelimiter("###");
        stringRecord = new StringRecord(1, "foo###bar###30###1990-12-12###true");
        validateRecord(stringRecord);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.