Class ExceptionsContractTest


  • public class ExceptionsContractTest
    extends ValidationTestBase
    Several checks to validate that the implementations of Validator and BeanDescriptor throw the correct exceptions as per the spec.
    Author:
    Carlos Vara
    • Constructor Detail

      • ExceptionsContractTest

        public ExceptionsContractTest()
    • Method Detail

      • testExceptionThrowingBean

        public void testExceptionThrowingBean()
        Checks that the correct exception is thrown when validating a bean whose getter throws an exception.
      • testValidateNullGroup

        public void testValidateNullGroup()
        Checks that an IllegalArgumentException is thrown when passing null as group array.
      • testValidateNullPropertyName

        public void testValidateNullPropertyName()
        Checks that an IllegalArgumentException is thrown when passing a null property name.
      • testValidateEmptyPropertyName

        public void testValidateEmptyPropertyName()
        Checks that an IllegalArgumentException is thrown when passing an empty property name.
      • testValidateInvalidPropertyName

        public void testValidateInvalidPropertyName()
        Checks that an IllegalArgumentException is thrown when passing an invalid property name.
      • testValidatePropertyOnNullBean

        public void testValidatePropertyOnNullBean()
        Checks that an IllegalArgumentException is thrown when trying to validate a property on a null object.
      • testValidatePropertyNullGroup

        public void testValidatePropertyNullGroup()
        Checks that an IllegalArgumentException is thrown when passing null as group array in a Validator.validateProperty(Object, String, Class...) call.
      • testValidateValueOnNullClass

        public void testValidateValueOnNullClass()
        Checks that an IllegalArgumentException is thrown when calling Validator.validateValue(Class, String, Object, Class...) with a null class.
      • testValidateValueNullPropertyName

        public void testValidateValueNullPropertyName()
        Checks that an IllegalArgumentException is thrown when passing a null property name to Validator.validateValue(Class, String, Object, Class...).
      • testValidateValueEmptyPropertyName

        public void testValidateValueEmptyPropertyName()
        Checks that an IllegalArgumentException is thrown when passing an empty property name to Validator.validateValue(Class, String, Object, Class...).
      • testValidateValueInvalidPropertyName

        public void testValidateValueInvalidPropertyName()
        Checks that an IllegalArgumentException is thrown when passing an invalid property name to Validator.validateValue(Class, String, Object, Class...).
      • testValidateValueNullGroup

        public void testValidateValueNullGroup()
        Checks that an IllegalArgumentException is thrown when calling Validator.validateValue(Class, String, Object, Class...) with a null group array.
      • testValidateIncompatibleValue

        public void testValidateIncompatibleValue()
        Enforces the "not a valid object property" part of the IllegalArgumentException declaration on Validator.validateValue(Class, String, Object, Class...)
      • testValidateIncompatiblePrimitiveValue

        public void testValidateIncompatiblePrimitiveValue()
        Enforces the "not a valid object property" part of the IllegalArgumentException declaration on Validator.validateValue(Class, String, Object, Class...)
      • testGetConstraintsForNullProperty

        public void testGetConstraintsForNullProperty()
        Checks that an IllegalArgumentException is thrown when calling BeanDescriptor.getConstraintsForProperty(String) with an invalid property name.
      • testGetConstraintsForEmptyProperty

        public void testGetConstraintsForEmptyProperty()
        Checks that an IllegalArgumentException is thrown when calling BeanDescriptor.getConstraintsForProperty(String) with an invalid property name.