use of org.knime.core.data.DataRow in project knime-core by knime.
the class DoubleCellFilterRowGeneratorTest method testTwoBorder1.
/**
* Test on left and right border using <b>3.0</b>.
*/
public void testTwoBorder1() {
DataRow row = new MyTestRow(3.0);
FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
assertFalse(gen.isIn(row));
}
use of org.knime.core.data.DataRow in project knime-core by knime.
the class DoubleCellFilterRowGeneratorTest method testOneBorder3.
/**
* Test on left border using <b>7.0</b>.
*/
public void testOneBorder3() {
DataRow row = new MyTestRow(7.0);
FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT);
assertTrue(gen.isIn(row));
}
use of org.knime.core.data.DataRow in project knime-core by knime.
the class DoubleCellFilterRowGeneratorTest method testTwoBorder5.
/**
* Test on left and right border using <b>9.0</b>.
*/
public void testTwoBorder5() {
DataRow row = new MyTestRow(9.0);
FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
assertFalse(gen.isIn(row));
}
use of org.knime.core.data.DataRow in project knime-core by knime.
the class DoubleCellFilterRowGeneratorTest method testTwoBorder2.
/**
* Test on left and right border using <b>5.0</b>.
*/
public void testTwoBorder2() {
DataRow row = new MyTestRow(5.0);
FilterRowGenerator gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_IN, m_dblRight, RIGHT_OUT);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, LEFT_OUT, m_dblRight, RIGHT_OUT);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_IN);
assertTrue(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_OUT);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_OUT, m_dblRight, LEFT_IN);
assertFalse(gen.isIn(row));
gen = new DoubleCellFilterRowGenerator(IDX, m_dblLeft, RIGHT_IN, m_dblRight, LEFT_OUT);
assertTrue(gen.isIn(row));
}
use of org.knime.core.data.DataRow in project knime-core by knime.
the class JoinedTableTest method testMergedTable.
/**
* Test for constructor.
*/
public final void testMergedTable() {
DataColumnSpec[] leftCols = new DataColumnSpec[3];
DataColumnSpec[] rightCols = new DataColumnSpec[3];
System.arraycopy(COLS, 0, leftCols, 0, 3);
System.arraycopy(COLS, 3, rightCols, 0, 3);
DataTable leftTable = new DefaultTable(new DataRow[0], new DataTableSpec(leftCols));
DataTable rightTable = new DefaultTable(new DataRow[0], new DataTableSpec(rightCols));
new JoinedTable(leftTable, rightTable);
try {
new JoinedTable(null, rightTable);
fail();
} catch (NullPointerException ne) {
NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + ne.getClass(), ne);
}
try {
new JoinedTable(leftTable, null);
fail();
} catch (NullPointerException ne) {
NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + ne.getClass(), ne);
}
try {
new JoinedTable(leftTable, leftTable);
fail();
} catch (IllegalArgumentException iae) {
NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
}
try {
new JoinedTable(leftTable, leftTable);
fail();
} catch (IllegalArgumentException iae) {
NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
}
rightCols[1] = leftCols[2];
rightTable = new DefaultTable(new DataRow[0], new DataTableSpec(rightCols));
try {
new JoinedTable(leftTable, rightTable);
fail();
} catch (IllegalArgumentException iae) {
NodeLogger.getLogger(JoinedTableTest.class).debug("Got expected exception: " + iae.getClass(), iae);
}
}
Aggregations