void () { final StringBuffer buf = new StringBuffer(); final IDEATestNGRemoteListener listener = createListener(buf); listener.onStart((ISuite)null); final MockTestNGResult[] results = new MockTestNGResult[] {new MockTestNGResult("ATest", "testName"), new MockTestNGResult("ATest", "testName1"), new MockTestNGResult("ATest", "testName")}; for (MockTestNGResult result : results) { listener.onTestStart(result); listener.onTestFinished(result); } listener.onFinish((ISuite)null); Assert.assertEquals("output: " + buf, """ ##teamcity[enteredTheMatrix] ##teamcity[testSuiteStarted name ='ATest' locationHint = 'java:suite://ATest'] ##teamcity[testStarted name='ATest.testName' locationHint='java:test://ATest/testName'] ##teamcity[testFinished name='ATest.testName'] ##teamcity[testStarted name='ATest.testName1' locationHint='java:test://ATest/testName1'] ##teamcity[testFinished name='ATest.testName1'] ##teamcity[testStarted name='ATest.testName (1)' locationHint='java:test://ATest/testName|[1|]'] ##teamcity[testFinished name='ATest.testName (1)'] ##teamcity[testSuiteFinished name='ATest'] """, StringUtil.convertLineSeparators(buf.toString())); }