Bug 281748 - [JUnit] org.junit.runner.JUnitCore.runClasses ignores Tests, if other Tests are annotated with @Ignore
Summary: [JUnit] org.junit.runner.JUnitCore.runClasses ignores Tests, if other Tests a...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-06-27 12:48 EDT by Florian Pilz CLA
Modified: 2009-07-06 09:32 EDT (History)
1 user (show)

See Also:


Attachments
Our classes, which produced the error (72.58 KB, application/zip)
2009-06-27 12:49 EDT, Florian Pilz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Pilz CLA 2009-06-27 12:48:19 EDT
Build ID: I20090611-1540

Steps To Reproduce:
1. Write a class, which invokes a JUnit-Class (loaded dynamically).
2. Write a test for this class, which should prove its correctness.
3. Write a JUnit-Class, which will be load dynamically by (1.). This class should contain 3 tests: first a normal (succesfull) testMethod, second a testMethod annotated with @Ignore, third another normal (successfull) testMethod.


More information:
This bug first occured in Eclipse 3.5.0
We used 3.4.2 a lot and this bug never occured. With 3.5.0 our JUnit-Test (explained afterwards) failed out of a sudden.

It's a little bit complicated, because we are writing a program, which invokes JUnit-Tests on external code. The class which do that has an JUnit-Test to prove it's correctness. So the Eclipse-Runner tests our code, which uses the Eclipse-Runner to test "external code". (In the test the "external code" is known, prepared code.)

The problem is: If you have tests, annotated with @Ignore and other normally successfull tests (not annotated with @Ignore) behind an ignored test, they will be ignored, too.

In the attached example 2 methods will fail, because 3 tests should run but only the first 2 will run. (Makes difference in calculated points.)
Comment 1 Florian Pilz CLA 2009-06-27 12:49:18 EDT
Created attachment 140303 [details]
Our classes, which produced the error
Comment 2 Dani Megert CLA 2009-06-29 05:12:53 EDT
The attached code doesn't compile. Could you please attach an example (best would be an eclipse project that we can import) that allows reproduce the problem?
Comment 3 Dani Megert CLA 2009-07-06 09:32:32 EDT
Cannot reproduce without more detailed information/steps.