Search in sources :

Example 31 with ValueMetaNumber

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]);
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) Test(org.junit.Test)

Example 32 with ValueMetaNumber

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);
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) Date(java.util.Date) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate)

Example 33 with ValueMetaNumber

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;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaDate(org.pentaho.di.core.row.value.ValueMetaDate) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Example 34 with ValueMetaNumber

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;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) ValueMetaBigNumber(org.pentaho.di.core.row.value.ValueMetaBigNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger)

Example 35 with ValueMetaNumber

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;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaBoolean(org.pentaho.di.core.row.value.ValueMetaBoolean) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface)

Aggregations

ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)95 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)75 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)52 Test (org.junit.Test)51 RowMeta (org.pentaho.di.core.row.RowMeta)39 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)34 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)34 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)32 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)30 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)25 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)20 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)16 ValueMetaInternetAddress (org.pentaho.di.core.row.value.ValueMetaInternetAddress)15 KettleException (org.pentaho.di.core.exception.KettleException)12 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)11 KettleStepException (org.pentaho.di.core.exception.KettleStepException)7 ArrayList (java.util.ArrayList)6 Date (java.util.Date)6 RowSet (org.pentaho.di.core.RowSet)6 RowAdapter (org.pentaho.di.trans.step.RowAdapter)6