FactoryWithDataProviderTest.java :  » Testing » testng » test » factory » Java Open Source

Java Open Source » Testing » testng 
testng » test » factory » FactoryWithDataProviderTest.java
package test.factory;

import org.testng.Assert;
import org.testng.TestListenerAdapter;
import org.testng.TestNG;
import org.testng.internal.AnnotationTypeEnum;

public class FactoryWithDataProviderTest {

  /**
   * @testng.test
   */
  public void verifyDataProvider() {
    TestNG tng = new TestNG();
    tng.setSourcePath("./test-14/src;src");
    tng.setVerbose(0);
    tng.setAnnotations(AnnotationTypeEnum.JAVADOC.toString());
    tng.setTestClasses(new Class[] { FactoryWithDataProvider.class });
    TestListenerAdapter tla = new TestListenerAdapter();
    tng.addListener(tla);
    tng.run();
    
    Assert.assertEquals(tla.getPassedTests().size(), 4);
    
  }

  private static void ppp(String s) {
    System.out.println("[FactoryWithDataProviderTest] " + s);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.