use of org.openforis.idm.model.TextAttribute in project collect by openforis.
the class PatternCheckTest method testValidPattern3.
@Test
public void testValidPattern3() {
TextAttribute id = EntityBuilder.addValue(household, "id", "102357");
ValidationResults results = validate(id);
assertFalse(containsPatternCheck(results.getErrors()));
}
use of org.openforis.idm.model.TextAttribute in project collect by openforis.
the class PatternCheckTest method testInvalidPattern.
@Test
public void testInvalidPattern() {
TextAttribute id = EntityBuilder.addValue(household, "id", "x-102357");
ValidationResults results = validate(id);
assertTrue(containsPatternCheck(results.getErrors()));
}
use of org.openforis.idm.model.TextAttribute in project collect by openforis.
the class PatternCheckTest method testInvalidPattern2.
@Test
public void testInvalidPattern2() {
TextAttribute id = EntityBuilder.addValue(household, "id", "X-1d02357");
ValidationResults results = validate(id);
assertTrue(containsPatternCheck(results.getErrors()));
}
use of org.openforis.idm.model.TextAttribute in project collect by openforis.
the class UniquenessCheckTest method testNotUniqueMapSheet.
@Test
public void testNotUniqueMapSheet() {
EntityBuilder.addValue(cluster, MAP_SHEET, "TomTom1");
EntityBuilder.addValue(cluster, MAP_SHEET, "TomTom2");
TextAttribute mapSheet3 = EntityBuilder.addValue(cluster, MAP_SHEET, "TomTom1");
ValidationResults results = validate(mapSheet3);
Assert.assertTrue(containsUniquenessError(results.getErrors(), MAP_SHEET));
}
use of org.openforis.idm.model.TextAttribute in project collect by openforis.
the class UniquenessCheckTest method testUniqueSingleMapSheet.
@Test
public void testUniqueSingleMapSheet() {
TextAttribute mapSheet1 = EntityBuilder.addValue(cluster, MAP_SHEET, "TomTom1");
ValidationResults results = validate(mapSheet1);
Assert.assertFalse(containsUniquenessError(results.getErrors(), MAP_SHEET));
}
Aggregations