Package junit.framework

Examples of junit.framework.ComparisonFailure


  public void assertAny(Iterable<Diagnostic> asserted, DiagnosticPredicate... predicates) {
    for(DiagnosticPredicate predicate : predicates)
      if(Iterables.any(asserted, predicate))
        return;
    throw new ComparisonFailure(
      "No predicate (any expected) matches diagnostics", Arrays.toString(predicates),
      diagnosticsToString(asserted));

  }
View Full Code Here


  /**
   * Warnings and/or errors must be present.
   */
  public void assertDiagnostics() {
    if(diagnostics.getChildren().size() < 1)
      throw new ComparisonFailure("Diagnostics expected", "> 0 Diagnostics", "");
  }
View Full Code Here

   * @param message
   * @param diag
   */
  public void assertOk() {
    if(diagnostics.getChildren().size() > 0)
      throw new ComparisonFailure(
        "No diagnostics expected", "No diagnostics", diagnosticsToString(diagnostics.getChildren()));
  }
View Full Code Here

             && areEqual(i.previous(), j.previous())) {
        ++commonSuffix;
      }
    }

    throw new ComparisonFailure(
        "Expected: {{{\n"
        + snippet(expected,
                  Math.max(commonPrefix - diffContext, 0),
                  Math.min(m, m - commonSuffix + diffContext), 84)
        + "\n}}} != {{{\n"
View Full Code Here

TOP

Related Classes of junit.framework.ComparisonFailure

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.