use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class FunctionScriptLoaderTest method rowTransfomerLoadingAndExecution.
@Test
public void rowTransfomerLoadingAndExecution() throws Exception {
Row input = new Row();
input.addColumn(-1, "chief", "duke");
RowTransformer function = this.cut.getRowTransformer("noop");
assertNotNull(function);
Row transformedEntries = function.execute(input);
assertThat(transformedEntries, is(input));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class FunctionScriptLoaderTest method nullInputIsIgnored.
@Test
public void nullInputIsIgnored() {
RowTransformer rowTransformer = this.cut.getRowTransformer("does-not-matter");
Row output = rowTransformer.execute(null);
assertNull(output);
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class FunctionScriptLoaderTest method counterIsWorking.
@Test
public void counterIsWorking() {
Row input = new Row();
input.useMemory(new Memory());
final String inputValue = "duke";
input.addColumn(-1, "name", inputValue);
RowTransformer function = this.cut.getRowTransformer("count");
Row output = function.execute(input);
assertNotNull(output);
Memory memory = output.getMemory();
assertNotNull(memory);
assertThat(memory.counterValue(), is(1l));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class FunctionScriptLoaderTest method propertyIsStoredInMemory.
@Test
public void propertyIsStoredInMemory() {
Row input = new Row();
input.useMemory(new Memory());
final String inputValue = "duke";
input.addColumn(-1, "name", inputValue);
RowTransformer function = this.cut.getRowTransformer("store");
Row output = function.execute(input);
Memory memory = output.getMemory();
assertThat(memory.get("from"), is("script"));
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class IndexMapperTest method setUp.
@Before
public void setUp() {
row = new Row();
row.addColumn(-1, "height", "tall");
row.addColumn(-1, "age", "20");
row.addColumn(-1, "name", "duke");
row.addColumn(-1, "weight", "light-weight");
row.addColumn(1, "resetIndexOne", "resetIndex");
row.addColumn(2, "resetIndexTwo", "resetIndex");
}
Aggregations