Package org.cishell.testing.convertertester.core.tester.graphcomparison

Examples of org.cishell.testing.convertertester.core.tester.graphcomparison.ComparisonResult


      Graph resultGraph = (Graph) originalInMemory[0].getData();
      Graph origGraph = (Graph) resultInMemory[0].getData();

      NewGraphComparer comparer = testData.getComparer();
      ComparisonResult graphComparisonPhaseResult = comparer.compare(
          origGraph, resultGraph);

      if (!graphComparisonPhaseResult.comparisonSucceeded()) {
        String explanation =
          graphComparisonPhaseResult.getLog();
        FilePassFailure failure = createFailResult(originalFileData,
            explanation, PassPhase.GRAPH_COMPARE_PHASE,
            null,
            allDataFromTestPhase,
            allDataFromOrigComparePhase,
View Full Code Here


  public ComparisonResult compare(Graph g1, Graph g2) {
    this.log = new RunningLog();
   
    if (g1 == null || g2 == null) {
      log.prepend("At least one of the provided graphs was null");
      return new ComparisonResult(false, log);
    }
    //basic tests 
    if (! isSameDirectedness(g1, g2)) {
      log.prepend("Directedness not of the same type");
      return new ComparisonResult(false, log);
    } else if (! isEqualNodeCount(g1, g2)) {
      log.prepend("Node counts not equal.");
      return new ComparisonResult(false, log);
    } else if (! isEqualEdgeCount(g1, g2)) {
      log.prepend("Edge counts not equal");
      return new ComparisonResult(false, log);
    }
   
    //all tests succeeded.
    return new ComparisonResult(true, log);
  }
View Full Code Here

   
    public ComparisonResult compare(Graph g1, Graph g2) {
      super.clearLog();
      this.log = super.getLog();
     
      ComparisonResult simpleCompareResult = super.compare(g1, g2);
     
      if (! simpleCompareResult.comparisonSucceeded()) {
        return simpleCompareResult;
      }
     
      log.append(simpleCompareResult.getLog());
   
      if (! areEqual(g1, g2,  true))  {
        log.prepend("Graphs do not have the same contents");
        return new ComparisonResult(false, log)
      }
       
    //all tests passed
      log.prepend("All comparison tests succeeded.");
      return new ComparisonResult(true, log);
    }
View Full Code Here

  private RunningLog log;
 
  public ComparisonResult compare(Graph g1, Graph g2) {
    super.clearLog();
    this.log = super.getLog();
    ComparisonResult simpleCompareResult = super.compare(g1, g2);
   
    if (! simpleCompareResult.comparisonSucceeded()) {
      return simpleCompareResult;
    }
   
    log.append(simpleCompareResult.getLog());
   
    if (! nodeDegreeFrequenciesEqual(g1, g2)) {
      log.prepend("The number of nodes" +
          "with a certain number of edges is not the same in" +
          "both graphs.");
      return new ComparisonResult(false, log);
    }
   
    /*
     * TODO: we could really use a graph isomorphism comparison right
     * here. nodeDegreeFrequencies will catch some errors, but lets
     * a lot through.
     */ 
   
    if (! haveSameNodeAttributes(g1, g2)) {
      log.prepend("Node attributes are not " +
          "the same in both graphs.");
      return new ComparisonResult(false, log);
    }
   
    if (! haveSameEdgeAttributes(g1, g2)) {
      log.prepend("Edge attributes are not " +
          "the same in both graphs.");
      return new ComparisonResult(false, log);
    }
 
  //all tests passed
   
    log.prepend("All comparison tests succeeded");
    return new ComparisonResult(true, log);
  }
View Full Code Here

  public ComparisonResult compare(Graph g1, Graph g2) {
    this.log = new RunningLog();
   
    if (g1 == null || g2 == null) {
      log.prepend("At least one of the provided graphs was null");
      return new ComparisonResult(false, log);
    }

    if (! isEqualNodeCount(g1, g2)) {
      log.prepend("Node counts not equal.");
      return new ComparisonResult(false, log);
    } else if (! isEqualEdgeCount(g1, g2)) {
      log.prepend("Edge counts not equal.");
      return new ComparisonResult(false, log);
    }
   
    //all tests succeeded.
    return new ComparisonResult(true, log);
  }
View Full Code Here

TOP

Related Classes of org.cishell.testing.convertertester.core.tester.graphcomparison.ComparisonResult

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.