use of org.pentaho.di.core.row.RowMeta in project pentaho-kettle by pentaho.
the class ByteArrayHashIndexTest method testGetAndPut.
@Test
public void testGetAndPut() throws KettleValueException {
ByteArrayHashIndex obj = new ByteArrayHashIndex(new RowMeta(), 10);
assertNull(obj.get(new byte[] { 10 }));
obj.put(new byte[] { 10 }, new byte[] { 53, 12 });
assertNotNull(obj.get(new byte[] { 10 }));
assertArrayEquals(new byte[] { 53, 12 }, obj.get(new byte[] { 10 }));
}
use of org.pentaho.di.core.row.RowMeta in project pentaho-kettle by pentaho.
the class QueueRowSetTest method testSize.
@Test
public void testSize() throws Exception {
assertEquals(0, rowSet.size());
rowSet.putRow(new RowMeta(), row);
assertEquals(1, rowSet.size());
rowSet.putRow(new RowMeta(), row);
assertEquals(2, rowSet.size());
rowSet.clear();
assertEquals(0, rowSet.size());
}
use of org.pentaho.di.core.row.RowMeta in project pentaho-kettle by pentaho.
the class RowMetaAndDataTest method testEmptyValues.
@Test
public void testEmptyValues() throws Exception {
RowMeta rowsMetaEmpty = new RowMeta();
rowsMetaEmpty.addValueMeta(new ValueMetaString("str"));
rowsMetaEmpty.addValueMeta(new ValueMetaBoolean("bool"));
rowsMetaEmpty.addValueMeta(new ValueMetaInteger("int"));
rowsMetaEmpty.addValueMeta(new ValueMetaNumber("num"));
rowsMetaEmpty.addValueMeta(new ValueMetaBigNumber("bignum"));
rowsMetaEmpty.addValueMeta(new ValueMetaBinary("bin"));
rowsMetaEmpty.addValueMeta(new ValueMetaDate("date"));
rowsMetaEmpty.addValueMeta(new ValueMetaTimestamp("timestamp"));
rowsMetaEmpty.addValueMeta(new ValueMetaInternetAddress("inet"));
row = new RowMetaAndData(rowsMetaEmpty, null, null, null, null, null, null, null, null, null);
assertTrue(row.isEmptyValue("str"));
assertTrue(row.isEmptyValue("bool"));
assertTrue(row.isEmptyValue("int"));
assertTrue(row.isEmptyValue("num"));
assertTrue(row.isEmptyValue("bignum"));
assertTrue(row.isEmptyValue("bin"));
assertTrue(row.isEmptyValue("date"));
assertTrue(row.isEmptyValue("timestamp"));
assertTrue(row.isEmptyValue("inet"));
}
use of org.pentaho.di.core.row.RowMeta in project pentaho-kettle by pentaho.
the class RowMetaAndDataTest method prepare.
@Before
public void prepare() throws Exception {
rowsMeta = new RowMeta();
ValueMetaInterface valueMetaString = new ValueMetaString("str");
rowsMeta.addValueMeta(valueMetaString);
ValueMetaInterface valueMetaBoolean = new ValueMetaBoolean("bool");
rowsMeta.addValueMeta(valueMetaBoolean);
ValueMetaInterface valueMetaInteger = new ValueMetaInteger("int");
rowsMeta.addValueMeta(valueMetaInteger);
}
use of org.pentaho.di.core.row.RowMeta in project pentaho-kettle by pentaho.
the class RowSetTest method createRowMetaInterface.
public RowMetaInterface createRowMetaInterface() {
RowMetaInterface rm = new RowMeta();
ValueMetaInterface[] valuesMeta = { new ValueMetaInteger("ROWNR") };
for (int i = 0; i < valuesMeta.length; i++) {
rm.addValueMeta(valuesMeta[i]);
}
return rm;
}
Aggregations