1 package test.tmp; 2 3 import org.testng.annotations.Test; 4 import org.testng.asserts.SoftAssert; 5 6 @Test 7 public class A { 8 // private FlexibleAssert m_assert = new FlexibleAssert(); 9 private SoftAssert m_assert = new SoftAssert(); 10 // private LoggingAssert m_assert = new LoggingAssert(); 11 test1()12 public void test1() { 13 m_assert.assertTrue(true, "test1()"); 14 } 15 test2()16 public void test2() { 17 m_assert.assertTrue(true, "test2()"); 18 } 19 20 // @AfterClass 21 // public void ac() { 22 // System.out.println("Tests run in this class:" + m_assert.getMessages()); 23 // } 24 multiple()25 public void multiple() { 26 m_assert.assertTrue(true, "Success 1"); 27 m_assert.assertTrue(true, "Success 2"); 28 m_assert.assertTrue(false, "Failure 1"); 29 m_assert.assertTrue(true, "Success 3"); 30 m_assert.assertTrue(false, "Failure 2"); 31 m_assert.assertAll(); 32 } 33 }