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("BTest", "testName")}; for (MockTestNGResult result : results) { listener.onTestStart(result); } for (MockTestNGResult result : results) { 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[testSuiteFinished name='ATest'] ##teamcity[testSuiteStarted name ='BTest' locationHint = 'java:suite://BTest'] ##teamcity[testStarted name='BTest.testName' locationHint='java:test://BTest/testName'] ##teamcity[testFinished name='ATest.testName'] ##teamcity[testFinished name='BTest.testName'] ##teamcity[testSuiteFinished name='BTest'] """, StringUtil.convertLineSeparators(buf.toString())); }