Package org.easetech.easytest.reports.data

Examples of org.easetech.easytest.reports.data.Duration


    // sort the methods on name
    Map<String, Duration> methodDurationBeans = CommonUtils.sortByKeys(getMethodDurationBeans(methodTestResults));
   
    // add the duration beans to the list
    for (String methodName: methodDurationBeans.keySet()) {
      Duration duration = methodDurationBeans.get(methodName);
      durationBeans.add(duration);
    }
   
    List<MethodDurationReportBean> methodDurationReportBeans = new ArrayList<MethodDurationReportBean>();
   
View Full Code Here


      }
    }
   
    for (String methodName: subResult.keySet()) {
      List<TestMethodDuration> testMethodDurations = subResult.get(methodName);
      Duration calculateTestDurationBean = this.calculateTestDurationBean(methodName, testMethodDurations);
      resultMap.put(methodName, calculateTestDurationBean);
    }
   
    return resultMap;
  }
View Full Code Here

   * @param item test method call
   * @param testItemDurations list of test item durations
   * @return duration bean with max/min/avg in ms
   */
  public Duration calculateTestDurationBean(String method, List<TestMethodDuration> testMethodDurations) {
    Duration resultBean = new Duration(method);
   
    double total = 0.0;
    double min = Double.MAX_VALUE;
    double max = Double.MIN_VALUE;
    int count = 0;
     
    for (TestMethodDuration testMethodDuration : testMethodDurations) {
      double timeInMs = testMethodDuration.getRoundedMsDifference().doubleValue();
      //double timeInMs = testMethodDuration.getNanoDifference();
     
      if (timeInMs > max) {
        max = timeInMs;
      }
      if (timeInMs < min) {
        min = timeInMs;
      }
      total += timeInMs;
      count++;
    }
   
    resultBean.setMin(min != Double.MAX_VALUE ? (int)Math.round(min) : 0);
    resultBean.setMax(max != Double.MIN_VALUE ? (int)Math.round(max) : 0);
    resultBean.setAvg((int)Math.round(total/count));
    resultBean.setCount(count);

    return resultBean;
  }
View Full Code Here

TOP

Related Classes of org.easetech.easytest.reports.data.Duration

Copyright © 2018 www.massapicom. 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.