コード例 #1
0
  /**
   * pass checkpoint to ok if uncheck
   *
   * @param checkPointKey
   */
  protected void prepareCheckPoint(Context context, String checkPointKey) {
    //		ValidationReport validationReport = (ValidationReport) context.get(VALIDATION_REPORT);
    //		CheckPoint checkPoint = validationReport.findCheckPointByName(checkPointKey);
    //		if (checkPoint == null) {
    //			initializeCheckPoints(context);
    //			checkPoint = validationReport.findCheckPointByName(checkPointKey);
    //		}
    //		if (checkPoint.getDetails().isEmpty())
    //			checkPoint.setState(CheckPoint.RESULT.OK);

    ValidationReporter validationReporter = ValidationReporter.Factory.getInstance();

    if (!validationReporter.checkIfCheckPointExists(context, checkPointKey)) {
      initializeCheckPoints(context);
      validationReporter.prepareCheckPointReport(context, checkPointKey);
    }
  }
コード例 #2
0
 protected static void addItemToValidation(
     Context context, String prefix, String name, int count, String... severities) {
   //		ValidationReport validationReport = (ValidationReport) context.get(VALIDATION_REPORT);
   //		for (int i = 1; i <= count; i++) {
   //			String key = prefix + name + "-" + i;
   //			if (validationReport.findCheckPointByName(key) == null) {
   //				if (severities[i - 1].equals("W")) {
   //					validationReport.addCheckPoint(
   //							new CheckPoint(key, CheckPoint.RESULT.UNCHECK, CheckPoint.SEVERITY.WARNING));
   //				} else {
   //					validationReport.addCheckPoint(
   //							new CheckPoint(key, CheckPoint.RESULT.UNCHECK, CheckPoint.SEVERITY.ERROR));
   //				}
   //			}
   //		}
   //
   ValidationReporter validationReporter = ValidationReporter.Factory.getInstance();
   validationReporter.addItemToValidationReport(context, prefix, name, count, severities);
   return;
 }