Bug 21255 - Create JUnit TestSuite creates invalid code [JUnit]
Summary: Create JUnit TestSuite creates invalid code [JUnit]
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2002-07-05 06:01 EDT by Jon Skeet CLA
Modified: 2002-10-18 05:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Skeet CLA 2002-07-05 06:01:22 EDT
Running R2.0 on Windows 2000, JDK 1.3.1.

I've just started playing around with Eclipse's JUnit support, and after
creating a couple of tests I created a test suite. The essential bit of the code
that was generated was:

	public static Test suite()
	{
		TestSuite suite = new TestSuite("Test for com.peramon.test");
		//$JUnit-BEGIN$
		suite.addTest(new TestSuite(TelephoneNumberFormatterTest.class));
		suite.addTest(new TestSuite(StringUtilTest.class));
		//$JUnit-END$
		return suite;
	}

The method declaration should have TestSuite, not Test, as the return type.

I believe the error is in NewTestSuiteCreationWizardPage.getSuiteMethodString().

Jon
Comment 1 Erich Gamma CLA 2002-10-18 05:16:40 EDT
A TestSuite is a Test and returning Test is correct