use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class JavaScriptSpecialIT method createRowMetaInterface4.
public RowMetaInterface createRowMetaInterface4() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaInteger("int_in"), new ValueMetaNumber("number_in"), new ValueMetaString("string_in"), new ValueMetaInteger("long1"), new ValueMetaNumber("number1"), new ValueMetaString("string1"), new ValueMetaInteger("long2"), new ValueMetaNumber("number2"), new ValueMetaString("string2") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class TransSingleThreadIT method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaDate("field4"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBigNumber("field7") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class AppendIT method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaDate("field4"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBigNumber("field7") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class BlockingStepIT method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaDate("field4"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBigNumber("field7") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class CalculatorBackwardCompatibilityUnitTest method assertRoundStd.
public void assertRoundStd(final double expectedResult, final double value) throws KettleException {
RowMeta inputRowMeta = new RowMeta();
ValueMetaNumber valueMeta = new ValueMetaNumber("Value");
inputRowMeta.addValueMeta(valueMeta);
RowSet inputRowSet = smh.getMockInputRowSet(new Object[] { value });
inputRowSet.setRowMeta(inputRowMeta);
Calculator calculator = new Calculator(smh.stepMeta, smh.stepDataInterface, 0, smh.transMeta, smh.trans);
calculator.addRowSetToInputRowSets(inputRowSet);
calculator.setInputRowMeta(inputRowMeta);
calculator.init(smh.initStepMetaInterface, smh.initStepDataInterface);
CalculatorMeta meta = new CalculatorMeta();
meta.setCalculation(new CalculatorMetaFunction[] { new CalculatorMetaFunction("test", CalculatorMetaFunction.CALC_ROUND_STD_1, "Value", null, null, ValueMetaInterface.TYPE_NUMBER, 2, 0, false, "", "", "", "") });
// Verify output
try {
calculator.addRowListener(new RowAdapter() {
@Override
public void rowWrittenEvent(RowMetaInterface rowMeta, Object[] row) throws KettleStepException {
assertEquals(expectedResult, row[1]);
}
});
calculator.processRow(meta, new CalculatorData());
} catch (KettleException ke) {
ke.printStackTrace();
fail();
}
}
Aggregations