blob: 70f06cf151af53ef4d48ecaabb3bce9d0d56dda5 [file] [log] [blame]
package test.thread;
import org.testng.annotations.Test;
import org.testng.annotations.AfterClass;
import org.testng.internal.thread.ThreadUtil;
import org.testng.Assert;
import java.util.Set;
import java.util.Collections;
import java.util.HashSet;
/**
* Test for test level thread-count.
*
* @author <a href="mailto:the.mindstorm@gmail.com">Alex Popescu</a>
*/
public class SuiteThreadCountTest {
private Set<String> m_threads= Collections.synchronizedSet(new HashSet<String>());
@Test
public void test1() {
m_threads.add(ThreadUtil.currentThreadInfo());
}
@Test
public void test2() {
m_threads.add(ThreadUtil.currentThreadInfo());
}
@AfterClass
public void checkThreading() {
Assert.assertEquals(m_threads.size(), 2, "Test should use 2 threads (suite level)");
}
}