Objective:
A few days ago encountered a strange problem-with springjunit test, the operation of the method of what reaction is not, the console also has no output, Baidu has no answer-had to temporarily forget. today I had to use the elimination method, to build a small test project, as long as a few spring related jar can be tested in, test normal, and then began to compare with the original project to exclude the jar, to see in the end is which/which jars caused the jar conflict, The result was beyond my expectation-even my own brother! Originally this project also has a junit-4.4 jar, delete it just fine. (When the project build path adds a junt4 dependency, it imports the appropriate jar and conflicts with it.) ) hey ... I directly enlarge the recruit, wasting vitality. Since it's a test exception, how can I start thinking about testing jar conflicts? In that case, a minute is almost ready--it's the biggest thought.
The following is a description of the problem and troubleshooting and resolution procedures:
Problem Description:
Springjunit tested a method, found that the console reported a null pointer (which was later reported, was blank at first, and nothing), and the JUnit program did not respond.
Null pointer exception Analysis for the console report:
Right-click into the jar where the exception is located (I have installed the anti-compilation, if the item exists the jar is absolutely accessible.) ), found below the purple box in the method where the class is not found!
Such as:
Is it the eclipse (I'm using STS, like Eclipse)?
But I can test it with other projects. This is certainly not a tool problem. caused by--jar.
Next I'll add a jar to the normal test project and see where to add it, and finally check out the pit cargo:
WORKAROUND: Delete the jar.
PostScript: may also be related to the tool. Since the development was myeclipse, now I am using eclipse, so it is not ruled out that MyEclipse can test this possibility.
SPRINGJUNIT4 test--Test unresponsive/console report NULL pointer resolution---JUNIT JAR conflict!