This question shows how to run a TestNG suite programmatically without an XML file.
However, when I run it from IDEA it just runs as a main method and the output is not in the test window, whereas the JUnit example in the question does appear in the test window.
How can I configure a TestNG test suite from a Java class and have IDEA/Eclipse output the results in the test window?