示例#1
0
 public void testExtraSpaces(SheetValidation sheetValidation) {
   String colC = "Column C";
   ColumnValidation validateColC = sheetValidation.createColumnValidation(colC);
   boolean check = validateColC.leadingTrailingSpaces();
   if (!check) {
     StringBuffer errorToPrint =
         sheetValidation
             .getErrorManager()
             .createMessage(ErrorManager.EXTRA_SPACES_ERROR, validateColC.getErrorsFound());
     System.out.println(errorToPrint);
     sheetValidation.getErrorManager().printMessage(errorToPrint.toString());
   }
 }
示例#2
0
 public void testUniqueValue(SheetValidation sheetValidation) {
   String colC = "Column C";
   ColumnValidation validateColC = sheetValidation.createColumnValidation(colC);
   boolean check = validateColC.uniqueValue();
   if (!check) {
     StringBuffer errorToPrint =
         sheetValidation
             .getErrorManager()
             .createDupFoundMessage(
                 ErrorManager.UNIQUENESS_ERROR, validateColC.getMultipleErrorsFound(), ",");
     System.out.println(errorToPrint);
     sheetValidation.getErrorManager().printMessage(errorToPrint.toString());
   }
 }
示例#3
0
 public void testPatternAbsent(SheetValidation sheetValidation) {
   String colA = "Column A";
   ColumnValidation validateColA = sheetValidation.createColumnValidation(colA);
   String[] pattern = new String[] {".", "/"};
   boolean check = validateColA.isPatternAbsent(pattern);
   if (!check) {
     ErrorManager errorManager = sheetValidation.getErrorManager();
     String message =
         ErrorManager.PATTERN_DETECTED_ERROR + errorManager.getListOfTerms(pattern, " or ");
     StringBuffer errorToPrint =
         errorManager.createMessage(message, validateColA.getErrorsFound());
     System.out.println(errorToPrint);
     errorManager.printMessage(errorToPrint.toString());
   }
 }
示例#4
0
 public void testPatternPresent(SheetValidation sheetValidation) {
   String colB = "Column B";
   ColumnValidation validateColB = sheetValidation.createColumnValidation(colB);
   String[] pattern = new String[] {".jpg", ".tiff"};
   boolean check = validateColB.isPatternPresent(pattern);
   if (!check) {
     ErrorManager errorManager = sheetValidation.getErrorManager();
     String message =
         ErrorManager.PATTERN_NOT_FOUND_ERROR + errorManager.getListOfTerms(pattern, " or ");
     StringBuffer errorToPrint =
         errorManager.createMessage(message, validateColB.getErrorsFound());
     System.out.println(errorToPrint);
     errorManager.printMessage(errorToPrint.toString());
   }
 }
示例#5
0
 public void testDropDown(SheetValidation sheetValidation) {
   String colB = "Column B";
   String colDD = "Drop Down";
   ColumnValidation validation = sheetValidation.createColumnValidation(colB, colDD);
   boolean check = validation.dropDown();
   if (!check) {
     //			StringBuffer errorToPrint = sheetValidation.getErrorManager()
     //					.createDropDownMessage(ErrorManager.DROP_DOWN_ERROR,
     // validation.getMultipleErrorsFound());
     StringBuffer errorToPrint2 =
         sheetValidation
             .getErrorManager()
             .createMessageFromErrorMessage(
                 ErrorManager.DROP_DOWN_ERROR, new Object[] {validation.getMultipleErrorsFound()});
     System.out.println(errorToPrint2);
     //			sheetValidation.getErrorManager().printMessage(errorToPrint.toString());
   }
 }