-Mock object
Http://www.ibm.com/developerworks/library/j-mocktest.html
Mock object generate Tool
Initially, the mock object was manually written by the tester. In this way, it will inevitably lead to the disadvantages of low efficiency in writing test cases and difficulties in writing test cases, and may even affect the passion of XP practitioners for "test first. At this time, a variety of tools have emerged to help create mock objects.
Among these tools, there are mockobjects, XDoclet, and other help tools.ProgramYou can also compile mock object implementation tools, such as easymock and mockcreator, to automatically create mock object instances/classes. This article only describes the latter.
Among these tools that can automatically create mock object instances/classes, there are two types: one is similar to easymock, they can dynamically create mock object instances; the other is like mockcreator, they can generate static mock objects.Code. The most famous and currently maintained tools include mockobjects, easymock, and mockcreator. Below, we will use these tools to write unit test code for the following classes, and compare their usage similarities and differences one by one:
Http://tech.ccidnet.com/art/3737/20051017/472031_1.html