IBM Support

JUnit 4.x test cases cannot be selected in New JUnit Test Suite Wizard

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:

  1. Create a test suite without test classes.
  2. 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 {}

------------------------------------------------------------------

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Eclipse","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"7.5;7.5.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS4JCV","label":"Rational Software Architect for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Eclipse","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5;7.5.1","Edition":"All Editions","Line of Business":{"code":"LOB15","label":"Integration"}}]

Document Information

Modified date:
16 June 2018

UID

swg21363984