Skip to content

Instantly share code, notes, and snippets.

@kokkulasblog
Created May 20, 2014 09:55
Show Gist options
  • Save kokkulasblog/ec23f87527afa0c150d5 to your computer and use it in GitHub Desktop.
Save kokkulasblog/ec23f87527afa0c150d5 to your computer and use it in GitHub Desktop.
package com.annotations.example;
import org.testng.annotations.*;
public class TestNgAnnotations {
@BeforeSuite
public void beforeSuite() {
System.out.println("This is a @BeforeSuite annotated method and this is executed at the beginning of the test suite execution");
}
@AfterSuite
public void afterSuite() {
System.out.println("This is a @AfterSuite annotated method and this is executed at the end of the test suite execution");
}
@BeforeClass
public void beforeClass() {
System.out.println("This is a @BeforeClass annotated method and this is executed at the beginning of the test class execution");
}
@BeforeMethod
public void setUp() {
System.out.println("This is a @BeforeMethod annotated method and this is executed at the beginning of the each test method");
}
@Test
public void testAnnotationsOne() {
System.out.println("This is a @test annotated method and your testing will be done here");
}
@Test
public void testAnnotationsTwo() {
System.out.println("This is a @test annotated method and your testing will be done here");
}
@Test
public void testAnnotationsThree() {
System.out.println("This is a @test annotated method and your testing will be done here");
}
@AfterMethod
public void tearDown() {
System.out.println("This is a @AfterMethod annotated method and this is executed at the end of the each test method");
}
@AfterClass
public void afterClass() {
System.out.println("This is a @AfterClass annotated method this is executed at the end of the test class execution");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment