ReplaceWithValueActivity activity = new ReplaceWithValueActivity();
MockInputPipe inputTuples = new MockInputPipe( new Object[] {
ControlBlock.LIST_BEGIN,
new MetadataWrapper(metadata),
new SimpleTuple(Arrays.asList(new Object[] {1, 2, "A"})),
new SimpleTuple(Arrays.asList(new Object[] {2, 3, "B"})),
new SimpleTuple(Arrays.asList(new Object[] {3, 4, "C"})),
ControlBlock.LIST_END
});
activity.addInput("data", inputTuples);
cdlist = new ArrayList<ColumnMetadata>();
cdlist.add(new SimpleColumnMetadata("X", TupleTypes._INT, 0, 0, 11));
cdlist.add(new SimpleColumnMetadata("Y", TupleTypes._STRING, 0, 0, 11));
cdlist.add(new SimpleColumnMetadata("S", TupleTypes._STRING, 0, 0, 11));
metadata = new SimpleTupleMetadata(cdlist);
MockInputPipe inputValues = new MockInputPipe( new Object[] {
ControlBlock.LIST_BEGIN,
new MetadataWrapper(metadata),
new SimpleTuple(Arrays.asList(new Object[] {1, 2, 3} )),
new SimpleTuple(Arrays.asList(new Object[] {1, 2, 3} )),
ControlBlock.LIST_END
});
activity.addInput("values", inputValues);
MockInputPipe inputColumns = new MockInputPipe( new Object[] {