Troubleshooting
Problem
Attempts to create a new test suite from a collection of JUnit 4.x test cases using IBM Rational Application Developer for WebSphere Software 7.5 New JUnit Test Suite Wizard results in no classes appearing to select.
Symptom
Rational Application Developer 7.5 New JUnit Test Suite Wizard recognizes only JUnit 3.x test cases when trying to create a new test suite.
Cause
This feature is missing from Eclipse 3.4 upon which Rational Application Developer 7.5 is based.
This issue is identified as an Eclipse defect and has been logged as Bug 155828 in Bugzilla.
Resolving The Problem
WORKAROUND:
- Create a test suite without test classes.
- Manually edit the skeleton test suite class to run JUnit 4.x test cases.
Example:
The AllTests.java test suite to run two test cases (HelloTest.java and HelloAgainTest.java) would look like this:
------------------------------------------------------------------
package something.com;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({HelloTest.class, HelloAgainTest.class})
public class AllTests {}
------------------------------------------------------------------
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21363984