Search in sources :

Example 26 with RowMeta

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

the class StringSearchResult method getResultRowMeta.

public static final RowMetaInterface getResultRowMeta() {
    RowMetaInterface rowMeta = new RowMeta();
    rowMeta.addValueMeta(new ValueMetaString(BaseMessages.getString(PKG, "SearchResult.TransOrJob")));
    rowMeta.addValueMeta(new ValueMetaString(BaseMessages.getString(PKG, "SearchResult.StepDatabaseNotice")));
    rowMeta.addValueMeta(new ValueMetaString(BaseMessages.getString(PKG, "SearchResult.String")));
    rowMeta.addValueMeta(new ValueMetaString(BaseMessages.getString(PKG, "SearchResult.FieldName")));
    return rowMeta;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface)

Example 27 with RowMeta

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

the class BlockingListeningRowSetTest method testClass.

@Test
public void testClass() {
    BlockingListeningRowSet rowSet = new BlockingListeningRowSet(1);
    assertEquals(0, rowSet.size());
    final Object[] row = new Object[] {};
    final RowMeta meta = new RowMeta();
    rowSet.putRow(meta, row);
    assertSame(meta, rowSet.getRowMeta());
    assertEquals(1, rowSet.size());
    assertFalse(rowSet.isBlocking());
    assertSame(row, rowSet.getRow());
    assertEquals(0, rowSet.size());
    rowSet.putRow(meta, row);
    assertSame(row, rowSet.getRowImmediate());
    rowSet.putRow(meta, row);
    assertEquals(1, rowSet.size());
    rowSet.clear();
    assertEquals(0, rowSet.size());
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) Test(org.junit.Test)

Example 28 with RowMeta

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

the class ConditionTest method testNullLessThanNumberEvaluatesAsFalse.

@Test
public void testNullLessThanNumberEvaluatesAsFalse() throws Exception {
    RowMetaInterface rowMeta1 = new RowMeta();
    rowMeta1.addValueMeta(new ValueMetaInteger("name1"));
    String left = "name1";
    ValueMetaAndData right_exact = new ValueMetaAndData(new ValueMetaInteger("name1"), new Long(-10));
    Condition condition = new Condition(left, Condition.FUNC_SMALLER, null, right_exact);
    assertFalse(condition.evaluate(rowMeta1, new Object[] { null, "test" }));
    condition = new Condition(left, Condition.FUNC_SMALLER_EQUAL, null, right_exact);
    assertFalse(condition.evaluate(rowMeta1, new Object[] { null, "test" }));
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInteger(org.pentaho.di.core.row.value.ValueMetaInteger) ValueMetaAndData(org.pentaho.di.core.row.ValueMetaAndData) Test(org.junit.Test)

Example 29 with RowMeta

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

the class ValueMetaBaseSetPreparedStmntValueTest method testXMLParsingWithNoDataFormatLocale.

@Test
public void testXMLParsingWithNoDataFormatLocale() throws IOException {
    ValueMetaInterface r1 = new ValueMetaString("value");
    r1.setDateFormatLocale(null);
    RowMetaInterface row = new RowMeta();
    row.setValueMetaList(new ArrayList<ValueMetaInterface>(Arrays.asList(r1)));
    row.getMetaXML();
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) Test(org.junit.Test)

Example 30 with RowMeta

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

the class VariablesTest method testFieldSubstitution.

@Test
public void testFieldSubstitution() throws KettleValueException {
    Object[] rowData = new Object[] { "DataOne", "DataTwo" };
    RowMeta rm = new RowMeta();
    rm.addValueMeta(new ValueMetaString("FieldOne"));
    rm.addValueMeta(new ValueMetaString("FieldTwo"));
    Variables vars = new Variables();
    assertNull(vars.fieldSubstitute(null, rm, rowData));
    assertEquals("", vars.fieldSubstitute("", rm, rowData));
    assertEquals("DataOne", vars.fieldSubstitute("?{FieldOne}", rm, rowData));
    assertEquals("TheDataOne", vars.fieldSubstitute("The?{FieldOne}", rm, rowData));
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) Test(org.junit.Test)

Aggregations

RowMeta (org.pentaho.di.core.row.RowMeta)540 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)280 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)249 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)209 Test (org.junit.Test)174 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)135 KettleException (org.pentaho.di.core.exception.KettleException)112 ArrayList (java.util.ArrayList)68 KettleStepException (org.pentaho.di.core.exception.KettleStepException)56 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)52 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)44 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)41 RowSet (org.pentaho.di.core.RowSet)34 KettleDatabaseException (org.pentaho.di.core.exception.KettleDatabaseException)27 ValueMetaBase (org.pentaho.di.core.row.value.ValueMetaBase)26 SQLException (java.sql.SQLException)24 FileObject (org.apache.commons.vfs2.FileObject)24 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)23 StepMeta (org.pentaho.di.trans.step.StepMeta)23 ErrorDialog (org.pentaho.di.ui.core.dialog.ErrorDialog)23