Package org.neo4j.batchimport.importer

Examples of org.neo4j.batchimport.importer.ChunkerLineData


    }

    private LineData createLineData(Reader reader, int offset) {
        final boolean useQuotes = config.quotesEnabled();
        if (useQuotes) return new CsvLineData(reader, config.getDelimChar(this),offset);
        return new ChunkerLineData(reader, config.getDelimChar(this), offset);
    }
View Full Code Here


*/
public class ChunkerRowDataTest {

    @Test
    public void testTrailingEmptyCells() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n\t2\t3"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals(null,map.get("a"));
        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
View Full Code Here

        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
    @Test
    public void testLeadingAndTrailingEmptyCells() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n\t2\t"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals(null,map.get("a"));
        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
View Full Code Here

        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testLeadingEmptyCells() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n1\t\t"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals("1",map.get("a"));
        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
View Full Code Here

        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testEmptyRow() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals(null,map.get("a"));
        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
View Full Code Here

        assertEquals(null,map.get("c"));
    }

    @Test
    public void testLeadOneRow() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n1\t"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals("1",map.get("a"));
        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
View Full Code Here

        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testLeadTwoRow() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n1\t2"), '\t', 0);

        final Map<String,Object> map = rowData.updateMap();
        assertEquals("1",map.get("a"));
        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
View Full Code Here

        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testNormalCells() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n1\t2\t3"), '\t', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals("1",map.get("a"));
        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
View Full Code Here

        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
    @Test
    public void testNormalWithCommas() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a,b,c\n1,2,3"), ',', 0);
        final Map<String,Object> map = rowData.updateMap();
        assertEquals("1",map.get("a"));
        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
View Full Code Here

        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
    @Test
    public void testNormalCellsTwoRows() throws Exception {
        ChunkerLineData rowData = new ChunkerLineData(new StringReader("a\tb\tc\n1\t2\t3\n4\t5\t6"), '\t', 0);
        final Map<String,Object> row1 = rowData.updateMap();
        assertEquals("1", row1.get("a"));
        assertEquals("2", row1.get("b"));
        assertEquals("3",row1.get("c"));
        final Map<String,Object> row2 = rowData.updateMap();
        assertEquals("4", row2.get("a"));
        assertEquals("5", row2.get("b"));
        assertEquals("6",row2.get("c"));
    }
View Full Code Here

TOP

Related Classes of org.neo4j.batchimport.importer.ChunkerLineData

Copyright © 2018 www.massapicom. 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.