I have tried to create the simple testcases which running in parallel several threads(for example, 3) at the same time by using testng
, but I have faced an issue. During testing, I have expected that System.out.println()
will put into a console "test"
sentences for each thread, but it didn't happen. You can find below the code which uses in my сase:
public class TestC {
@Test(invocationCount = 3, threadPoolSize = 3)
public static void test() throws InterruptedException {
System.out.println("test");
}
}
Could you help me to find out the root of the problem and suggest the solution to this issue? I have added the picture.
CodePudding user response:
The test seems to be working correctly. The issue here is all down to how IntelliJ IDEA handles test output. If you move your focus to "TestC" instead of an individual test run like you have in your screenshot, you should see the output: