use of com.adaptris.transform.validate.SimpleListContentValidation in project interlok by adaptris.
the class ListContentValidationTest method testSimpleListContentValidation_SetListEntries.
@Test
public void testSimpleListContentValidation_SetListEntries() {
SimpleListContentValidation cv = new SimpleListContentValidation();
assertNotNull(cv.getListEntries());
assertEquals(0, cv.getListEntries().size());
cv.setListEntries(new ArrayList<String>(Arrays.asList(entry1, entry2)));
assertEquals(2, cv.getListEntries().size());
assertEquals(new ArrayList<String>(Arrays.asList(entry1, entry2)), cv.getListEntries());
}
use of com.adaptris.transform.validate.SimpleListContentValidation in project interlok by adaptris.
the class ListContentValidationTest method testSimpleListContentValidation_AddListEntry.
@Test
public void testSimpleListContentValidation_AddListEntry() {
SimpleListContentValidation cv = new SimpleListContentValidation();
assertNotNull(cv.getListEntries());
assertEquals(0, cv.getListEntries().size());
cv.addListEntry(entry1);
cv.addListEntry(entry2);
assertEquals(2, cv.getListEntries().size());
assertEquals(new ArrayList<String>(Arrays.asList(entry1, entry2)), cv.getListEntries());
}
use of com.adaptris.transform.validate.SimpleListContentValidation in project interlok by adaptris.
the class XmlRuleValidatorTest method createSample.
static XmlRuleValidator createSample() {
XmlRuleValidator validator = new XmlRuleValidator();
ValidationStage stage1 = new ValidationStage(XPATH_ITERATION_CHILDREN_OF_CRONOS, XPATH_CHILDREN_OF_RHEA, new NotNullContentValidation(), new SimpleListContentValidation(CHILDREN_OF_RHEA));
validator.addValidationStage(stage1);
ValidationStage stage2 = new ValidationStage(XPATH_ITERATION_CHILDREN_OF_ZEUS, XPATH_CHILDREN_OF_HERA, new NotNullContentValidation(), new SimpleListContentValidation(CHILDREN_OF_HERA));
validator.addValidationStage(stage2);
ValidationStage stage3 = new ValidationStage(XPATH_ITERATION_CHILDREN_OF_ZEUS, XPATH_CHILDREN_OF_LETO, new NotNullContentValidation(), new NotInListContentValidation(CHILDREN_OF_HERA));
validator.addValidationStage(stage3);
return validator;
}
Aggregations