Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

jUnit versus TestNG

Options
  • 15-03-2014 2:23pm
    #1
    Registered Users Posts: 81,220 ✭✭✭✭


    I'm working on a project with some fellas from India and they are using TestNG in Eclipse as opposed to jUnit.
    TestNG seems to be very popular in India but not so known in Ireland?
    Is anyone using TestNG?


Comments

  • Moderators, Sports Moderators, Regional Abroad Moderators Posts: 2,646 Mod ✭✭✭✭TrueDub


    I've used it - it's no better or worse than Junit. There are things that are easier in one or the other, but it's really a personal choice sort of thing.


  • Registered Users Posts: 159 ✭✭magooly


    Have always used JUnit up to recently when it was decided we were moving to TestNG. TestNG offers some new quirks in allowing injecting of datasets to tests that junit didn't. From listening to advocates of TestNG junit is seen as having fallen behind TestNG but I aint so sure.

    Really it just means your tests run with a different runner. I noticed very little difference only some frustration around how mocks are initialised is subtly different than in Junit. Also the TestNG folks decided to re-order the assertEquals(expected,actual) to assertEquals(actual, expected) which really pissed me off.

    Pick one and stick to it, if you mix tests in your project between testng and junit only one these sets will execute during your build leading to a scenario where many of your tests are ignored. TestNG has a migration tool to convert your exisiting junit tests to TestNG.

    To be honest I didn't think the move was worth the effort in the end.


  • Closed Accounts Posts: 8,015 ✭✭✭CreepingDeath


    magooly wrote: »
    TestNG offers some new quirks in allowing injecting of datasets to tests that junit didn't.

    We use DBUnit to inject datasets into our test cases for JUnit.


Advertisement