1. The preceding article
The new skills you've just learned, the knowledge of JUnit is also a fur level, and take notes here. If the great God has a more complete or more convenient use of the operation, I hope to share, we study together: 2. Body 2.1 Environment
Idea 14.1.7 Version 2.2 Scenario Settings
Existing A class Studentdaoimpl, there are the following methods
public class Studentdaoimpl implements Istudentdao {public
void Save (Student Student) {//Save logic ...}
public void Update (Student Student) {//update logic ...}
}
question: How do you use JUnit tests for this class? --as shown in the figure: 2.3 Use process as diagram operation
Or you can use shortcut keys in this class page: Ctrl+shift+t, the effect is the same. As shown in the figure
Click Test to eject the following box
Click OK and idea will automatically help us create the test class code
Write good test code and run test methods. As shown in figure
Finally click Run ' method name ' to execute the test method.
Reprint please indicate the source: http://blog.csdn.net/czd3355/article/details/53572989