Monday, January 21, 2013

Difference Between JUnit And TestNG Annotations



Difference Between JUnit And TestNG Annotations

Features JUnit Annotations TestNG Annotations
Test annotation. @Test @Test
Run before all test in this suite have run. -- @BeforeSuite
Run after all test in this suite have run. -- @AfterSuite
Run before the test. -- @BeforeTest
Run after the test. -- @AfterTest
Run before the first test method that belongs to any of these group is invoked. -- @BeforeGroup
Run after the last test method that belongs to any of these group is invoked. -- @AfterGroup
Run before the first test method in the current class is invoked. @BeforeClass @BeforeClass
Run after all the test method in the current class have been run. @AfterClass @AfterClass
Run before each test method. @Before @BeforeMethod
Run after each test method. @After @AfterMethod
IgnoreTest @ignore @Test(enable=false)
Expected Exception @Test(Expected=ArithmeticException.Class) @Test(ExpectedExceptions=ArithmeticException.Class)
TimeOut @Test(timeout=1000) @Test(timeout=1000)
Thanks From Prashant Chauhan

No comments:

Post a Comment