nimarukan
Article
NetBeans and Alternative Test Runners: Customizing Standard Java Projects

Q: I'm working several projects and would like to debug or extend their test suites, but the project tests are written using TestNG, SuiteRunner, or another alternative to JUnit. The NetBeans test running tools for Standard projects appear to be only for JUnit tests. Can NetBeans still be used to debug and develop the project test suites?


A: Yes it can, with a little Ant build-file customization. If you can write an Ant build-file to run your project tests, and one to run an individual test suite class, you can customize your buildfile to tell the NetBeans IDE to invoke these targets without writing any NetBeans modules, or even any Java code.


Learn to customize a NetBeans "standard project" buildfile so you can run and debug a project test suite that uses TestNG, SuiteRunner, or another alternative test runner in place of NetBeans' default JUnit. Examples are provided for SuiteRunner and TestNG. The resulting requirement is just one additional import in a standard project build file.




2007-05-06 22:18:36 GMT
Comments (4 total)
Author:nimarukan
Updated: minor clean up (spelling, html) of article. (XML files are unchanged.)
2007-06-03 12:15:14 GMT
Author:nimarukan
Updated: "Appendix: Debug TestNG Groups"
1. typo: group= -> groups=
2. adds: user.properties file as alternative to options dialog
2007-10-14 16:47:14 GMT
Author:nimarukan
Updated: 'As of NetBeans 6.5, the project "Compile on save" option must be turned off for some target overrides to work [NetBeans issue #145772].'
2008-09-13 14:10:49 GMT
Author:nimarukan
Updated: test.src.dir may be a relative path or an absolute path, so for Suiterunner, Test Project, in target "-suiterunner-run-classes", added another map clause. Article html file and suiterunner xml files updated.
2009-04-17 21:43:11 GMT
Hosted by www.Geocities.ws

1