testng is a unit test library like junit
testng is a unit test library like junit. At SpotADev we use testng for unit tests and junit for Spring Integration tests.
While we can use junit also for unit tests we have decided to use testng instead.
Both testng and junit test libraries have methods like equals:
Assert.equals(..)
They compare actual values with expected values.
In the test assert methods you will notice that one of the main differences between testng and junit is the order of the comparisons.
With testng, actual is the first argument and expected is the second argument in the Assert.equals(..) method.
With junit it is the other way round.
When using maven you can add testng as a dependency.
Note that to trigger testng tests from within STS you need to follow the instructions for installing testng in eclipse.
Note that STS is actually Eclipse. The Spring Source guys configured eclipse with the plugins necessary for eclipse to have helpful Java Spring functionality.
For details of installing the testng plugin in STS see:
Back: Java
Page Author: JD