use of org.openforis.idm.model.TimeAttribute in project collect by openforis.
the class ComparisonCheckTest method testTimeGtFailOnEq.
@Test
public void testTimeGtFailOnEq() {
Entity timeStudy = EntityBuilder.addEntity(cluster, "time_study");
EntityBuilder.addValue(timeStudy, "start_time", new Time(10, 00));
TimeAttribute endTime = EntityBuilder.addValue(timeStudy, "end_time", new Time(10, 00));
ValidationResults results = validate(endTime);
assertTrue(containsComparisonCheck(results.getErrors()));
}
use of org.openforis.idm.model.TimeAttribute in project collect by openforis.
the class ComparisonCheckTest method testTimeGtPassOnGt.
@Test
public void testTimeGtPassOnGt() {
Entity timeStudy = EntityBuilder.addEntity(cluster, "time_study");
EntityBuilder.addValue(timeStudy, "start_time", new Time(10, 00));
TimeAttribute endTime = EntityBuilder.addValue(timeStudy, "end_time", new Time(10, 01));
ValidationResults results = validate(endTime);
assertFalse(containsComparisonCheck(results.getErrors()));
}
use of org.openforis.idm.model.TimeAttribute in project collect by openforis.
the class TimeAttributeMapper method setFields.
@Override
void setFields(Node<?> node, InsertSetStep<?> insert) {
Time value = ((TimeAttribute) node).getValue();
if (value != null) {
insert.set(DATA.NUMBER1, toNumeric(value.getHour()));
insert.set(DATA.NUMBER2, toNumeric(value.getMinute()));
}
}
use of org.openforis.idm.model.TimeAttribute in project collect by openforis.
the class ComparisonCheckTest method testTimeGtFailOnLt.
@Test
public void testTimeGtFailOnLt() {
Entity timeStudy = EntityBuilder.addEntity(cluster, "time_study");
EntityBuilder.addValue(timeStudy, "start_time", new Time(10, 00));
TimeAttribute endTime = EntityBuilder.addValue(timeStudy, "end_time", new Time(8, 00));
ValidationResults results = validate(endTime);
assertTrue(containsComparisonCheck(results.getErrors()));
}
Aggregations