3 ms·
It is true that unit testing code that was not designed for testing can be difficult, but it is certainly possible. Java reflection can set data values in priv
by Erikagd77 16y ago
It is true that unit testing code that was not designed for testing can be difficult, but it is certainly possible. Java reflection can set data values in private fields for times when the original class did not include a setter method for testing. Commerical solutions, like http://tinyurl.com/4rabnef http://tinyurl.com/4rabnef, provide stubbing frameworks to replace method calls at runtime and inject test data without rewriting the original code.