Community
Participate
Working Groups
Build Identifier: 20100218-1602 When creating a new junit test case, the test case gets created by default in the appropriate subdirectory of /src/main. I would like that to be a subdir of /src/test instead. Perhaps consider choosing the destination folder with "test" in the name as the suggestion, or remember the last directory that the user put in... Reproducible: Always Steps to Reproduce: create a new Junit test case.
> Perhaps consider choosing the destination folder with "test" in the name as the > suggestion, or remember the last directory that the user put in... We don't want to add hidden smartness based on the name. Using the last recently used would have been an option at the beginning but changing it now would be too surprising for existing users. Once bug 224708 is fixed we would use the test folder.
Or we could look for a folder that we recognize as having test classes.
*** Bug 400980 has been marked as a duplicate of this bug. ***
Just wanted to open a new bug for the issue, but glad I found this one before, so I want to vote for it... I doubt to consider this as hidden smartness, at least not for maven based projects where in the default layout src/test IS the folder for test code (if not overridden in the pom). Quite the contrary, I (and likely also other existing users) find it surprising that my test cases get placed under src/main by Eclipse every time I create one - it's not the behaviour you would expect (again, for maven based projects) and more than once took me hours to diagnose errors caused by it.
New Gerrit change created: https://git.eclipse.org/r/103588
New Gerrit change created: https://git.eclipse.org/r/105839
(In reply to Eclipse Genie from comment #6) > New Gerrit change created: https://git.eclipse.org/r/105839 gerrit for the master
(In reply to Till Brychcy from comment #7) > (In reply to Eclipse Genie from comment #6) > > New Gerrit change created: https://git.eclipse.org/r/105839 > gerrit for the master - Create a Java project. - Select project name in Package Explorer. - Invoke "JUnit Test Case" or "JUnit Test Suite" wizard. We get this exception: java.lang.NullPointerException at org.eclipse.jdt.ui.wizards.NewContainerWizardPage.initContainerPage(NewContainerWizardPage.java:158) at org.eclipse.jdt.junit.wizards.NewTestCaseWizardPageOne.init(NewTestCaseWizardPageOne.java:226) ...
(In reply to Noopur Gupta from comment #8) > (In reply to Till Brychcy from comment #7) > > (In reply to Eclipse Genie from comment #6) > > > New Gerrit change created: https://git.eclipse.org/r/105839 > > gerrit for the master > - Create a Java project. > - Select project name in Package Explorer. > - Invoke "JUnit Test Case" or "JUnit Test Suite" wizard. We get this > exception: > > java.lang.NullPointerException > at > org.eclipse.jdt.ui.wizards.NewContainerWizardPage. > initContainerPage(NewContainerWizardPage.java:158) > at > org.eclipse.jdt.junit.wizards.NewTestCaseWizardPageOne. > init(NewTestCaseWizardPageOne.java:226) > ... Thanks, a null check was missing. I've updated the gerrit.
Gerrit change https://git.eclipse.org/r/105839 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e078c4d50c5ac22db54ca327596e5280e98c1c60
(In reply to Eclipse Genie from comment #10) > Gerrit change https://git.eclipse.org/r/105839 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/ > ?id=e078c4d50c5ac22db54ca327596e5280e98c1c60 Released for 4.8M5
*** Bug 529944 has been marked as a duplicate of this bug. ***
Verified in I20180122-2000.
*** Bug 77980 has been marked as a duplicate of this bug. ***
*** Bug 49611 has been marked as a duplicate of this bug. ***