Monday, March 8, 2010

Spring EYE on JAVA EE - 3

Notice the similarity of unit test class among most entity classes, it is a good time to refactor this similarity into a more robust test class. EntityTest.java is the result. Retest all unit test.


EntityTest.java




Now the ProductTest.java can be rewritten in such a clean way. Only thing left for individual entity test is to properly set the object to be tested.


ProductTest.java




The above process represents a mini-serious of develop-test-refactor cycle, and it will be followed in the subsequent development.



Previous    Next

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home