Examples of ITestNGMethod


Examples of org.testng.ITestNGMethod

   
    if (alphabetical) {
      @SuppressWarnings({"unchecked"})
      Comparator<? super ITestNGMethod>  alphabeticalComparator = new Comparator(){
        public int compare(Object o1, Object o2) {
          ITestNGMethod m1 = (ITestNGMethod) o1;
          ITestNGMethod m2 = (ITestNGMethod) o2;
          return m1.getMethodName().compareTo(m2.getMethodName());
        }
      };
      Collections.sort((List) invokedMethods, alphabeticalComparator);
    }
   
View Full Code Here

Examples of org.testng.ITestNGMethod

        sortMethodsByInheritance(l, baseClassToChild);
       
        // Set methodDependedUpon accordingly
        if (baseClassToChild) {
          for (int i = 1; i < l.size(); i++) {
            ITestNGMethod m1 = l.get(i - 1);
            ITestNGMethod m2 = l.get(i);
            if (! equalsEffectiveClass(m1, m2)) {
              Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
              m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
            }
          }
        }
        else {
          for (int i = 0; i < l.size() - 1; i++) {
            ITestNGMethod m1 = l.get(i);
            ITestNGMethod m2 = l.get(i + 1);
            if (! equalsEffectiveClass(m1, m2)) {
              m2.addMethodDependedUpon(MethodHelper.calculateMethodCanonicalName(m1));
              Utils.log("MethodInheritance", 4, m2 + " DEPENDS ON " + m1);
            }
          }         
        }
      }
View Full Code Here

Examples of org.testng.ITestNGMethod

  {
    List<ITestResult> testNGTestResults = TestNGTAPUtils.getTestNGResultsOrderedByExecutionDate(testContext);
   
    for ( ITestResult testResult : testNGTestResults )
    {
      ITestNGMethod method = testResult.getMethod();
     
      List<ITestResult> testResultsForThisMethod = testResultsPerMethod.get( method );
     
      if ( testResultsForThisMethod == null )
      {
        testResultsForThisMethod = new ArrayList<ITestResult>();
        testResultsPerMethod.put(method, testResultsForThisMethod);
      }
      testResultsForThisMethod.add( testResult );
    }
   
   
    Set<ITestNGMethod> keySet = testResultsPerMethod.keySet();
   
    for( ITestNGMethod method : keySet )
    {
      TestSet testSet = new TestSet();
     
      List<ITestResult> testResults = testResultsPerMethod.get( method );
      testSet.setPlan( new Plan(testResults.size()) );
     
      for ( ITestResult testResult : testResults )
      {
        TestResult tapTestResult = TestNGTAPUtils.generateTAPTestResult( testResult, testSet.getNumberOfTestResults()+1 );
        testSet.addTestResult( tapTestResult );
      }

      File output = new File(testContext.getOutputDirectory(), method.getTestClass().getName()+"#"+method.getMethodName()+".tap");
      tapProducer.dump(testSet, output);
   
  }
View Full Code Here

Examples of org.testng.ITestNGMethod

      {
        List<ITestResult> testResults = TestNGTAPUtils.getTestNGResultsOrderedByExecutionDate(suiteResult.getTestContext());
       
        for(ITestResult testResult : testResults)
        {
          ITestNGMethod method = testResult.getMethod();
         
          String[] groupsNm = findInWhatGroupsMethodIs(method, groups);
         
          for(String gpNm : groupsNm)
          {
View Full Code Here

Examples of org.testng.ITestNGMethod

    {
      Object o = ctx.getAttribute(attr);
      if ( o instanceof TAPAttribute )
      {
        TAPAttribute tapAttr = (TAPAttribute)o;
        ITestNGMethod testNGMethod = tr.getMethod();
        Method method = testNGMethod.getMethod();
        if ( method == tapAttr.getMethod() )
        {
          tr.setAttribute(attr, tapAttr.getValue());
        }
      }
View Full Code Here

Examples of org.testng.ITestNGMethod

   
    if (alphabetical) {
      @SuppressWarnings({"unchecked"})
      Comparator<? super ITestNGMethod>  alphabeticalComparator = new Comparator(){
        public int compare(Object o1, Object o2) {
          ITestNGMethod m1 = (ITestNGMethod) o1;
          ITestNGMethod m2 = (ITestNGMethod) o2;
          return m1.getMethodName().compareTo(m2.getMethodName());
        }
      };
      Collections.sort((List) invokedMethods, alphabeticalComparator);
    }
   
View Full Code Here

Examples of org.testng.ITestNGMethod

     
      // Get the transitive closure of all the failed methods and the methods
      // they depend on
      Collection<ITestResult> tests = failedTests.isEmpty() ? skippedTests : failedTests;
      for (ITestResult failedTest : tests) {
        ITestNGMethod current = failedTest.getMethod();
        if (current.isTest()) {
          methodsToReRun.put(current, 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()) {
                methodsToReRun.put(m, m);
View Full Code Here

Examples of org.testng.ITestNGMethod

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

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

      String fqName = Utils.detailedMethodName(method, false);
      sb.append("<td title='").append(tr.getTestClass().getName()).append(".").append(tr.getName()).append("()'>").append(fqName);
     
      // Method description
      if (! Utils.isStringEmpty(method.getDescription())) {
        sb.append("<br/><b>").append(method.getDescription()).append("</b>");
      }
     
      Object[] parameters = tr.getParameters();
      if (parameters != null && parameters.length > 0) {
        sb.append("<br/><b>Parameters:</b> ");
View Full Code Here

Examples of org.testng.ITestNGMethod

 
  }
 
  private static class ConfigurationComparator implements Comparator<ITestResult> {
    public int compare(ITestResult o1, ITestResult o2) {
      ITestNGMethod tm1= o1.getMethod();
      ITestNGMethod tm2= o2.getMethod();
      return annotationValue(tm2) - annotationValue(tm1);
    }
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 (MethodInstance mi : m_testMethods) {
      ITestNGMethod tm = mi.getMethod();
      if (tm.getTimeOut() > result) {
        result = tm.getTimeOut();
      }
    }
   
    return result;
  }
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.