Search in sources :

Example 1 with RowRead

use of org.knime.core.data.v2.RowRead in project knime-core by knime.

the class FallbackIteratorTest method testIdentity.

@Test
public void testIdentity() throws Exception {
    final BufferedDataTable fullTable = createTable(0, 16, 16, 0, 16);
    try (RowCursor cursor = fullTable.cursor();
        CloseableRowIterator it = fullTable.iterator()) {
        assertEquals(cursor.getNumColumns(), fullTable.getDataTableSpec().getNumColumns());
        while (cursor.canForward()) {
            assertTrue(it.hasNext());
            final RowRead access = cursor.forward();
            final DataRow row = it.next();
            for (int i = 0; i < cursor.getNumColumns(); i++) {
                access.getValue(i).equals(row.getCell(i));
            }
        }
    }
}
Also used : BufferedDataTable(org.knime.core.node.BufferedDataTable) RowRead(org.knime.core.data.v2.RowRead) DataRow(org.knime.core.data.DataRow) RowCursor(org.knime.core.data.v2.RowCursor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 DataRow (org.knime.core.data.DataRow)1 RowCursor (org.knime.core.data.v2.RowCursor)1 RowRead (org.knime.core.data.v2.RowRead)1 BufferedDataTable (org.knime.core.node.BufferedDataTable)1