Package org.apache.bval.jsr
Class ExceptionsContractTest
- java.lang.Object
-
- org.apache.bval.jsr.ValidationTestBase
-
- org.apache.bval.jsr.ExceptionsContractTest
-
public class ExceptionsContractTest extends ValidationTestBase
Several checks to validate that the implementations ofValidatorandBeanDescriptorthrow the correct exceptions as per the spec.- Author:
- Carlos Vara
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExceptionsContractTest.ExceptionThrowingBeanstatic classExceptionsContractTest.Person
-
Field Summary
-
Fields inherited from class org.apache.bval.jsr.ValidationTestBase
factory, validator
-
-
Constructor Summary
Constructors Constructor Description ExceptionsContractTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidtestExceptionThrowingBean()Checks that the correct exception is thrown when validating a bean whose getter throws an exception.voidtestGetConstraintsForEmptyProperty()Checks that anIllegalArgumentExceptionis thrown when callingBeanDescriptor.getConstraintsForProperty(String)with an invalid property name.voidtestGetConstraintsForNullProperty()Checks that anIllegalArgumentExceptionis thrown when callingBeanDescriptor.getConstraintsForProperty(String)with an invalid property name.voidtestValidateEmptyPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing an empty property name.voidtestValidateIncompatiblePrimitiveValue()Enforces the "not a valid object property" part of theIllegalArgumentExceptiondeclaration onValidator.validateValue(Class, String, Object, Class...)voidtestValidateIncompatibleValue()Enforces the "not a valid object property" part of theIllegalArgumentExceptiondeclaration onValidator.validateValue(Class, String, Object, Class...)voidtestValidateInvalidPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing an invalid property name.voidtestValidateNullGroup()Checks that anIllegalArgumentExceptionis thrown when passingnullas group array.voidtestValidateNullPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing anullproperty name.voidtestValidatePropertyNullGroup()Checks that anIllegalArgumentExceptionis thrown when passingnullas group array in aValidator.validateProperty(Object, String, Class...)call.voidtestValidatePropertyOnNullBean()Checks that anIllegalArgumentExceptionis thrown when trying to validate a property on a null object.voidtestValidateValueEmptyPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing an empty property name toValidator.validateValue(Class, String, Object, Class...).voidtestValidateValueInvalidPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing an invalid property name toValidator.validateValue(Class, String, Object, Class...).voidtestValidateValueNullGroup()Checks that anIllegalArgumentExceptionis thrown when callingValidator.validateValue(Class, String, Object, Class...)with anullgroup array.voidtestValidateValueNullPropertyName()Checks that anIllegalArgumentExceptionis thrown when passing anullproperty name toValidator.validateValue(Class, String, Object, Class...).voidtestValidateValueOnNullClass()Checks that anIllegalArgumentExceptionis thrown when callingValidator.validateValue(Class, String, Object, Class...)with anullclass.-
Methods inherited from class org.apache.bval.jsr.ValidationTestBase
createValidator, setUp, setupValidatorFactory
-
-
-
-
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 anIllegalArgumentExceptionis thrown when passingnullas group array.
-
testValidateNullPropertyName
public void testValidateNullPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing anullproperty name.
-
testValidateEmptyPropertyName
public void testValidateEmptyPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing an empty property name.
-
testValidateInvalidPropertyName
public void testValidateInvalidPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing an invalid property name.
-
testValidatePropertyOnNullBean
public void testValidatePropertyOnNullBean()
Checks that anIllegalArgumentExceptionis thrown when trying to validate a property on a null object.
-
testValidatePropertyNullGroup
public void testValidatePropertyNullGroup()
Checks that anIllegalArgumentExceptionis thrown when passingnullas group array in aValidator.validateProperty(Object, String, Class...)call.
-
testValidateValueOnNullClass
public void testValidateValueOnNullClass()
Checks that anIllegalArgumentExceptionis thrown when callingValidator.validateValue(Class, String, Object, Class...)with anullclass.
-
testValidateValueNullPropertyName
public void testValidateValueNullPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing anullproperty name toValidator.validateValue(Class, String, Object, Class...).
-
testValidateValueEmptyPropertyName
public void testValidateValueEmptyPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing an empty property name toValidator.validateValue(Class, String, Object, Class...).
-
testValidateValueInvalidPropertyName
public void testValidateValueInvalidPropertyName()
Checks that anIllegalArgumentExceptionis thrown when passing an invalid property name toValidator.validateValue(Class, String, Object, Class...).
-
testValidateValueNullGroup
public void testValidateValueNullGroup()
Checks that anIllegalArgumentExceptionis thrown when callingValidator.validateValue(Class, String, Object, Class...)with anullgroup array.
-
testValidateIncompatibleValue
public void testValidateIncompatibleValue()
Enforces the "not a valid object property" part of theIllegalArgumentExceptiondeclaration onValidator.validateValue(Class, String, Object, Class...)
-
testValidateIncompatiblePrimitiveValue
public void testValidateIncompatiblePrimitiveValue()
Enforces the "not a valid object property" part of theIllegalArgumentExceptiondeclaration onValidator.validateValue(Class, String, Object, Class...)
-
testGetConstraintsForNullProperty
public void testGetConstraintsForNullProperty()
Checks that anIllegalArgumentExceptionis thrown when callingBeanDescriptor.getConstraintsForProperty(String)with an invalid property name.
-
testGetConstraintsForEmptyProperty
public void testGetConstraintsForEmptyProperty()
Checks that anIllegalArgumentExceptionis thrown when callingBeanDescriptor.getConstraintsForProperty(String)with an invalid property name.
-
-