public void testIsValid() {
AnnotationDescriptor<Length> descriptor = new AnnotationDescriptor<Length>( Length.class );
descriptor.setValue( "min", 1 );
descriptor.setValue( "max", 3 );
descriptor.setValue( "message", "{validator.length}" );
Length l = AnnotationFactory.create( descriptor );
LengthValidator constraint = new LengthValidator();
constraint.initialize( l );
assertTrue( constraint.isValid( null, null ) );
assertFalse( constraint.isValid( "", null ) );
assertTrue( constraint.isValid( "f", null ) );