void () { UIUtil.invokeAndWaitIfNeeded(() -> { try { myFixture.addClass("package org.testng.annotations; public @interface DataProvider {}"); myFixture.addClass("package org.testng.annotations; public @interface Test {}"); myFixture.addClass("package o; @Test public class MyTest { public void testMe(){} }"); myFixture.addFileToProject("subPack/test-unit.xml", "<suite>" + "<test>" + "<classes></classes>" + "</test>" + "</suite>"); myFixture.enableInspections(new XmlPathReferenceInspection()); myFixture.testHighlighting("testng.xml"); } catch (Exception e) { throw new RuntimeException(e); } }); }