Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the version of JUnit in Eclipse

In eclipse:

  1. Window --> Preferences
  2. Expand Java at left side of panel --> JUnit is there under Java

How can I know the version of JUnit in eclipse?

like image 526
Ripon Al Wasim Avatar asked May 24 '13 07:05

Ripon Al Wasim


2 Answers

You can use this code:

import junit.runner.Version;

System.out.println("JUnit version is: " + Version.id());
like image 170
fortytwo Avatar answered Sep 28 '22 11:09

fortytwo


If you selected JUnit4 over JUnit3, the version that Eclipse uses is the one in eclipse/plugins/org.junit_XXXX. For Eclipse Luna, it is eclipse/plugins/org.junit_4.11.0.v201303080030. Note that if you want to change it, based on all the things I tried, you can replace the junit.jar contained inside with the version you want.

like image 43
Raul Santelices Avatar answered Sep 28 '22 13:09

Raul Santelices