I believe you want:
@Test(enabled=false) public class FooTest {
(You can apply the @Test annotation to the class, as well as to methods individually.)
The TestNG documentation contains an exhaustive list of supported annotations, and also describes the exclusion / inclusion of tests by group, if interested. Here is a quote from the relevant section:
@Test Marks a class or method as part of a test.
... (notch) ...
included: whether methods of this class / method are included.
EDIT : Ignoring a class using @Test(enabled=false) seems to be erroneous functionality in some versions of TestNG according to this defect , which was raised against TestNG.
razlebe Jun 02 2018-11-11T00: 00Z
source share