Test-driven Development theory has been put forward for many years, here about his principles and advantages I do not say, I will outline the practice of the use of TDD process.
Fill a Jar:commons-pool-1.4.jar
Process
1. Build test Case running environment
2. Writing interface class
3. Write Test cases for interface class
4, implement the interface class, write the corresponding function code
5, run the test
6, if not passed, modified until passed
7, cycle to complete other functions
Build test Case running environment
One of the main benefits of the dependency injection technology used by spring is that your code relies more heavily on the container than the traditional Java EE development. With the test framework Spring TestContext framework provided by spring, it becomes very easy to build a test case runtime environment. The detailed usage of the Spring TestContext framework is referenced in Chapter 8.3.7 of the Spring2.5 reference manual.