Is there a framework that supports generating some standard unit tests from annotations? An example of what I have in mind would be:
@HasPublicDefaultConstructor
public class Foo {
}
This would obviously be used to automatically generate a unit test that checks whether Foo has a default constructor. Am I the only person who thought of something like that yet? ;) While I'm most interested in Java, solutions in other languages would certainly be interesting, too.
EDIT: In response to S.Lott's answer, let me clarify:
I'm trying to test whether the class has a default constructor. (Of course that is just an example.) I could just do so by writing a test, but I find that quite tedious. So I'm looking for a tool that would process the annotations at compile time (via APT) and generate the test for me. Does something like that exist? If not, do you think it is a good idea?