Exemplo n.º 1
0
  private void removeRecord(SummarySingleDto metric) {

    TreeItem testItem = getTestItem(metric.getMetricName().getTest());
    String key = testItem.getKey() + metric.getMetricName().getMetricName();

    for (TreeItem item : treeStore.getChildren(testItem)) {
      if (item.getKey().equals(key)) {
        removeWithParent(item);
        return;
      }
    }
  }
Exemplo n.º 2
0
    public TreeItem(SummarySingleDto metricDto) {

      MetricNameDto metricName = metricDto.getMetricName();
      this.key =
          getTestItemId(metricDto.getMetricName().getTest())
              + metricDto.getMetricName().getMetricName();
      put(NAME, metricName.getMetricDisplayName());
      put(TEST_DESCRIPTION, metricName.getTest().getDescription());
      put(TEST_NAME, getItemKey(metricName));

      for (SummaryMetricValueDto metricValue : metricDto.getValues()) {
        String value = metricValue.getValueRepresentation();

        // highlight results according to decision when available
        if (metricValue.getDecision() != null) {
          String toolTip =
              "Decision for metric during test run. Green - value in limits. Yellow - value crossed warning limits. Red - value outside limits";
          switch (metricValue.getDecision()) {
            case OK:
              value =
                  "<p title=\""
                      + toolTip
                      + "\" style=\"color:green;font-weight:700;display:inline;\">"
                      + value
                      + "</p>";
              break;
            case WARNING:
              value =
                  "<p title=\""
                      + toolTip
                      + "\" style=\"color:#B8860B;font-weight:700;display:inline;\">"
                      + value
                      + "</p>";
              break;
            default:
              value =
                  "<p title=\""
                      + toolTip
                      + "\" style=\"color:red;font-weight:700;display:inline;\">"
                      + value
                      + "</p>";
              break;
          }
        }

        put(SESSION_HEADER + metricValue.getSessionId(), value);
      }
    }
Exemplo n.º 3
0
  private void addItemToStore(TreeItem record, SummarySingleDto metricDto) {

    TreeItem taskItem = getTestItem(metricDto.getMetricName().getTest());
    for (TreeItem rec : treeStore.getChildren(taskItem)) {
      if (rec.getKey().equals(record.getKey())) {
        return;
      }
    }
    treeStore.add(taskItem, record);
  }