Search in sources :

Example 11 with DateValue

use of org.drools.workbench.models.guided.dtree.shared.model.values.impl.DateValue in project drools by kiegroup.

the class GuidedDecisionTreeValuesTest method testDateValue.

@Test
public void testDateValue() {
    final Date tv = Calendar.getInstance().getTime();
    final DateValue v = new DateValue(tv);
    assertEquals(tv, v.getValue());
    try {
        v.setValue("any string will do");
        fail("We should not be able to use DateValue.setValue(String)");
    } catch (UnsupportedOperationException e) {
    // Swallow this is expected
    } catch (Exception e) {
        fail("Unexpected exception thrown by DateValue.setValue(String)");
    }
}
Also used : DateValue(org.drools.workbench.models.guided.dtree.shared.model.values.impl.DateValue) Date(java.util.Date) Test(org.junit.Test)

Aggregations

DateValue (org.drools.workbench.models.guided.dtree.shared.model.values.impl.DateValue)11 Test (org.junit.Test)11 GuidedDecisionTree (org.drools.workbench.models.guided.dtree.shared.model.GuidedDecisionTree)10 TypeNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.TypeNode)10 TypeNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.TypeNodeImpl)10 Calendar (java.util.Calendar)8 ActionFieldValueImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionFieldValueImpl)8 Date (java.util.Date)7 ActionInsertNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode)4 ActionUpdateNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode)4 ActionInsertNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionInsertNodeImpl)4 ActionUpdateNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionUpdateNodeImpl)4 ConstraintNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ConstraintNode)2 ConstraintNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ConstraintNodeImpl)2