Search in sources :

Example 1 with ValueMetaString

use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.

the class JmsDelegate method getRowMeta.

/**
 * Creates a rowMeta for output field names
 */
RowMetaInterface getRowMeta() {
    RowMeta rowMeta = new RowMeta();
    rowMeta.addValueMeta(new ValueMetaString(messageField));
    rowMeta.addValueMeta(new ValueMetaString(destinationField));
    return rowMeta;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta)

Example 2 with ValueMetaString

use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.

the class CheckSumTest method testHexOutput_md5_compatibilityMode.

@Test
public void testHexOutput_md5_compatibilityMode() throws Exception {
    MockRowListener results = executeHexTest(2, true, "xyz", new ValueMetaString("test"), false);
    assertEquals(1, results.getWritten().size());
    assertEquals("FD6FFD6F0911FD78FDFD1361FDFD705E", results.getWritten().get(0)[1]);
    results = executeHexTest(2, true, 10.8, new ValueMetaNumber("test"), false);
    assertEquals(1, results.getWritten().size());
    assertEquals("372DFDFD33FD1BFDFD6D225361FD7EFD", results.getWritten().get(0)[1]);
    results = executeHexTest(2, true, 10.82, new ValueMetaNumber("test"), false);
    assertEquals(1, results.getWritten().size());
    assertEquals("68FD42FD7143FD17FD17FDFD715957", results.getWritten().get(0)[1]);
    byte[] input = IOUtils.toByteArray(getFile("/org/pentaho/di/trans/steps/loadfileinput/files/pentaho_splash.png").getContent().getInputStream());
    results = executeHexTest(2, true, input, new ValueMetaBinary("test"), false);
    assertEquals(1, results.getWritten().size());
    assertEquals("FDFDFDFD051FFDFDFD50FD62FDFDFD13", results.getWritten().get(0)[1]);
}
Also used : ValueMetaBinary(org.pentaho.di.core.row.value.ValueMetaBinary) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) ValueMetaNumber(org.pentaho.di.core.row.value.ValueMetaNumber) Test(org.junit.Test)

Example 3 with ValueMetaString

use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.

the class CheckSumTest method testHexOutput_adler32_oldChecksumBehaviourMode.

@Test
public void testHexOutput_adler32_oldChecksumBehaviourMode() throws Exception {
    MockRowListener results = executeHexTest(1, false, "xyz", new ValueMetaString("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("47645036"), results.getWritten().get(0)[1]);
    results = executeHexTest(1, false, 10.8, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("32243912"), results.getWritten().get(0)[1]);
    results = executeHexTest(1, false, 10.82, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("48627962"), 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 4 with ValueMetaString

use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.

the class CheckSumTest method testHexOutput_crc32_oldChecksumBehaviourMode.

@Test
public void testHexOutput_crc32_oldChecksumBehaviourMode() throws Exception {
    MockRowListener results = executeHexTest(0, false, "xyz", new ValueMetaString("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("3951999591"), results.getWritten().get(0)[1]);
    results = executeHexTest(0, false, 10.8, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("1857885434"), results.getWritten().get(0)[1]);
    results = executeHexTest(0, false, 10.82, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals(Long.valueOf("1205016603"), 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 5 with ValueMetaString

use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.

the class CheckSumTest method testHexOutput_md5_oldChecksumBehaviourMode.

@Test
public void testHexOutput_md5_oldChecksumBehaviourMode() throws Exception {
    MockRowListener results = executeHexTest(2, false, "xyz", new ValueMetaString("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals("d16fb36f0911f878998c136191af705e", results.getWritten().get(0)[1]);
    results = executeHexTest(2, false, 10.8, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals("372df98e33ac1bf6b26d225361ba7eb5", results.getWritten().get(0)[1]);
    results = executeHexTest(2, false, 10.82, new ValueMetaNumber("test"), true);
    assertEquals(1, results.getWritten().size());
    assertEquals("68b142f87143c917f29d178aa1715957", 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)

Aggregations

ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)551 Test (org.junit.Test)266 RowMeta (org.pentaho.di.core.row.RowMeta)251 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)202 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)187 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)157 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)91 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)73 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)68 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)59 ArrayList (java.util.ArrayList)46 KettleException (org.pentaho.di.core.exception.KettleException)44 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)31 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)30 LongObjectId (org.pentaho.di.repository.LongObjectId)29 ObjectId (org.pentaho.di.repository.ObjectId)26 Date (java.util.Date)25 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)22 RowSet (org.pentaho.di.core.RowSet)21 KettleStepException (org.pentaho.di.core.exception.KettleStepException)17