use of org.openforis.idm.metamodel.Survey in project collect by openforis.
the class ExpressionValidatorTest method testInvalidAttributeInSampingPointDataFunction.
@Test
public void testInvalidAttributeInSampingPointDataFunction() {
Survey survey = survey(attributeDef("location"));
samplingPointDataAttribute(survey, "valid_attribute");
assertInvalidExpression(survey, "root/location", "idm:samplingPointData('invalid_attribute', '1')");
}
use of org.openforis.idm.metamodel.Survey in project collect by openforis.
the class ExpressionValidatorTest method testCustomFunctionWrongArgumentCount.
@Test
public void testCustomFunctionWrongArgumentCount() {
Survey survey = survey(attributeDef("region"));
assertInvalidExpression(survey, "root/region", "math:max(1, 2)");
}
use of org.openforis.idm.metamodel.Survey in project collect by openforis.
the class ExpressionValidatorTest method testConstantNumber.
@Test
public void testConstantNumber() {
Survey survey = survey(attributeDef("region"));
assertValidExpression(survey, "root/region", "10");
}
use of org.openforis.idm.metamodel.Survey in project collect by openforis.
the class ExpressionValidatorTest method testInvalidPath.
@Test
public void testInvalidPath() {
Survey survey = survey(attributeDef("region"), entityDef("time_study", attributeDef("date"), attributeDef("time")));
assertInvalidExpression(survey, "root/region", "non_existing/path");
}
use of org.openforis.idm.metamodel.Survey in project collect by openforis.
the class ExpressionValidatorTest method testIndependentValidCoreFunction.
@Test
public void testIndependentValidCoreFunction() {
Survey survey = survey(attributeDef("region"));
assertValidExpression(survey, "root/region", "true()");
}
Aggregations