use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class DetectLastRowStepIT method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6") };
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 DetectLastRowStepIT method createResultRowMetaInterface.
public RowMetaInterface createResultRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("field1"), new ValueMetaInteger("field2"), new ValueMetaNumber("field3"), new ValueMetaBoolean("field5"), new ValueMetaBigNumber("field6"), new ValueMetaBoolean("result") };
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 Formula2IT method testIsBlank_EmptyStringIsNotNull.
@Test
public void testIsBlank_EmptyStringIsNotNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull(true);
final String fIsBlank = "ISBLANK([" + KEY_ARG + "])";
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "1" }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "a" }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { null }, true);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "" }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { " " }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 1 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 0 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { -1.0 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { null }, true);
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class Formula2IT method testIsBlank_EmptyStringIsNull.
@Test
public void testIsBlank_EmptyStringIsNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull(false);
final String fIsBlank = "ISBLANK([" + KEY_ARG + "])";
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "1" }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "a" }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { null }, true);
// assertBooleanFormula( fIsBlank, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, true ); //
// TODO: Is it correct?
//
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "" }, false);
// TODO: Is it correct?
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { " " }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 1 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 0 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { -1.0 }, false);
assertBooleanFormula(fIsBlank, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { null }, true);
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class Formula2IT method testIsText_EmptyStringIsNull.
@Test
public void testIsText_EmptyStringIsNull() throws KettleException {
FieldAccessorUtl.ensureEmptyStringIsNotNull(false);
final String fIsText = "ISTEXT([" + KEY_ARG + "])";
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "1" }, true);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "a" }, true);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { null }, false);
// assertBooleanFormula( fIsText, buildRowMeta( new ValueMetaString( KEY_ARG ) ), new Object[] { "" }, false ); //
// TODO: Is it correct?
//
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { "" }, true);
// TODO: Is it correct?
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaString(KEY_ARG)), new Object[] { " " }, true);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 1 }, false);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { 0 }, false);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { -1.0 }, false);
assertBooleanFormula(fIsText, buildRowMeta(new ValueMetaNumber(KEY_ARG)), new Object[] { null }, false);
}
Aggregations