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

Bug 332424

Summary: [releng] Runtime build fails with Junit4
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RelengAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: a_mergey
Version: 1.4   
Target Milestone: 1.5 M3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ralf Sternberg CLA 2010-12-13 05:57:59 EST
The RAP runtime build fails with the following exception when junit 4 is included in the base platform:

-----
BUILD FAILED
/home/build/rap/build-runtimes/eclipse-3.6/plugins/org.eclipse.pde.build_3.6.0.v20100603/scripts/build.xml:39: The following error occurred while executing this line:
/home/build/rap/build-runtimes/eclipse-3.6/plugins/org.eclipse.pde.build_3.6.0.v20100603/scripts/build.xml:139: The following error occurred while executing this line:
/home/build/.hudson/jobs/RAP Runtime/workspace/builder/customTargets.xml:64: The following error occurred while executing this line:
/home/build/.hudson/jobs/RAP Runtime/workspace/builder/customTargets.xml:124: java.lang.UnsupportedClassVersionError: junit/framework/Test (Unsupported major.minor version 49.0)
-----

The current workaround is to remove all junit4 bundles from the plugins directory in the base platform.
Comment 1 Arnaud MERGEY CLA 2011-04-21 05:21:07 EDT
Another issue is when we try to build a RAP project with Tycho and junit 4 is included in the base platform, we have some issues about dependency resolution, because of org.eclipse.rap.junit and org.eclipse.rap.junit.runtime.

These bundles declare junit dependency using a range [3.8.2,4.0.0) so junit 4 is excluded

According to http://wiki.eclipse.org/Eclipse/Testing/JUnit4_Changes

"Some test bundles express a narrow version range on org.junit 3.x, such as "[3.8.0,4.0.0)". Such test bundles won't resolve against JUnit4, and hence require updating the version range. Since JUnit is not an eclipse.org project and doesn't necessarily follow our version evolution semantics, the safest approach is to only specify the lower bound dependency. If you still want to be able to run with JUnit3, use a range of "3.8.0". If you only want to run on JUnit4, you can use a range of "4.8.1"."

org.eclipse.rap.junit and org.eclipse.rap.junit.runtime should probably declare junit dependency as "3.8.2"
Comment 2 Ralf Sternberg CLA 2011-04-25 03:33:51 EDT
(In reply to comment #1)
The rap.junit bundles exclude JUnit4 on purpose, they currently only work with JUnit3. If you like to request to make these bundles compatible with JUnit4, please open a separate enhancement request.
Comment 3 Ralf Sternberg CLA 2011-10-15 12:18:15 EDT
This issue was specific to the PDE build. With the new tycho build (bug 354781), this doesn't happen anymore.