Search in sources :

Example 16 with ElementValidation

use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.

the class ValidatorParameterHelperTest method anyParam.

@Test
public void anyParam() throws Exception {
    ExecutableElement executableElement = createMethod(String.class);
    ElementValidation valid = new ElementValidation("", executableElement);
    validator.anyType().validate(executableElement, valid);
    assertTrue(valid.isValid());
}
Also used : ExecutableElement(javax.lang.model.element.ExecutableElement) ElementValidation(org.androidannotations.ElementValidation) Test(org.junit.Test)

Example 17 with ElementValidation

use of org.androidannotations.ElementValidation in project androidannotations by androidannotations.

the class ValidatorParameterHelperTest method itemSelect.

@Test
public void itemSelect() {
    ExecutableElement executableElement = createMethod(boolean.class, int.class);
    ElementValidation valid = new ElementValidation("", executableElement);
    //
    validator.inOrder().primitiveOrWrapper(//
    TypeKind.BOOLEAN).anyType().optional().validate(executableElement, valid);
    assertTrue(valid.isValid());
}
Also used : ExecutableElement(javax.lang.model.element.ExecutableElement) ElementValidation(org.androidannotations.ElementValidation) Test(org.junit.Test)

Aggregations

ElementValidation (org.androidannotations.ElementValidation)17 ExecutableElement (javax.lang.model.element.ExecutableElement)15 Test (org.junit.Test)15 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 AnnotationMirror (javax.lang.model.element.AnnotationMirror)1 Element (javax.lang.model.element.Element)1 AnnotationHandler (org.androidannotations.handler.AnnotationHandler)1 ValidationException (org.androidannotations.internal.exception.ValidationException)1