Search in sources :

Example 6 with SimpleListContentValidation

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());
}
Also used : SimpleListContentValidation(com.adaptris.transform.validate.SimpleListContentValidation) Test(org.junit.Test)

Example 7 with SimpleListContentValidation

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());
}
Also used : SimpleListContentValidation(com.adaptris.transform.validate.SimpleListContentValidation) Test(org.junit.Test)

Example 8 with SimpleListContentValidation

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;
}
Also used : NotNullContentValidation(com.adaptris.transform.validate.NotNullContentValidation) SimpleListContentValidation(com.adaptris.transform.validate.SimpleListContentValidation) NotInListContentValidation(com.adaptris.transform.validate.NotInListContentValidation) ValidationStage(com.adaptris.transform.validate.ValidationStage)

Aggregations

SimpleListContentValidation (com.adaptris.transform.validate.SimpleListContentValidation)8 Test (org.junit.Test)7 ValidationStage (com.adaptris.transform.validate.ValidationStage)6 AdaptrisMessage (com.adaptris.core.AdaptrisMessage)5 DefaultMessageFactory (com.adaptris.core.DefaultMessageFactory)5 ServiceException (com.adaptris.core.ServiceException)5 NotNullContentValidation (com.adaptris.transform.validate.NotNullContentValidation)4 NotInListContentValidation (com.adaptris.transform.validate.NotInListContentValidation)1