Set TestNG to not run test methods in parallel for a class

By xngo on March 4, 2019

//TestNG
import org.testng.annotations.Test;
 
 
/**
 * singleThreaded=false: Don't run test methods in parallel for this class.
 * @author Xuan Ngo
 *
 */
@Test(singleThreaded=false)
public class NonParallelMethods
{
  @Test(description="testMethod1")
  public void testMethod1()
  {}
 
  @Test(description="testMethod2")
  public void testMethod2()
  {}    
}

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.