Java 类org.testng.internal.annotations.IAnnotationFinder 实例源码

项目:qaf    文件:TestClass.java   
private void init(IClass cls,
                  ITestMethodFinder testMethodFinder,
                  IAnnotationFinder annotationFinder,
                  RunInfo runInfo,
                  XmlTest xmlTest,
                  XmlClass xmlClass)
{
  log(3, "Creating TestClass for " + cls);
  m_iClass = cls;
  m_testClass = cls.getRealClass();
  m_xmlTest = xmlTest;
  m_xmlClass = xmlClass;
  m_runInfo = runInfo;
  m_testMethodFinder = testMethodFinder;
  m_annotationFinder = annotationFinder;
  initTestClassesAndInstances();
  initMethods();
}
项目:qaf    文件:MethodHelper.java   
/**
 * Collects and orders test or configuration methods
 * @param methods methods to be worked on
 * @param forTests true for test methods, false for configuration methods
 * @param runInfo
 * @param finder annotation finder
 * @param unique true for unique methods, false otherwise
 * @param outExcludedMethods
 * @return list of ordered methods
 */
public static ITestNGMethod[] collectAndOrderMethods(List<ITestNGMethod> methods,
    boolean forTests, RunInfo runInfo, IAnnotationFinder finder,
    boolean unique, List<ITestNGMethod> outExcludedMethods)
{
  List<ITestNGMethod> includedMethods = Lists.newArrayList();
  MethodGroupsHelper.collectMethodsByGroup(methods.toArray(new ITestNGMethod[methods.size()]),
      forTests,
      includedMethods,
      outExcludedMethods,
      runInfo,
      finder,
      unique);

  return sortMethods(forTests, includedMethods, finder).toArray(new ITestNGMethod[]{});
}
项目:qaf    文件:MethodHelper.java   
private static List<ITestNGMethod> sortMethods(boolean forTests,
    List<ITestNGMethod> allMethods, IAnnotationFinder finder) {
  List<ITestNGMethod> sl = Lists.newArrayList();
  List<ITestNGMethod> pl = Lists.newArrayList();
  ITestNGMethod[] allMethodsArray = allMethods.toArray(new ITestNGMethod[allMethods.size()]);

  // Fix the method inheritance if these are @Configuration methods to make
  // sure base classes are invoked before child classes if 'before' and the
  // other way around if they are 'after'
  if (!forTests && allMethodsArray.length > 0) {
    ITestNGMethod m = allMethodsArray[0];
    boolean before = m.isBeforeClassConfiguration()
        || m.isBeforeMethodConfiguration() || m.isBeforeSuiteConfiguration()
        || m.isBeforeTestConfiguration();
    MethodInheritance.fixMethodInheritance(allMethodsArray, before);
  }

  topologicalSort(allMethodsArray, sl, pl);

  List<ITestNGMethod> result = Lists.newArrayList();
  result.addAll(sl);
  result.addAll(pl);
  return result;
}
项目:qaf    文件:TestClass.java   
protected TestClass(IClass cls,
                 ITestMethodFinder testMethodFinder,
                 IAnnotationFinder annotationFinder,
                 RunInfo runInfo,
                 XmlTest xmlTest,
                 XmlClass xmlClass) {
  init(cls, testMethodFinder, annotationFinder, runInfo, xmlTest, xmlClass);
}
项目:qaf    文件:TestRunner.java   
protected TestRunner(IConfiguration configuration,
                  ISuite suite,
                  XmlTest test,
                  String outputDirectory,
                  IAnnotationFinder finder,
                  boolean skipFailedInvocationCounts,
                  Collection<IInvokedMethodListener> invokedMethodListeners,
                  List<IClassListener> classListeners)
{
  init(configuration, suite, test, outputDirectory, finder, skipFailedInvocationCounts,
      invokedMethodListeners, classListeners);
}
项目:qaf    文件:MethodHelper.java   
protected static boolean isEnabled(Method m, IAnnotationFinder finder) {
  ITestAnnotation annotation = AnnotationHelper.findTest(finder, m);

  // If no method annotation, look for one on the class
  if (null == annotation) {
    annotation = AnnotationHelper.findTest(finder, m.getDeclaringClass());
  }

  return isEnabled(annotation);
}
项目:qaf    文件:TestClass.java   
public IAnnotationFinder getAnnotationFinder() {
  return m_annotationFinder;
}
项目:qaf    文件:TestRunner.java   
private void init(IConfiguration configuration,
                  ISuite suite,
                  XmlTest test,
                  String outputDirectory,
                  IAnnotationFinder annotationFinder,
                  boolean skipFailedInvocationCounts,
                  Collection<IInvokedMethodListener> invokedMethodListeners,
                  List<IClassListener> classListeners)
{
  m_configuration = configuration;
  m_xmlTest= test;
  m_suite = suite;
  m_testName = test.getName();
  m_host = suite.getHost();
  m_testClassesFromXml= test.getXmlClasses();
  m_skipFailedInvocationCounts = skipFailedInvocationCounts;
  setVerbose(test.getVerbose());


  boolean preserveOrder = test.getPreserveOrder();
  m_methodInterceptors = new ArrayList<IMethodInterceptor>();
  builtinInterceptor = preserveOrder ? new PreserveOrderMethodInterceptor() : new InstanceOrderingMethodInterceptor();

  m_packageNamesFromXml= test.getXmlPackages();
  if(null != m_packageNamesFromXml) {
    for(XmlPackage xp: m_packageNamesFromXml) {
      m_testClassesFromXml.addAll(xp.getXmlClasses());
    }
  }

  m_annotationFinder= annotationFinder;
  m_invokedMethodListeners = invokedMethodListeners;
  m_classListeners.clear();
  for (IClassListener classListener : classListeners) {
    m_classListeners.put(classListener.getClass(), classListener);
  }
  m_invoker = new Invoker(m_configuration, this, this, m_suite.getSuiteState(),
      m_skipFailedInvocationCounts, invokedMethodListeners, classListeners);

  if (test.getParallel() != null) {
    log(3, "Running the tests in '" + test.getName() + "' with parallel mode:" + test.getParallel());
  }

  setOutputDirectory(outputDirectory);

  // Finish our initialization
  init();
}
项目:qaf    文件:MethodHelper.java   
protected static boolean isEnabled(Class<?> objectClass, IAnnotationFinder finder) {
  ITestAnnotation testClassAnnotation = AnnotationHelper.findTest(finder, objectClass);
  return isEnabled(testClassAnnotation);
}
项目:qaf    文件:DataDrivenScenario.java   
protected static Iterator<Object[]> invokeDataProvider(Object instance, Method dataProvider,
     ITestNGMethod method, ITestContext testContext, Object fedInstance,
     IAnnotationFinder annotationFinder) {
 return MethodInvocationHelper.invokeDataProvider(instance, dataProvider, method, testContext, fedInstance, annotationFinder);
}
项目:qaf    文件:TestNGScenario.java   
public TestNGScenario(Method method, IAnnotationFinder finder, XmlTest xmlTest, Object instance) {
    super(method, finder, xmlTest, instance);
    init(instance);
}
项目:seleniumtestsframework    文件:SeleniumTestsDefaultSuite.java   
public IAnnotationFinder getAnnotationFinder() {
    return null;
}