use of org.drools.workbench.models.testscenarios.backend.SqlDateWrapper in project drools by kiegroup.
the class FactFieldValueVerifierTest method testSQLDate.
public void testSQLDate() throws Exception {
SqlDateWrapper sqlDateWrapper = new SqlDateWrapper();
sqlDateWrapper.setSqlDate(new Date(2012 - 1900, 11, 12));
HashMap<String, Object> populatedData = new HashMap<String, Object>();
populatedData.put("sqlDateWrapper", sqlDateWrapper);
TypeResolver typeResolver = mock(TypeResolver.class);
FactFieldValueVerifier verifier = new FactFieldValueVerifier(populatedData, "sqlDateWrapper", sqlDateWrapper, typeResolver);
List<VerifyField> fieldValues = new ArrayList<VerifyField>();
VerifyField verifyField = new VerifyField("sqlDate", "12-DEC-2012", "==");
fieldValues.add(verifyField);
verifier.checkFields(fieldValues);
assertTrue(verifyField.getSuccessResult());
}
use of org.drools.workbench.models.testscenarios.backend.SqlDateWrapper in project drools by kiegroup.
the class FactPopulatorTest method testSQLDateField.
@Test
public void testSQLDateField() throws Exception {
factPopulator.add(new NewFactPopulator(populatedData, getTypeResolver(), new FactData("SqlDateWrapper", "c1", Arrays.<Field>asList(new FieldData("sqlDate", "10-Jul-2008")), false)));
factPopulator.populate();
assertTrue(populatedData.containsKey("c1"));
SqlDateWrapper sqlDateWrapper = (SqlDateWrapper) populatedData.get("c1");
assertNotNull(sqlDateWrapper.getSqlDate());
}
Aggregations