Examples of CsvLineData


Examples of org.neo4j.batchimport.importer.CsvLineData

        }
    }

    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

Examples of org.neo4j.batchimport.importer.CsvLineData

*/
public class CsvLineDataTest {

    @Test
    public void testTrailingEmptyCells() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
    @Test
    public void testLeadingAndTrailingEmptyCells() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testLeadingEmptyCells() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testEmptyRow() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

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

    @Test
    public void testLeadOneRow() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals(null,map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testLeadTwoRow() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals("2",map.get("b"));
        assertEquals(null,map.get("c"));
    }
    @Test
    public void testNormalCells() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

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

    @Test
    public void testQuotedHeader() throws Exception {
        CsvLineData rowData = new CsvLineData(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

Examples of org.neo4j.batchimport.importer.CsvLineData

        assertEquals("2",map.get("b"));
        assertEquals("3",map.get("c"));
    }
    @Test
    public void testQuotedValue() throws Exception {
        CsvLineData rowData = new CsvLineData(new StringReader("\"a\"\tb\tc\n\"1\"\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
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.