title: Stop test execution of testNG if data provider is empty
body: <p>hi I want to stop further test execution when there is no data in dataprovider. My dataproviders get filled up dynamically on the fly. So i want my tests to stop from execution if there is not data in dataprovider. Below is my code snippet. </p>
  
  <pre><code>package myTest;
  
  import org.testng.Reporter;
  import org.testng.annotations.DataProvider;
  import org.testng.annotations.Factory;
  import org.testng.annotations.Test;
  
  public class NewTest
  {
      String str;
      @DataProvider
      public Object[][] test123()
      {
          System.out.println(" Filling dataprovider.");
          return new Object[][]{};
      }
  
      @Factory(dataProvider="test123")
      public NewTest(String str)
      {
          System.out.println("Running through factory.");
          this.str=str;
      }
  
      @Test
      public void test1234()
      {
          Reporter.log("---&gt;&gt;&gt; running test "+str,true);
      }
  }
  </code></pre>
  
  <p>I want that test1234 should not run if dataprovider is empty.</p>