title: How to ignore/skip complete testng class containing few test methods & BeforeClass & AfterClass methods
body: <p>I have testng.xml suppose,</p>
  
  <pre><code>&lt;suite name="TestSuite" parallel="false"&gt;
    &lt;test name="smoke" preserve-order="true" verbose="2"&gt;
      &lt;groups&gt;
          &lt;run&gt;
              &lt;include name="smoke"/&gt;
          &lt;/run&gt;
      &lt;/groups&gt;
      &lt;classes&gt;
          &lt;class name="com.testClass1"/&gt;
          &lt;class name="com.testClass2"/&gt;
      &lt;/classes&gt;
    &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>This may contain more classes close to 10-15, this is my generic testng.xml, from different set of testdata, what I want is to skip com.testClass1 classs, for particular case, and rest of test should execute.</p>
  
  <p>I tried with implementing my class using, IAnnotationTransformer listener of testng.</p>
  
  <p>the code snippet is, </p>
  
  <pre><code>public class SkipTestClass implements IAnnotationTransformer{
          private SessionProfile profile=null;
          public void transform(ITestAnnotation annotation, Class testClass,
                    Constructor testConstructor, Method testMethod) {
              if (testMethod != null) {
                        Test test = testMethod.getDeclaringClass().getAnnotation(Test.class);
                        if (test != null &amp;&amp; !test.enabled() &amp;&amp; testMethod.getDeclaringClass().getClass().getName().equalsIgnoreCase("com.testClass1")) {
                          annotation.setEnabled(false);
                        }
  
                     }
  
          }
      }
  </code></pre>
  
  <p>and calling this listener at Test Class level,as</p>
  
  <p>@Listeners(com.SkipTestClass.class),</p>
  
  <p>Expected Result: I am assuming, only this class com.testClass1 &amp; it's testmethods &amp; beforeclass &amp; afterclass methods should skip and rest of suite should execute.</p>
  
  <p>Actual Result: Whole suite is getting skipped.</p>
  
  <p>Any Help, please?</p>