Examples of ITestNGMethod


Examples of org.testng.ITestNGMethod

   */
  public void run() {
    // Using an index here because we need to tell the invoker
    // the index of the current method
    for (int indexMethod = 0; indexMethod < m_testMethods.length; indexMethod++) {
      ITestNGMethod tm = m_testMethods[indexMethod].getMethod();
 
      ITestClass testClass = tm.getTestClass();

      invokeBeforeClassMethods(testClass);
     
      //
      // Invoke test method
View Full Code Here

Examples of org.testng.ITestNGMethod

  }
 
  private boolean isLastTestMethodForClass(ITestNGMethod tm, ITestNGMethod[] testMethods)
  {
    for (int i = testMethods.length - 1; i >= 0; i--) {
      ITestNGMethod thisMethod = testMethods[i];
      ITestClass testClass = tm.getTestClass();
      if (thisMethod.getTestClass().equals(testClass)) {
        if (thisMethod.equals(tm)) {
          return true;
        }
        else {
          return false;
        }
View Full Code Here

Examples of org.testng.ITestNGMethod

   * @return the max timeout or 0 if no timeout was specified
   */
  public long getMaxTimeOut() {
    long result = 0;
    for (IMethodInstance mi : m_testMethods) {
      ITestNGMethod tm = mi.getMethod();
      if (tm.getTimeOut() > result) {
        result = tm.getTimeOut();
      }
    }
   
    return result;
  }
View Full Code Here

Examples of org.testng.ITestNGMethod

   */
  public void run() {
    // Using an index here because we need to tell the invoker
    // the index of the current method
    for (int indexMethod = 0; indexMethod < m_testMethods.length; indexMethod++) {
      ITestNGMethod tm = m_testMethods[indexMethod].getMethod();
 
      ITestClass testClass = tm.getTestClass();

      invokeBeforeClassMethods(testClass, m_testMethods[indexMethod]);
     
      //
      // Invoke test method
View Full Code Here

Examples of org.testng.ITestNGMethod

   
    //
    // Invoke after class methods if this test method is the last one
    //
    List<Object> invokeInstances= Lists.newArrayList();
    ITestNGMethod tm= mi.getMethod();
    if (m_classMethodMap.removeAndCheckIfLast(tm, mi.getInstances()[0])) {
      Map<ITestClass, Set<Object>> invokedAfterClassMethods= m_classMethodMap.getInvokedAfterClassMethods();
      synchronized(invokedAfterClassMethods) {
        Set<Object> instances = invokedAfterClassMethods.get(testClass);
        if(null == instances) {
View Full Code Here

Examples of org.testng.ITestNGMethod

    //
    List<IMethodWorker> workers = Lists.newArrayList();
   
    for (int i = 0; i < testMethod.getInvocationCount(); i++) {
      // we use clones for reporting purposes
      ITestNGMethod clonedMethod= testMethod.clone();
      clonedMethod.setInvocationCount(1);
      clonedMethod.setThreadPoolSize(1);

      MethodInstance mi = new MethodInstance(clonedMethod, clonedMethod.getTestClass().getInstances(true));
      workers.add(new SingleTestMethodWorker(this,
          mi,
          suite,
          parameters,
          allTestMethods,
View Full Code Here

Examples of org.testng.ITestNGMethod

          failedTests, skippedTests
      };

      for (Collection<ITestResult> tests : allTests) {
        for (ITestResult failedTest : tests) {
          ITestNGMethod current = failedTest.getMethod();
          if (current.isTest()) {
            methodsToReRun.add(current);
            ITestNGMethod method = failedTest.getMethod();
            // Don't count configuration methods
            if (method.isTest()) {
              List<ITestNGMethod> methodsDependedUpon =
                  MethodHelper.getMethodsDependedUpon(method, context.getAllTestMethods());
             
              for (ITestNGMethod m : methodsDependedUpon) {
                if (m.isTest()) {
View Full Code Here

Examples of org.testng.ITestNGMethod

        // Depends on methods?
        // Adds all depended methods to runningMethods
        //
        String[] mdu = m.getMethodsDependedUpon();
        for (String tm : mdu) {
          ITestNGMethod thisMethod = findMethodNamed(tm, allMethods);
          if (thisMethod != null && ! runningMethods.containsKey(thisMethod)) {
            runningMethods.put(thisMethod, thisMethod);
            newMethods.put(thisMethod, thisMethod);
          }
        }
View Full Code Here

Examples of org.testng.ITestNGMethod

    // 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);
View Full Code Here

Examples of org.testng.ITestNGMethod

   
    for (ITestResult tr : tests) {
      sb.append("<tr>\n");

      // Test method
      ITestNGMethod method = tr.getMethod();

      sb.append("<td title='").append(tr.getTestClass().getName()).append(".")
        .append(tr.getName())
        .append("()'>")
        .append("<b>").append(tr.getName()).append("</b>");
     
      // Test name
      String testName = method.getTestClass().getTestName();
      if (testName != null) {
        sb.append("<br>").append("Test class:" + testName);
      }
     
      // Method description
      if (! Utils.isStringEmpty(method.getDescription())) {
        sb.append("<br>").append("Test method:").append(method.getDescription());
      }
     
      Object[] parameters = tr.getParameters();
      if (parameters != null && parameters.length > 0) {
        sb.append("<br>Parameters: ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.