<commit_before><commit_msg>CSV import is working<commit_after>package com.airhacks.enhydrator.scenarios;

import com.airhacks.enhydrator.Pump;
import com.airhacks.enhydrator.in.CSVSource;
import com.airhacks.enhydrator.in.Entry;
import com.airhacks.enhydrator.in.Source;
import com.airhacks.enhydrator.in.VirtualSinkSource;
import com.airhacks.enhydrator.out.LogSink;
import java.util.List;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 *
 * @author <EMAIL>
 */
public class CSVImportTest {

    /**
     * 1997;Ford;E350;2,34
     */
    @Test
    public void copy() {
        Source source = new CSVSource("./src/test/files/cars.csv", ";", true);
        VirtualSinkSource vss = new VirtualSinkSource();
        Pump pump = new Pump.Engine().
                from(source).
                to(vss).
                to(new LogSink()).
                build();
        pump.start();

        int numberOfRows = vss.getNumberOfRows();
        assertTrue(numberOfRows > 0);
        Iterable<List<Entry>> query = vss.query(null);
        boolean foundFord = false;
        for (List<Entry> list : query) {
            assertThat(list.size(), is(4));
            if ("Ford".equals(list.get(1).getValue())) {
                foundFord = true;
            }
        }
        assertTrue(foundFord);
    }

}
{'fraction_non_alphanumeric': 0.13021939136588817, 'fraction_numerical': 0.009200283085633405, 'mean_word_length': 2.491358024691358, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1222017', 'n_tokens_mistral': 471, 'n_tokens_neox': 454, 'n_words': 81}