testNG : How to ignore or disable a test in testNG

Some times a failing test causes the build to fail. In that cases before the test is fixed a quick remedy is to disable the test to get the build passed. That can be done easily through annotation.

@Test(enabled=false)

The TestNG engine will just bypass this method.

import org.testng.annotations.*;

public class TestNGTest3 {

	@Test(enabled=false)
	public void divisionWithException() {  
	  System.out.println("Method is not ready yet");
	}  

}

In above example, TestNG will not test the divisionWithException() method.