TestNG 5.0 Released

Home

News: TestNG 5.0 Released

  1. TestNG 5.0 Released (9 messages)

    Cedric Beust has announced the release of TestNG 5.0. Inspired by JUnit and NUnit, TestNG has been the result of a lot of hard work on his part. His goal has always been to make testing easier and in this release he has further exploited many of the new Java language features to ease test development even further. As expected for a tool of this nature, TestNG 5.0 relies heavily on annotations to specify the role of a method. In the announcement Cedric explains the work that he did to make the annotations cleaner in this release.
    It is more obvious that configuration annotations should not mix with each other. That's a downside of the approach I initially chose: while it is legal to specify several booleans (@Configuration(beforeSuite = true, beforeTest = true)), it doesn't make a lot of sense, and the shorter version [@BeforeSuite] makes this a bit clearer.
    Reporting has also been improved by having each distinct test suite end up in its own output directory. The new output directory contains an index.html to provides composite view of all tests that were run as well as a pointer back to the testng.xml that was used to drive the process. Cedric has also applied some CSS to improve the look of the reports. Other features include; two attributes for the @Test annotation to direct the output to a specific report, the movement of @ExcpectedExceptions to be an attribute of @Test, and friendly stack traces that optionally show you all of the details if you so desire to see them. The change log as reported by Cedric is;
    • Stack traces can be interactively shown in the HTML reports
    • Link to testng.xml in the reports
    • Ant task: support for JVM, workingDir, timeout
    • New structure for reports, suites go in their individual directory
    • @Test(suiteName) and @Test(testName)
    • The stack traces in reports do not include TestNG frames (system property testng.exception) see: http://groups.google.com/group/testng-dev/browse_thread/thread/9f4d46ade10b0fda)
    • Exit with error when no methods are run (see: http://groups.google.com/group/testng-dev/browse_thread/thread/3c26e8a5658f22ac)
    • List of methods in alphabetical order
    • Class-scoped annotations were not recognized when inherited
    • Deprecated @Configuration and introduced @BeforeSuite/Test/Class/TestMethod
    • Deprecated @ExpectedExceptions and moved it into @Test
    • expectedExceptions to @Test, deprecated @ExpectedExceptions
    • New annotations: @BeforeSuite, @BeforeTest, etc...
    • Was returning an exit code of 0 if a cyclic graph was detected
    • Interface org.testng.ITest so that tests can declare a name
    • Fixed: The Text reporter was reporting the square of the actual number of methods
    • Bug reported by Eran about dependencies with an afterClass method
    • IHookCallBack now receives the ITestResult in its run() method
    • Name of suite for command line can be set with -Dtestng.suite.name=xxx
    • TestNGAntTask was hardcoding m_haltOnFSP to true
    • Passing a null parameter caused an NPE in the reports
    • "listener" to the ant task (and documentation)
    • if patch-testng-sourcedir.properties is found in the classpath with a property "sourcedir" containing a ; separated list of directories, this list will override -sourcedir.

    Threaded Messages (9)

  2. Re: TestNG 5.0 Released[ Go to top ]

    Someone should edit the first sentence of the original posting, lest TSS get a reputation for being more than an enterprise Java site.
    Cedric Beust has announced the release of TestNG 5.0. Inspired by JUnit and NUnit, TestNG has been the result of a lot of hard on his part.
  3. Re: TestNG 5.0 Released[ Go to top ]

    Someone should edit the first sentence of the original posting, lest TSS get a reputation for being more than an enterprise Java site.

    Cedric Beust has announced the release of TestNG 5.0. Inspired by JUnit and NUnit, TestNG has been the result of a lot of hard on his part.
    Yes, I was thinking the same. Actually had to reread it until it hit me that it was a typo:-)
  4. Re: TestNG 5.0 Released[ Go to top ]

    Yuk.
  5. Re: TestNG 5.0 Released[ Go to top ]

    Congratulations Cedric on TestNG and the latest release. Recently I've switched to TestNG and am happy with the additional capabilities, it has enabled me to organize my tests in a more efficient manner. The 5.0 features sound interesting, I'm looking forward to trying them out. Excellent work! Frederic
  6. Re: TestNG 5.0 Released[ Go to top ]

    Testing is for suckers.
  7. Re: TestNG 5.0 Released[ Go to top ]

    Not testing your code even worse ;)
  8. Good Competition[ Go to top ]

    The battle between TestNG and JUnit is good. Both tools are improving. I appreciate Cedric's energy and desire to make testing more simple.
  9. Well worth taking a look at[ Go to top ]

    TestNG is well worth taking a look at. Yes , even if you've been happy with JUnit for the last couple of years, it's worth making the effort the evaluate the alternatives. In my case, the trigger was the JBoss Seam comes with TestNG unit test samples. With a 'ready to go' sample in front of me , I no longer had an excuse to ignore the project. If face , TestNG's biggest problem (like Ant and Maven), JUnit is 'good enough' without giving a cause to make the effort and switch. Paul , Technology in Plain English
  10. Re: Well worth taking a look at[ Go to top ]

    If face , TestNG's biggest problem (like Ant and Maven), JUnit is 'good enough' without giving a cause to make the effort and switch.
    I do agree. I chose TestNG instead of JUnit in one of my project. We were quite happy with it, easy to learn and to use (even without Java 5 annotations). At this time, I thought JUnit 3.8 was quite outdated, but I admit that its simple functionnalities are enough for the vast majority of (small to medium sized) projects. JUnit 4 makes unit testing more flexible but if you need more advanced functionnalities, TestNG evolves faster than JUnit.