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 210293 - Unable to run single test (s-f6)
Summary: Unable to run single test (s-f6)
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: TestNG (show other bugs)
Version: 7.2
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
: 211246 211376 (view as bug list)
Depends on: 149464
Blocks:
  Show dependency tree
 
Reported: 2012-03-28 14:22 UTC by Tomas Danek
Modified: 2012-04-20 10:13 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2012-03-28 14:22:55 UTC
Product Version: NetBeans IDE Dev (Build 201203280401)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
System: Mac OS X version 10.7.3 running on x86_64; MacRoman; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev
----------
- create j2se project
- create testNG test case
- add some test method, run single test by shift-f6

->
/Users/tomas/Library/Caches/NetBeans/dev/executor-snippets/junit.xml:80: The following error occurred while executing this line:
/Users/tomas/Library/Caches/NetBeans/dev/executor-snippets/junit.xml:63: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath
BUILD FAILED (total time: 0 seconds)

installing junit (which should not be necessary) does not solve this issue.
Comment 1 Tomas Danek 2012-03-28 14:32:23 UTC
workaround: junit must be added to compile classpath (either manually, or by creating junit test class for project)
Comment 2 Theofanis Oikonomou 2012-03-28 14:43:29 UTC
Compile-on-save feature is not implemented. Please disable CoS from Project Properties -> Build -> Compiling. This should work
Comment 3 Tomas Danek 2012-03-29 11:57:22 UTC
Yes, it works, thanks. But from user's point of view there's no way to figure out what's going on; would it be possible to e.g. add informative message that this action does not work with CoS ?
Comment 4 Lukas Jungmann 2012-03-29 12:10:39 UTC
actually preferred solution should be to implement CoS for testng tests (see issue #149464)

the easiest (but IMO wrong way) is to add testng related targets to junit.xml/junit-debug.xml snippets in java.source.ant module

better solution would be to have some (friend?) SPI in a module with JavaRunner which would allow other modules to plug into JavaRunner.

Ie something like:
interface SnippetProvider {

URL getScriptSnippet(String action, Lookup context);

}

Honzo, which solution would you prefer? I can prepare a patch but I'd like to know which way to go in order to get it accepted.

Thanks.
Comment 5 Lukas Jungmann 2012-03-29 12:13:03 UTC
btw: one more solution would be to just add testng script snippet directly to java.source.ant and implement what's needed there
Comment 6 Tomas Zezula 2012-04-12 11:56:27 UTC
Adding it into java.source.ant will be good enough.
Comment 7 Lukas Jungmann 2012-04-16 12:35:00 UTC
*** Bug 211246 has been marked as a duplicate of this bug. ***
Comment 8 Theofanis Oikonomou 2012-04-18 13:32:03 UTC
*** Bug 211376 has been marked as a duplicate of this bug. ***
Comment 10 Quality Engineering 2012-04-20 10:13:30 UTC
Integrated into 'main-golden', will be available in build *201204200400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6c6d8369b4eb
User: Lukas Jungmann <jungi@netbeans.org>
Log: BZ#149464, BZ#210293 - CoS for TestNG