Ejemplo n.º 1
0
 public Vector<Vertex> getUncoveredVertices() {
   Vector<Vertex> retur = new Vector<Vertex>();
   for (Vertex vertex : getAllVertices()) {
     if (vertex.getVisitedKey() <= 0) {
       retur.add(vertex);
     }
   }
   return retur;
 }
Ejemplo n.º 2
0
  private int getVertexCoverage(Collection<Vertex> modelItems) {
    int unique = 0;

    for (Vertex vertex : modelItems) {
      if (vertex.getVisitedKey() > 0) {
        unique++;
      }
    }
    return unique;
  }
Ejemplo n.º 3
0
  public String getStatisticsVerbose() {
    String retur = "";
    String newLine = "\n";
    Vector<String> notCovered = new Vector<String>();

    for (Edge edge : model.getEdges()) {
      if (edge.getVisitedKey() <= 0) {
        notCovered.add("Edge not reached: " + edge + newLine);
      }
    }
    for (Vertex vertex : model.getVertices()) {
      if (vertex.getVisitedKey() <= 0) {
        notCovered.add("Vertex not reached: " + vertex + newLine);
      }
    }
    if (notCovered.size() > 0) {
      Collections.sort(notCovered);
      for (String string : notCovered) {
        retur += string;
      }
    }

    Iterator<Entry<String, Boolean>> it = reqs.entrySet().iterator();
    while (it.hasNext()) {
      Entry<String, Boolean> pairs = it.next();

      if (pairs.getValue() == null) {
        retur += "Requirement: " + pairs.getKey() + " is not tested." + newLine;
        continue;
      }
      if (pairs.getValue().booleanValue() == true) {
        retur += "Requirement: " + pairs.getKey() + " has passed." + newLine;
        continue;
      }
      if (pairs.getValue().booleanValue() == false) {
        retur += "Requirement: " + pairs.getKey() + " has failed." + newLine;
        continue;
      }
    }

    retur += getStatisticsString() + newLine;
    retur += "Execution time: " + ((System.currentTimeMillis() - start_time) / 1000) + " seconds";
    return retur;
  }