Quote:
The JSR303 draft specification does not discuss or even hint at how the proposed validation rules, expressed as annotations, might be unit tested.
The JSR 303 doesn't need to tell you how to write test cases. The purpose of the JSR is to outline the specification so the standard is fully expressed for various vendors to implement. Since most of the classes in the API are interfaces, you're free to create stubs or mock up your own implementations.
Quote:
In organizations that routinely use automated unit testing (I work in one), the cost of developing tests for application code often significantly exceeds the cost of writing it.
I don't mean to start argument here, but you don't understand the purpose of unit testing. Maybe you should grab a book on TDD and do some research on the subject.
Quote:
Therefore, it is insufficient to have a validation mechanism that is itself consise and flexible; one needs to be able to easily write unit tests that verify the applied validations are in fact operating.
You're totally missing the purpose of this JSR. It has *nothing* to do with unit testing. I can't see how its not testable since it doesn't require a container. You're Validators are just Java objects that are passed information that you can mock up.
Quote:
How does this apply to JSR303? Well, for starters, the ability to unit test a particular field validation rule in isolation, without (a) needing eg an app server running, and (b) firing all other validation rules, would be desirable.
Try reading the specification. In particular the review of the Validator<T> API.
I'm trying to be helpful, but please read the specification and try to contribute to the growth of the JSR and help flesh out any short comings to the API itself.
Best Regards,
Richard L. Burton III