finer example to know execution sequence of annotations
TestNG Basic Annotations for configuration methods
|@BeforeSuite||Annotates methods that will be run before any method in a given is run.|
|@BeforeClass||Annotates methods that will be run before the first method on the current test class is run.|
|@BeforeMethod||Annotates methods that will be run before each test method.|
|@AfterMethod||Annotates methods that will be run after every test method.|
|@AfterClass||Annotates methods that will be run after the last test method on the current class is run.|
|@AfterSuite||Annotates methods that will be run after all the test methods in a given have been run.|
|@Test||Marks a class or a method as part of the test.|
The annotations @Test annotates a method as test case in TestNG pattern.
- A note by way of explanation or comment added to a text or diagram.
- The action of annotating a text or diagram.
Annotations provide data about a program that is not part of the program itself. They have no direct effect on the operation of the code they annotate.
Annotations have a number of uses, among them:
Information for the compiler — Annotations can be used by the compiler to detect errors or suppress warnings.
Compiler-time and deployment-time processing — Software tools can process annotation information to generate code, XML files, and so forth.
Runtime processing — Some annotations are available to be examined at runtime.
Annotations can be applied to a program’s declarations of classes, fields, methods, and other program elements.
For the Eclipse plug-in, we suggest using the update site:
- Select Help / Software updates / Find and Install.
- Search for new features to install.
- New remote site.
- For Eclipse 3.4 and above, enter http://beust.com/eclipse.
- For Eclipse 3.3 and below, enter http://beust.com/eclipse1.
- Make sure the check box next to URL is checked and click Next.
- Eclipse will then guide you through the process.