Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352078

Summary: [JUnit] drop support for JUnit 3.x
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Moritz Eysholdt CLA 2011-07-14 09:10:34 EDT
I know that this is nothing that we can do within a day, however, the legacy of using JUnit 3.x is starting to get painful for me (an probably not only me), that's why I'm bringing this up.

Two issues:

(1) JUnit tests randomly fail for me with the message "No tests found in foo.BarTest". The cause is that both Junit 3.x and 4.x export the class "junit.framework.TestCase". When both are on the classpath it seems kinda random which one is being used, especially since we dealing with both a flat and an OSGi-style classpath.

In some cases I can work around this problem by either import JUnit 3.x xor JUnit 4.x. This worked fine for o.e.xtext.junit and o.e.xtext.junit4.

It fails however for o.e.xtext.xbase.junit, because in there JUnit 3.x and 4.x are use at the same time: o.e.xtext.xbase.junit.evaluation.AbstractXbaseEvaluationTest extends Junit3's TestCase and uses Junit4's @Test annotations.

Another workaround could be to use a version of JUnit 4 that doesn't include the classes from JUnit 3 for backwards compatibility. This would require a change in our target platform.

(2) The plugins org.eclipse.xtext.junit and org.eclipse.xtext.junit4 have exactly the same contents, except that they use different versions of JUnit. I would really like to get rid of this redundancy.
Comment 1 Sven Efftinge CLA 2012-11-22 07:44:59 EST
We've migrated our tests to Junit4. We can't remove org.eclipse.xtext.junit, as it is exposed API.
Comment 2 Eclipse Webmaster CLA 2017-10-31 11:25:23 EDT
Requested via bug 522520.

-M.