Search in sources :

Example 26 with Row

use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.

the class PojoSinkTest method pojoWithRelation.

@Test
public void pojoWithRelation() {
    final String expected = "duke";
    Row parent = new Row();
    parent.addColumn(-1, "name", expected);
    final int expectedRanking = 2;
    final String expectedLanguageName = "java";
    Row programming = new Row();
    programming.addColumn(-1, "name", expectedLanguageName);
    programming.addColumn(-1, "ranking", expectedRanking);
    parent.add(programming);
    this.cut.processRow(parent);
    Developer developer = getDeveloper();
    assertNotNull(developer);
    assertThat(developer.getLanguages().size(), is(1));
    ProgrammingLanguage language = developer.getLanguages().iterator().next();
    assertThat(language.getName(), is(expectedLanguageName));
    assertThat(language.getRanking(), is(expectedRanking));
}
Also used : Row(com.airhacks.enhydrator.in.Row) Test(org.junit.Test)

Example 27 with Row

use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.

the class ScriptableSinkTest method instantiate.

@Test
public void instantiate() throws IOException {
    try (ScriptableSink sink = new ScriptableSink("./src/test/scripts/sink.js")) {
        sink.init();
        sink.processRow(new Row());
    }
}
Also used : Row(com.airhacks.enhydrator.in.Row) Test(org.junit.Test)

Example 28 with Row

use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.

the class TestRows method getStringRow.

public static Row getStringRow() {
    Row row = new Row();
    row.addColumn(0, "a", "java");
    row.addColumn(1, "b", "tengah");
    return row;
}
Also used : Row(com.airhacks.enhydrator.in.Row)

Example 29 with Row

use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.

the class TestRows method getIntRow.

public static Row getIntRow() {
    Row row = new Row();
    row.addColumn(0, "a", "1");
    row.addColumn(1, "b", "2");
    return row;
}
Also used : Row(com.airhacks.enhydrator.in.Row)

Example 30 with Row

use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.

the class CSVFileSinkTest method getEntries.

Row getEntries() {
    Row row = new Row();
    Column e = new Column(5, "Column Five (empty)", null);
    row.addColumn(e);
    row.addColumn(2, "Column Two", "tengah");
    row.addColumn(4, "Column Four", "groovy");
    row.addColumn(1, "Column One", "java");
    Column c = new Column(3, "Column Three (empty)", null);
    row.addColumn(c);
    return row;
}
Also used : Column(com.airhacks.enhydrator.in.Column) Row(com.airhacks.enhydrator.in.Row)

Aggregations

Row (com.airhacks.enhydrator.in.Row)68 Test (org.junit.Test)54 VirtualSinkSource (com.airhacks.enhydrator.in.VirtualSinkSource)10 Column (com.airhacks.enhydrator.in.Column)8 Memory (com.airhacks.enhydrator.transform.Memory)8 ArrayList (java.util.ArrayList)5 LogSink (com.airhacks.enhydrator.out.LogSink)4 HashMap (java.util.HashMap)4 PipelineTest (com.airhacks.enhydrator.flexpipe.PipelineTest)3 CSVFileSource (com.airhacks.enhydrator.in.CSVFileSource)3 Source (com.airhacks.enhydrator.in.Source)3 SkipFirstRow (com.airhacks.enhydrator.transform.SkipFirstRow)3 List (java.util.List)3 Map (java.util.Map)3 Bindings (javax.script.Bindings)3 Pump (com.airhacks.enhydrator.Pump)2 NamedSink (com.airhacks.enhydrator.out.NamedSink)2 RowTransformer (com.airhacks.enhydrator.transform.RowTransformer)2 Date (java.util.Date)2 Function (java.util.function.Function)2