Search in sources :

Example 1 with TupleGenerator

use of org.apache.apex.malhar.contrib.util.TupleGenerator in project apex-malhar by apache.

the class MemcachePOJOOperatorTest method testMemcacheOutputOperatorInternal.

@SuppressWarnings("unchecked")
@Test
public void testMemcacheOutputOperatorInternal() throws Exception {
    MemcachePOJOOutputOperator operator = new MemcachePOJOOutputOperator();
    operator.setStore(store);
    TableInfo tableInfo = new TableInfo();
    tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
    tableInfo.setFieldsInfo(TestPOJO.getFieldsInfo());
    tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
    operator.setTableInfo(tableInfo);
    operator.setup(null);
    TupleGenerator<TestPOJO> generator = new TupleGenerator<TestPOJO>(TestPOJO.class);
    for (int i = 0; i < TUPLE_SIZE; ++i) {
        operator.processTuple(generator.getNextTuple());
    }
    readDataAndVerify(operator.getStore(), generator);
}
Also used : TupleGenerator(org.apache.apex.malhar.contrib.util.TupleGenerator) TableInfo(org.apache.apex.malhar.lib.util.TableInfo) TestPOJO(org.apache.apex.malhar.contrib.util.TestPOJO) Test(org.junit.Test)

Example 2 with TupleGenerator

use of org.apache.apex.malhar.contrib.util.TupleGenerator in project apex-malhar by apache.

the class GeodePOJOOperatorTest method testGeodeOutputOperatorInternal.

@SuppressWarnings("unchecked")
@Test
public void testGeodeOutputOperatorInternal() throws Exception {
    GeodePOJOOutputOperator operator = new GeodePOJOOutputOperator();
    operator.setStore(store);
    TableInfo tableInfo = new TableInfo();
    tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
    tableInfo.setFieldsInfo(TestPOJO.getFieldsInfo());
    tableInfo.setRowOrIdExpression(TestPOJO.getRowExpression());
    operator.setTableInfo(tableInfo);
    operator.setup(null);
    TupleGenerator<TestPOJO> generator = new TupleGenerator<TestPOJO>(TestPOJO.class);
    for (int i = 0; i < TUPLE_SIZE; ++i) {
        operator.processTuple(generator.getNextTuple());
    }
    generator.reset();
    for (int i = 0; i < TUPLE_SIZE; ++i) {
        operator.processTuple(generator.getNextTuple());
    }
// readDataAndVerify(operator.getStore(), generator);
}
Also used : TupleGenerator(org.apache.apex.malhar.contrib.util.TupleGenerator) TableInfo(org.apache.apex.malhar.lib.util.TableInfo) TestPOJO(org.apache.apex.malhar.contrib.util.TestPOJO) Test(org.junit.Test)

Aggregations

TestPOJO (org.apache.apex.malhar.contrib.util.TestPOJO)2 TupleGenerator (org.apache.apex.malhar.contrib.util.TupleGenerator)2 TableInfo (org.apache.apex.malhar.lib.util.TableInfo)2 Test (org.junit.Test)2