Search in sources :

Example 6 with BooleanCell

use of org.knime.core.data.def.BooleanCell in project knime-core by knime.

the class ExpressionFactoryTest method testMissing.

/**
 * Test method for {@link ExpressionFactory#missing(Expression)} .
 */
@Test
public void testMissing() {
    final Expression missingSingle = m_factory.missing(m_mockBoolExpression);
    final BooleanCell trueCell = BooleanCell.TRUE, falseCell = BooleanCell.FALSE;
    testForValues(missingSingle, falseCell, falseCell, falseCell, falseCell, trueCell);
}
Also used : BooleanCell(org.knime.core.data.def.BooleanCell) Test(org.junit.Test)

Example 7 with BooleanCell

use of org.knime.core.data.def.BooleanCell in project knime-core by knime.

the class JavaToDataCellConversionTest method testToBooleanCell.

/**
 * Test Boolean -> BooleanCell conversion.
 *
 * @throws Exception When something went wrong
 */
@Test
public void testToBooleanCell() throws Exception {
    final BooleanCell cell = testSimpleConversion(Boolean.class, BooleanCell.TYPE, BooleanCell.class, new Boolean(true));
    assertTrue(cell.getBooleanValue());
}
Also used : BooleanCell(org.knime.core.data.def.BooleanCell) Test(org.junit.Test)

Example 8 with BooleanCell

use of org.knime.core.data.def.BooleanCell in project knime-core by knime.

the class ExpressionFactoryTest method testAnd.

/**
 * Test method for {@link ExpressionFactory#and(List)} .
 */
@Test
public void testAnd() {
    final Expression andSingle = m_factory.and(Arrays.asList(m_mockBoolExpression));
    final BooleanCell trueCell = BooleanCell.TRUE, falseCell = BooleanCell.FALSE;
    // DataCell missing = DataType.getMissingCell();
    testForValues(andSingle, trueCell, falseCell, trueCell, falseCell);
    final Expression andSame = m_factory.and(Arrays.asList(m_mockBoolExpression, m_mockBoolExpression));
    testForValues(andSame, trueCell, falseCell, trueCell, falseCell);
    final Expression andMixed = m_factory.and(Arrays.asList(m_mockBoolExpression, m_mockBoolExpressionOther));
    testForValues(andMixed, trueCell, falseCell, falseCell, falseCell);
}
Also used : BooleanCell(org.knime.core.data.def.BooleanCell) Test(org.junit.Test)

Aggregations

BooleanCell (org.knime.core.data.def.BooleanCell)8 Test (org.junit.Test)7 HashMap (java.util.HashMap)1 Map (java.util.Map)1 BooleanValue (org.knime.core.data.BooleanValue)1 DataCell (org.knime.core.data.DataCell)1 DataRow (org.knime.core.data.DataRow)1 DataType (org.knime.core.data.DataType)1 ListCell (org.knime.core.data.collection.ListCell)1