private boolean isAfter(ITestResult iTestResult) {
   ITestNGMethod method = iTestResult.getMethod();
   return (method.isAfterClassConfiguration()
       || method.isAfterMethodConfiguration()
       || method.isAfterSuiteConfiguration()
       || method.isAfterTestConfiguration());
 }
Exemplo n.º 2
0
  /**
   * Create the test methods that belong to this class (rejects all those that belong to a different
   * class).
   */
  private ITestNGMethod[] createTestMethods(ITestNGMethod[] methods) {
    List<ITestNGMethod> vResult = Lists.newArrayList();
    for (ITestNGMethod tm : methods) {
      ConstructorOrMethod m = tm.getConstructorOrMethod();
      if (m.getDeclaringClass().isAssignableFrom(m_testClass)) {
        for (Object o : iClass.getInstances(false)) {
          log(4, "Adding method " + tm + " on TestClass " + m_testClass);
          vResult.add(
              new TestNGMethod(
                  /* tm.getRealClass(), */ m.getMethod(), annotationFinder, xmlTest, o));
        }
      } else {
        log(4, "Rejecting method " + tm + " for TestClass " + m_testClass);
      }
    }

    return vResult.toArray(new ITestNGMethod[vResult.size()]);
  }