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;
}
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());
}
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" }));
}
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();
}
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));
}
Aggregations