Reputation: 6694
I am writing my test cases since many years with JUnit. Now I'm interested in starting developing with TestNG. What are the main things that are likely to trip me up when designing/coding TestNG classes.? Will I miss asserThat?
Upvotes: 1
Views: 504
Reputation: 15608
The only thing I would recommend is to use the AssertJUnit
class for your asserts and not TestNG's Assert
, because the argument order is not the same and it will probably annoy you :-) Also, TestNG uses BeforeMethod
instead of Before
.
Other than that, it should be trivial for you to transition. If you're using Eclipse, the TestNG plug-in will convert all your JUnit 3 tests (and JUnit 4 to some extent) in one click, so you might want to start with that.
Some of the features you might want to look into first are:
Finally, while you don't have to create a testng.xml
file to get started, I suggest you go ahead and do that because it will open up all the features that TestNG has to offer right away.
If you have any further questions, feel free to email the testng-users
mailing-list.
Good luck!
Upvotes: 4