Take the 2-minute tour ×

Can some one please help me with the usage of testing a JAVA class using annotations ( org.testng.annotations.Test) ... I am dealing with a program (written by some1 else) in which Junit is not used instead "org.testng.annotations.Test" is used of which i have no idea

share|improve this question
testng.org/doc/index.html –  skaffman Mar 31 '11 at 8:57
add comment

1 Answer

You'll definitely want to read the documentation on TestNG here, as there are some differences from JUnit. Some of the annotations are similar, though.

Here are some highlights:

@BeforeSuite, @BeforeClass, @BeforeTest mark methods that will run before a test suite, before a test class, and before an individual test method, respectively (as you might expect).

@Test annotates a method as being a test method.

Those are the most similar to JUnit. The docs have a great explanation of the others.

share|improve this answer
add comment

Your Answer


