Eclipse JUnit - possible causes of seeing “initializationError” in Eclipse window

后端 未结 25 1211
情深已故
情深已故 2020-12-13 12:35

I know this question is pretty general but I haven\'t found any hints on why this error may show up. What are possible causes of seeing initalizationError in Eclips

相关标签:
25条回答
  • 2020-12-13 12:55

    Just try "Project > Clean..." - seems to be THE solution to many problems in Eclipse!

    0 讨论(0)
  • 2020-12-13 12:55

    My mistake was that I missed out @Test annotation on the test method.

    0 讨论(0)
  • 2020-12-13 12:55

    I had the same issue... I was using maven building tool with JUnit dependency scope as 'test' and my @Test method was in main module.

    To resolve, I've: 1. Commented the scope tag of JUnit dependency in the pom.xml 2. Rebuilt the package 3. Made sure the Test class has only one constructor

    The issue can be two-folded: 1. The JUnit dependency is limited to test scope and the @Test method is in main scope 2. The test class has more than one constructor

    0 讨论(0)
  • 2020-12-13 12:55

    Junit 4.11 doesn't work with Spring Test framework. Also this link InitializationError When Use Spring + Junit explains how to debug junit initalizationError in eclipse.

    0 讨论(0)
  • 2020-12-13 12:57

    I received this error when the class was annotated with @Ignore and I tried to run a specific test via right clicking on it. Removing the @Ignore fixed the problem.

    0 讨论(0)
  • 2020-12-13 12:57

    I had the same problem: Once it was excel path issue and other time it was missing @Test annotation.

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