Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313467 - [JUnit] Old method name is kept in launch config after changing the test class
Summary: [JUnit] Old method name is kept in launch config after changing the test class
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-19 03:02 EDT by Meng Xin Zhu CLA
Modified: 2013-11-10 22:32 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Meng Xin Zhu CLA 2010-05-19 03:02:51 EDT
Build Identifier: 3.6 I20100513-1500

Stale test method name is kept after changing the test class in JUnit Plug-in Test run configuration

Reproducible: Always

Steps to Reproduce:
1. create a new JUnit Plug-in Test
2. select one Test class said as TestClassA
3. select one test method of TestClassA, said as testMethodA
4. run test, it works ok
5. change Test class to TestClassB
The test method still is testMethodA that doesn't exist in TestClassB.
junit test would be failed if running it.
Comment 1 Curtis Windatt CLA 2010-05-19 09:50:03 EDT
The UI you are modifying on the junit test tab is provided by JDT.  Moving to them for comment.

When I change the class, an error message is displayed in the launch configuration dialog "Can not find test method [foo] in project [bar]".  However, the debug button is still enabled.

Perhaps this tab should work similarly to the Java Application main tab which disables the debug button when main class is not specified.
Comment 2 Markus Keller CLA 2010-06-04 10:11:52 EDT
That's actually by design.

The "Test method" field in the launch configuration determines the "name" of the test. Since the JUnit nomenclature is quite fuzzy, and the default implementation of TestCase interprets the "name" as methods name, we've called the field "Test method" in the UI.

Other implementations of TestCase can use the "name" in a different way, and that's why the Run/Debug button is not disabled, even when then test class does not contain a method with the given name. The UI shows an error message, and if you ignore that, it's your choice ;-)