Bug 460709 - [JUnit] Set Source folder in New JUnit Test Case dialog
Summary: [JUnit] Set Source folder in New JUnit Test Case dialog
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Windows 7
: P5 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-24 10:07 EST by Ben Tatham CLA
Modified: 2016-05-20 11:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Tatham CLA 2015-02-24 10:07:45 EST
When creating a _New JUnit Test Case_, the default _Source folder_ is ${project}/src/main/java.  With m2e, we know that it should be ${project}/src/test/java.  This should be automatically set.
Comment 1 Ben Tatham CLA 2015-02-24 10:08:21 EST
I'll look into this and see if I can figure it out for #greatfix, hopefully by the end of March 2015.
Comment 2 Fred Bricon CLA 2016-05-20 11:07:09 EDT
@Dani the "New JUnit Test Case" is owned by JDT.

The src/main/test folder convention is shared by other build tools, at the very least gradle, so it's not something specific to m2e

One approach for the fix would be to "guess" test folders by looking at source classpath entries, see if it contains test. In case of ambiguous folders (src/test/java vs src/test/resources), then use src/test/java as a sensible default.

The alternative would be to introduce an extension point to let build tools plugin list the default source location, but that's a bit overkill IMO.