Package test.testng195

Source Code of test.testng195.AfterMethodSampleTest

package test.testng195;

import org.testng.IResultMap;
import org.testng.ITestContext;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import java.lang.reflect.Method;

public class AfterMethodSampleTest {
  static boolean m_success;

  @Test
  public void pass() {
  }

  @BeforeClass
  public void init() {
    m_success = false;
  }

  @AfterMethod
  public void afterMethod(ITestContext c, Method m) {
      IResultMap map = c.getPassedTests();
      m_success = map.size() == 1;
  }
}
TOP

Related Classes of test.testng195.AfterMethodSampleTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.