JUnit for Java 1.4

2019-05-08 03:32发布

问题:

Which version of JUnit works for Java 1.4? Looking at the JUnit 3 and 4 docs, I can't figure it out.

Thanks!

回答1:

JUnit 4 is backward-compatible with JUnit 3. You would have to confine yourself to the JUnit 3 API, obviously, since annotations are out of the question for jdk1.4. The bigger problem is that JUnit 4 classes would be compiled with jdk1.5, which the java 1.4 compiler would probably not like. Since you can't benefit from the newer functionality anyway you should probably stick with JUnit 3.



标签: java junit