JUnit4 + Eclipse “An internal error occurred during Launching”

后端 未结 10 1589
深忆病人
深忆病人 2020-12-09 16:37

I\'m trying to run JUnit4 test cases on Eclipse 3.4.2 but it\'s not even starting for me. I have the junit-4.7.jar in my build path and the test application.

Here i

相关标签:
10条回答
  • 2020-12-09 17:36

    Your code works fine for me.

    Eclipse Version: 3.4.1 Build id: M20080911-1700

    I right click on the .java file RunAs JUnit Test. This would indicate the problem is caused by an Eclipse configuration problem, not a code problem.

    0 讨论(0)
  • 2020-12-09 17:36

    I encountered a similar problem but I am using Python. This is what I did to solve/avoid it:

    1. Removed my .project file and the project from Eclipse.
    2. Created the project again.
    3. Everything was working.

    The problem seemed to be in the .project file where there were some references to CDT Builder and were not there in the new .project file.

    0 讨论(0)
  • 2020-12-09 17:37

    If you are using Android and its associated plugins, then Android only supports JUnit 3.

    I resolved the problem by selecting Test Runner as JUnit 3.

    In my class, JUnit 4 is added in the build path->libraries.

    Then to run the test file, go to: Run As -> Run Configurations then select the corresponding test.java file and select Test Runner accordingly(whether it is JUnit 3 or 4).

    0 讨论(0)
  • 2020-12-09 17:42

    Have you looked in the Eclipse error log? You can see it by opening the "Error Log" view.

    http://help.eclipse.org/help32/topic/org.eclipse.pde.doc.user/guide/tools/views/error_log.htm

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