Search in sources :

Example 1 with OneClickImporterServiceImpl

use of org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl in project molgenis by molgenis.

the class OneClickImporterServiceTest method beforeClass.

@BeforeClass
public void beforeClass() {
    initMocks(this);
    oneClickImporterService = new OneClickImporterServiceImpl();
}
Also used : OneClickImporterServiceImpl(org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with OneClickImporterServiceImpl

use of org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl in project molgenis by molgenis.

the class OneClickImporterServiceTest method testBuildDataCollectionWithComplexValidCsvFile.

@Test
public void testBuildDataCollectionWithComplexValidCsvFile() throws IOException, URISyntaxException {
    oneClickImporterService = new OneClickImporterServiceImpl();
    List<String[]> lines = loadLinesFromFile(OneClickImporterServiceTest.class, "/complex-valid.csv");
    DataCollection actual = oneClickImporterService.buildDataCollectionFromCsv("complex-valid", lines);
    Column c1 = Column.create("first name", 0, newArrayList("Mark", "Fleur", "Dennis", "Bart", "Sido", "Mariska", "Tommy", "Connor", "Piet", "Jan"));
    Column c2 = Column.create("last name", 1, newArrayList("de Haan", "Kelpin", "Hendriksen", "Charbon", "Haakma", "Slofstra", "de Boer", "Stroomberg", "Klaassen", null));
    Column c3 = Column.create("full name", 2, newArrayList("Mark de Haan", "Fleur Kelpin", "Dennis Hendriksen", "Bart Charbon", "Sido Haakma", "Mariska Slofstra", "Tommy de Boer", "Connor Stroomberg", "Piet Klaassen", null));
    Column c4 = Column.create("UMCG employee", 3, newArrayList(true, true, true, true, true, true, true, true, false, false));
    Column c5 = Column.create("Age", 4, newArrayList(26.4f, null, null, null, null, 22, 27, null, 53, 0.123f));
    DataCollection expected = DataCollection.create("complex-valid", newArrayList(c1, c2, c3, c4, c5));
    assertEquals(actual, expected);
}
Also used : DataCollection(org.molgenis.oneclickimporter.model.DataCollection) Column(org.molgenis.oneclickimporter.model.Column) OneClickImporterServiceImpl(org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl) Test(org.testng.annotations.Test)

Example 3 with OneClickImporterServiceImpl

use of org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl in project molgenis by molgenis.

the class OneClickImporterServiceTest method testBuildDataCollectionWithSimpleValidCsvFile.

@Test
public void testBuildDataCollectionWithSimpleValidCsvFile() throws IOException, URISyntaxException {
    oneClickImporterService = new OneClickImporterServiceImpl();
    List<String[]> lines = loadLinesFromFile(OneClickImporterServiceTest.class, "/simple-valid.csv");
    DataCollection actual = oneClickImporterService.buildDataCollectionFromCsv("simple-valid", lines);
    Column c1 = Column.create("name", 0, newArrayList("Mark", "Connor", "Fleur", "Dennis"));
    Column c2 = Column.create("superpower", 1, newArrayList("arrow functions", "Oldschool syntax", "Lambda Magician", "Root access"));
    DataCollection expected = DataCollection.create("simple-valid", newArrayList(c1, c2));
    assertEquals(actual, expected);
}
Also used : DataCollection(org.molgenis.oneclickimporter.model.DataCollection) Column(org.molgenis.oneclickimporter.model.Column) OneClickImporterServiceImpl(org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl) Test(org.testng.annotations.Test)

Aggregations

OneClickImporterServiceImpl (org.molgenis.oneclickimporter.service.impl.OneClickImporterServiceImpl)3 Column (org.molgenis.oneclickimporter.model.Column)2 DataCollection (org.molgenis.oneclickimporter.model.DataCollection)2 Test (org.testng.annotations.Test)2 BeforeClass (org.testng.annotations.BeforeClass)1