use of org.openforis.idm.model.RealAttribute in project collect by openforis.
the class ComparisonCheckTest method testRealFailGt.
@Test
public void testRealFailGt() {
RealAttribute plotDir = EntityBuilder.addValue(cluster, "plot_direction", 552.345d);
ValidationResults results = validate(plotDir);
assertTrue(containsComparisonCheck(results.getErrors()));
}
use of org.openforis.idm.model.RealAttribute in project collect by openforis.
the class ComparisonCheckTest method testLteWithNormalizedValuesFailOnLt.
@Test
public void testLteWithNormalizedValuesFailOnLt() {
RealAttribute plotDistance = EntityBuilder.addValue(cluster, "plot_distance", 25000d);
Unit unit = survey.getUnit("m");
plotDistance.setUnit(unit);
ValidationResults results = validate(plotDistance);
assertTrue(containsComparisonCheck(results.getErrors()));
}
use of org.openforis.idm.model.RealAttribute in project collect by openforis.
the class ComparisonCheckTest method testRealFailLt.
@Test
public void testRealFailLt() {
RealAttribute plotDir = EntityBuilder.addValue(cluster, "plot_direction", -52.345d);
ValidationResults results = validate(plotDir);
assertTrue(containsComparisonCheck(results.getErrors()));
}
use of org.openforis.idm.model.RealAttribute in project collect by openforis.
the class CustomCheckTest method testPassLtEqWithCondition1.
@Test
public void testPassLtEqWithCondition1() {
Entity plot = EntityBuilder.addEntity(cluster, "plot");
Entity tree = EntityBuilder.addEntity(plot, "tree");
EntityBuilder.addValue(tree, "health", new Code("1"));
RealAttribute totalHeight = EntityBuilder.addValue(tree, "total_height", 16.0);
EntityBuilder.addValue(tree, "dbh", 16.0);
ValidationResults results = validate(totalHeight);
assertFalse(containsCustomCheck(results.getWarnings()));
}
use of org.openforis.idm.model.RealAttribute in project collect by openforis.
the class CustomCheckTest method testPassLtEqWithCondition.
@Test
public void testPassLtEqWithCondition() {
Entity plot = EntityBuilder.addEntity(cluster, "plot");
Entity tree = EntityBuilder.addEntity(plot, "tree");
RealAttribute totalHeight = EntityBuilder.addValue(tree, "total_height", 2.0);
EntityBuilder.addValue(tree, "dbh", 16.5);
EntityBuilder.addValue(tree, "health", new Code("2"));
ValidationResults results = validate(totalHeight);
assertFalse(containsCustomCheck(results.getWarnings()));
}
Aggregations