Examples of SanityCheck


Examples of org.databene.dbsanity.model.SanityCheck

    out.println("</div>");
  }

  private void exportChange(StructuralChange<?> change, boolean defectsColumn, FilePrintWriter out) throws IOException {
    DBObject mainObject = mainObject(change);
    SanityCheck check = change.getCheck();

    out.println("<tr>");
    // column #1: object
    printCell(renderMainObject(mainObject, out.getFile()), out);
    // column #2: type
    printCell(change.getType(), out);
    // column #3: details
    printCell(change.getDetails(), out);
    // column #4: constraint name
    DBObject affectedObject = change.getAffectedObject();
    printCell(affectedObject instanceof DBConstraint ? affectedObject.getName() : null, out);
    // column #5: defects
    if (defectsColumn) {
      SanityCheckVerdict verdict = check.getVerdict();
      File targetPage = (verdict == SanityCheckVerdict.PASSED ? ReportUtil.getDocPage(check) : ReportUtil.getDefectsOrErrorPage(check));
      String label = (verdict == SanityCheckVerdict.FAILED ? String.valueOf(check.getDefectCount()) : (verdict == SanityCheckVerdict.ERROR ? "ERROR" : "NONE"));
      printCell(HTMLUtil.aNewWindow(FileUtil.relativePath(out.getFile().getCanonicalFile(), targetPage, '/'), label), out);
    }
    out.println("</tr>");
  }
View Full Code Here

Examples of org.databene.dbsanity.model.SanityCheck

    for (StructuralChange<?> change : changes) {
      ChangeSeverity changeSeverity = change.getSeverity();
      if (severity == null || severity.compareTo(changeSeverity) < 0)
        severity = changeSeverity;
      if (severity == ChangeSeverity.RESTRICTION) {
        SanityCheck check = change.getCheck();
        if (check != null) {
          SanityCheckVerdict changeVerdict = check.getVerdict();
          if (verdict == null || verdict.compareTo(changeVerdict) < 0)
            verdict = changeVerdict;
        }
      }
    }
View Full Code Here

Examples of org.databene.dbsanity.model.SanityCheck

  // helpers ---------------------------------------------------------------------------------------------------------

  private void exportAtomicChange(StructuralChange<?> change, FilePrintWriter out) {
    DBObject mainObject = mainObject(change);
    DBObject affectedObject = change.getAffectedObject();
    SanityCheck check = change.getCheck();
    String constraintName = affectedObject instanceof DBConstraint ? affectedObject.getName() : "";
    String checkResult = (check != null ?
        (check.getVerdict() == SanityCheckVerdict.FAILED ?
            (check.getDefectCount() + " FAILURES") :
            check.getVerdict().name()) :
        "");
    printRow(
      out,
      SQLUtil.typeAndName(mainObject), // col#1: object
      change.getType(), // col#2: change type
      change.getDetails(), // col#3: details
      constraintName, // col#4: constraint name
      change.getSeverity().name(), // col#5: severity
      checkResult, // col#6: check result
      (check != null ? check.getName() : "")// col#7: check name
    );
  }
View Full Code Here

Examples of org.databene.dbsanity.model.SanityCheck

    for (StructuralChange<?> change : changes) {
      ChangeSeverity changeSeverity = change.getSeverity();
      if (severity == null || severity.compareTo(changeSeverity) < 0)
        severity = changeSeverity;
      if (severity == ChangeSeverity.RESTRICTION) {
        SanityCheck check = change.getCheck();
        if (check != null) {
          SanityCheckVerdict changeVerdict = check.getVerdict();
          if (verdict == null || verdict.compareTo(changeVerdict) < 0)
            verdict = changeVerdict;
        }
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.