lundi 11 mai 2015

Upgrade to JUnit 4 in Eclipse

I tried switching to JUnit 4 in Eclipse using the instructions in this answer: http://ift.tt/1IwEE3T.

It basically says to remove any JUnit 3 library in the build path (I removed a JUnit 3.7 jar) and add the JUnit 4 library, which I did.

However, when I run the following code in my test class:

import junit.runner.Version;
System.out.println("JUnit version is: " + Version.id());

I get:

JUnit version is: 3.8.1

I don't have any other JUnit libraries in my buildpath.

If it's relevant, the exact Eclipse version is "Indigo Service Release 1, Build id: 20110916-0149".

How can I fix this and run JUnit 4?

Aucun commentaire:

Enregistrer un commentaire