This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE 7.4 Beta (Build 201307092200) Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b17 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\quaglan\AppData\Roaming\NetBeans\7.4beta Cache directory: C:\Users\quaglan\AppData\Local\NetBeans\Cache\7.4beta
Same projects works fine in 7.3.1 and worked fine in first 7.4 beta
I am sorry, but I have no idea what are you talking about, could you please write down exact steps to reproduce or/and provide screenshot ? Thanks in advance.
Sure, I right-click inside a JUnit test and the "Run Focused Test" item is greyed out. The very same project and file work fine in previous versions.
What kind of project is that? Ant or Maven based? Can you attach a sample?
Java/Maven project.
It only happens for some of the test classes.
Created attachment 136962 [details] One Unit Test class for which Run Focused Test is greyed out
I have switched back to 7.3.1
I know that there have been changes of this functionality and that the previous messaging has been amended but in this release I do not see any message at all.
I think I have reproduced this problem. The "Run Focused Test Method" popup menu is disabled inside tested class even in NetBeans 7.3.1 but the truth is that in the test class itself it is enabled and executes the selected test while this does not work in NetBeans 7.4 Beta. Talking about Maven based project. In Ant based project it all works fine. Theofanis, feel free to stop by my desk today if you cannot reproduce it.
I have found some time to do some additional testing. The issue is caused by the unit test class name being different from the test class. The tested class is INSPIREResourceRepresentation The test class is INSPIREResourceRepresentationTest10 If the test class is named INSPIREResourceRepresentationTest everything works fine. Is this some additional requirement from JUnit 4? Shall I change my code and put all test methods in a single class file? That would be a problem for me. I raise the priority of this issue since the upgrade to JUnit 4 was forced by other changes introduced with this same beta and this new issue forces me to code do changes.
(In reply to comment #11) > I have found some time to do some additional testing. > > The issue is caused by the unit test class name being different from the test > class. > The tested class is INSPIREResourceRepresentation > The test class is INSPIREResourceRepresentationTest10 This is the root for the problems you see in beta. Since bug 227358 there was a change in the way the "Run/Debug focused test method" menu items get enabled. In order for the infrastructure to be able to navigate to/from test class and/or execute test class or test method the test class file name should end with "Test" > > If the test class is named INSPIREResourceRepresentationTest everything works > fine. > > Is this some additional requirement from JUnit 4? no it is not. > > Shall I change my code and put all test methods in a single class file? You can rename INSPIREResourceRepresentationTest10 to INSPIREResourceRepresentation10Test. Then the "Run/Debug focused test method" menu items will be enabled but you will not be able to navigate to the tested class, but you could not do that in previous release as well. > That would be a problem for me. > > I raise the priority of this issue since the upgrade to JUnit 4 was forced by > other changes introduced with this same beta and this new issue forces me to > code do changes. Closing as wontfix as you manually created those test classes and there are error messages when you create the test class from the Tolls->Create Tests menu item to indicate that things will not work as expected if you modify the default name for the test class.
The workaround works. I can certainly accept to rename the test classes. Many thanks.
OK, verifying then.
I don't like this at all. I have been using files under Test Packages that end in *Tasks which are collections of pieces of code that do administrative tasks related to my application. I used "Run focused test" to great effect. Then I lost that capability with no explanation of why. Good thing I knew what I was missing and Google brought me to this bug, explanation of the problem, and workaround. What is a new user supposed to do? It is better to check if the file is indeed in the Test Packages, than to dictate how those files should be named, what they should contain, or to say that anything not created through the Netbeans wizard is a second-class citizen. I love Netbeans and Java for obeying the principle of least surprise and being very flexible (unlike the inconsistent pile that is VS/C#), so please find a more elegant fix to bug 227358.
(In reply to almson from comment #15) > I love Netbeans and Java for obeying the principle of least surprise and > being very flexible (unlike the inconsistent pile that is VS/C#), so please > find a more elegant fix to bug 227358. Please have a look in https://netbeans.org/bugzilla/show_bug.cgi?id=232709#c11
Thanks! *** This bug has been marked as a duplicate of bug 232709 ***
Shouldn't bug 232709 be marked as a duplicate of this one and not vice versa?
(In reply to aquaglia from comment #18) > Shouldn't bug 232709 be marked as a duplicate of this one and not vice versa? you are correct since this one was filed earlier. Thanks For the record this was fixed by http://hg.netbeans.org/core-main/rev/3a4b61b7a20a
*** Bug 232709 has been marked as a duplicate of this bug. ***