How to know the version of JUnit in Eclipse

前端 未结 7 841
甜味超标
甜味超标 2021-01-11 18:55

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

相关标签:
7条回答
  • 2021-01-11 19:31

    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.

    0 讨论(0)
  • 2021-01-11 19:33

    If you are cloned existing maven project and you want to check on which version your tests will run then you can check Junit version in you pom.xml file.

    If you print your junit version from code then it will print from your maven repository i.e. the version present in your pom.xml

    import junit.runner.Version;
    System.out.println("Version="+Version.id()); 
    
    0 讨论(0)
  • 2021-01-11 19:43
    version of junit.jar will tell u the version of your JUNIT in eclipse. I think it may be 
    hidden in that jar
    
    0 讨论(0)
  • 2021-01-11 19:45

    Go to the project properties --> java build path --> in libraries tab you will see the junit jar. see the version on it.

    0 讨论(0)
  • 2021-01-11 19:47

    what ever junit jar you might have upload to build path in eclipse will be the version of junit.

    0 讨论(0)
  • 2021-01-11 19:50

    This morning I tried to run one of my test and I faced this issue.

    The best solution I found which fixed my issue is this :

    Select your spring boot project name in Package Explorer Right Click Select Maven Update Project

    enter link description here

    0 讨论(0)
提交回复
热议问题