TestNG Integration

Goal: Use TestNG as default testing framework in Java-based NetBeans projects
Target Release (tentative): NetBeans 7.2, TestNG 6.4-NEXT (6.4.1/6.5)
Authors: Theofanis Oikonomou, Lukas Jungmann (jungi (at) netbeans (dot) org)
Last Update: February 25, 2012



Due to license issue with JUnit library and following removal of this library from the standard NetBeans distribution in version 7.0.1 (see ie. h-online.com), the IDE currently does not bundle any testing framework for Java projects by default and user is required to accept JUnit license before installing and using it and even though the process of accepting the license has been made as painless as possible (see JUnit Installer (pdf)) the situation is not ideal.

TestNG is an alternative (not only unit) testing framework for Java, which could be used by NetBeans. With its Apache license, recent improvements, JUnit 3/4 support and existing NetBeans plugin it seems that it could be used to replace JUnit in the standard distribution.

With TestNG integrated in the standard IDE distribution, NetBeans will gain out-of-the-box experience for its users again while providing them an option to use JUnit (as it is now), an option to easily migrate their older projects to TestNG as well as an option to write tests for their projects using TestNG only.


  • official TestNG library with all required changes in, current version is beta
  • API changes in NetBeans: bug #208841

Plugin limitations

  • Compile-on-save feature is not implemented
  • Debug Test implemented as separate action
  • Run/Debug Focused Test implemented as separate actions

Work to be done

In order for testng module to be integrated in the main distribution of the IDE for version 7.2 some things need to be considered to ensure backward compatibility

  • Must not affect existing projects from users point of view
  • Must be compatible through NB versions
    • User A works in NB 7.2
    • User B works in NB 7.1
      • Both users should still cooperate with minimum setup
  • Must allow users to select which testing framework to use

IDE-wide testing related targets and params are well defined, documented and bound to specific targets in build-impl.xml. TestNG related targets and params should also be added to build-impl.xml for them to be better maintained: http://netbeans.org/bugzilla/attachment.cgi?id=116155

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo