use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class CheckSumTest method testHexOutput_md5_compatibilityMode_oldChecksumBehaviourMode.
@Test
public void testHexOutput_md5_compatibilityMode_oldChecksumBehaviourMode() throws Exception {
MockRowListener results = executeHexTest(2, true, "xyz", new ValueMetaString("test"), true);
assertEquals(1, results.getWritten().size());
assertEquals("FD6FFD6F0911FD78FDFD1361FDFD705E", results.getWritten().get(0)[1]);
results = executeHexTest(2, true, 10.8, new ValueMetaNumber("test"), true);
assertEquals(1, results.getWritten().size());
assertEquals("372DFDFD33FD1BFDFD6D225361FD7EFD", results.getWritten().get(0)[1]);
results = executeHexTest(2, true, 10.82, new ValueMetaNumber("test"), true);
assertEquals(1, results.getWritten().size());
assertEquals("68FD42FD7143FD17FD17FDFD715957", results.getWritten().get(0)[1]);
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class SpeedTest method populateMetaAndData.
private static void populateMetaAndData(int i, Object[] rowString10, RowMetaInterface metaString10, Object[] rowMixed10, RowMetaInterface metaMixed10) {
rowString10[i] = StringUtil.generateRandomString(20, "", "", false);
ValueMetaInterface meta = new ValueMetaString("String" + (i + 1), 20, 0);
metaString10.addValueMeta(meta);
rowMixed10[i * 5 + 0] = StringUtil.generateRandomString(20, "", "", false);
ValueMetaInterface meta0 = new ValueMetaString("String" + (i * 5 + 1), 20, 0);
metaMixed10.addValueMeta(meta0);
rowMixed10[i * 5 + 1] = new Date();
ValueMetaInterface meta1 = new ValueMetaDate("String" + (i * 5 + 1));
metaMixed10.addValueMeta(meta1);
rowMixed10[i * 5 + 2] = new Double(Math.random() * 1000000);
ValueMetaInterface meta2 = new ValueMetaNumber("String" + (i * 5 + 1), 12, 4);
metaMixed10.addValueMeta(meta2);
rowMixed10[i * 5 + 3] = new Long((long) (Math.random() * 1000000));
ValueMetaInterface meta3 = new ValueMetaInteger("String" + (i * 5 + 1), 8, 0);
metaMixed10.addValueMeta(meta3);
rowMixed10[i * 5 + 4] = Boolean.valueOf(Math.random() > 0.5 ? true : false);
ValueMetaInterface meta4 = new ValueMetaBoolean("String" + (i * 5 + 1));
metaMixed10.addValueMeta(meta4);
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class InjectorIT 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 MemoryGroupByIntIT method getTestRowMeta.
RowMetaInterface getTestRowMeta() {
RowMetaInterface rm = new RowMeta();
rm.addValueMeta(new ValueMetaString(KEY1));
rm.addValueMeta(new ValueMetaInteger(KEY2));
rm.addValueMeta(new ValueMetaNumber(KEY3));
rm.addValueMeta(new ValueMetaBigNumber(KEY4));
return rm;
}
use of org.pentaho.di.core.row.value.ValueMetaNumber in project pentaho-kettle by pentaho.
the class JavaScriptStringIT method createRowMetaInterfaceResult3.
/**
* Create the meta data for the results (isnum/num2str/str2num).
*/
public RowMetaInterface createRowMetaInterfaceResult3() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaString("string"), new ValueMetaNumber("numb1"), new ValueMetaBoolean("bool1"), new ValueMetaString("str1") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
Aggregations