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

Bug 360797

Summary: Allow use of junit4 in org.eclipse.equinox.p2.tests
Product: [Eclipse Project] Equinox Reporter: Tobias Oberlies <t-oberlies>
Component: p2Assignee: Tobias Oberlies <t-oberlies>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: remy.suen
Version: 3.8.0 Juno   
Target Milestone: Juno M3   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Tobias Oberlies CLA 2011-10-13 07:30:42 EDT
Currently, it is not possible to add JUnit4 tests to org.eclipse.equinox.p2.tests. While it is possible to include a junit4 test in an junit3 suite (using the JUnit4TestAdapter [1]), these test will not execute because the javacTarget=jsr14 setting strips the @Test annotations.

Junit4 brings a ton of new, useful features (e.g. Rules) which should be available to efficiently write tests.

As far as I am aware, it is sufficient to change the output class format for org.eclipse.equinox.p2.tests from jsr14 to 1.5. While Equinox may need to run on 1.4, I don't see why the tests have to. From what I could find here [2], the p2 tests are only executed on 1.5 and 1.6 VMs anyway.

[1] http://junit.sourceforge.net/
[2] http://download.eclipse.org/eclipse/downloads/drops/S-3.8M2-201109151308/testResults.php
Comment 1 Tobias Oberlies CLA 2011-10-25 11:22:09 EDT
Changed with 4f57e452. Let's see what the nightly build brings...
Comment 2 Tobias Oberlies CLA 2011-10-28 07:33:53 EDT
Changing the class format of o.e.e.p2.tests seems to have worked in the central build: http://download.eclipse.org/eclipse/downloads/drops/I20111027-1300/testresults/html/org.eclipse.equinox.p2.tests_linux.gtk.x86_6.0.html

I should now be possible to write junit4 tests in that bundle (see description).