C
Christopher Benson-Manica
I am planning to write a utility class that will use reflection to
automatically exercise the getters and setters for a given object - it
will call all the set*() functions for the object that take primitives
or Strings (passing default values), keep track of what was passed to
each method, and then call get*() and verify that the return value is
as expected. The class will also be able to take two objects of the
same class and invoke all the get*() functions on each, and verify
that the values returned are identical.
My feeling is that I'm surely not the first person to want to do this,
so my question is has this been done before, and if so, where can I
obtain the library? I'm more than up to the task of writing it
myself, but I always prefer to build on existing work where possible.
Thanks!
automatically exercise the getters and setters for a given object - it
will call all the set*() functions for the object that take primitives
or Strings (passing default values), keep track of what was passed to
each method, and then call get*() and verify that the return value is
as expected. The class will also be able to take two objects of the
same class and invoke all the get*() functions on each, and verify
that the values returned are identical.
My feeling is that I'm surely not the first person to want to do this,
so my question is has this been done before, and if so, where can I
obtain the library? I'm more than up to the task of writing it
myself, but I always prefer to build on existing work where possible.
Thanks!