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.

Bug 190761

Summary: Cannot run single failed test when in different classfile
Product: utilities Reporter: Jaroslav Tulach <jtulach>
Component: Test RunnerAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: -S1S-   
Hardware: Other   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description Jaroslav Tulach 2010-10-05 08:32:28 UTC
Open openide.filesystems project. Change one test in XMLFileSystemTestHid.java to fail. Run XMLFileSystemTest.java. When the test fails, try "Run Again" from its node popup menu.

The execution fails. The system thinks that XMLFileSystemTestHid is the test class, not XMLFileSystemTest.
Comment 1 Victor Vasilyev 2010-10-08 05:06:22 UTC
Seems we lost desired behavior of the action "Run Again" for a test method node when implementation has been switched to use Common Runner API for displaying test results.
Probably, the problem is here:
http://hg.netbeans.org/main/file/7452a33b0ea0/junit/src/org/netbeans/modules/junit/output/JUnitTestMethodNode.java#l80
where testFO is used instead of commented out suiteFile.

Unfortunately, methods required to get suiteFile are not  supported by the implementation gsf.testrunner. The class  org.netbeans.modules.gsf.testrunner.api.Testcase support concept "class" only, but it does not support concept "test suite". 

Note, this bug describes a case when "class" is not the same as the "test suite", i.e:
* class XMLFileSystemTest extends FileSystemFactoryHid
* just executed class XMLFileSystemTest is "test suite".
* FileSystemFactoryHid is the "class" containing a test method intended to be run again.

BTW in the described case, if the action "Run Again" will be called from the pop-up menu of the suite node, i.e.
org.openide.filesystems.XMLFileSystemTest FAILED
then the correct suite (i.e. XMLFileSystemTest) will be run, not XMLFileSystemTestHid that the method belong to.
Comment 2 Theofanis Oikonomou 2012-11-20 12:27:04 UTC
(In reply to comment #1)
> Seems we lost desired behavior of the action "Run Again" for a test method node
> when implementation has been switched to use Common Runner API for displaying
> test results.

AFAICT this behavior was never present. I checked with earlier version 6.7,6.8 and the run Again action was not even there.

> Note, this bug describes a case when "class" is not the same as the "test
> suite", i.e:
> * class XMLFileSystemTest extends FileSystemFactoryHid
> * just executed class XMLFileSystemTest is "test suite".
> * FileSystemFactoryHid is the "class" containing a test method intended to be
> run again.

AFAICT this is only problematic in the case where some initialization is happening in the suite file. If not then the correct class is run