@Override public Map<String, List<PropertyValidator>> getPropertiesValidators() { Map<String, List<PropertyValidator>> validatorsByProperty = new HashMap<>(); List<PropertyValidator> validatorsPdfOrientation = new ArrayList<>(); validatorsPdfOrientation.add(new org.uberfire.ext.editor.commons.file.exports.PdfOrientationValidator()); validatorsByProperty.put("pdfOrientation", validatorsPdfOrientation); List<PropertyValidator> validatorsPdfUnit = new ArrayList<>(); validatorsPdfUnit.add(new org.uberfire.ext.editor.commons.file.exports.PdfUnitValidator()); validatorsByProperty.put("pdfUnit", validatorsPdfUnit); List<PropertyValidator> validatorsPdfFormat = new ArrayList<>(); validatorsPdfFormat.add(new org.uberfire.ext.editor.commons.file.exports.PdfFormatValidator()); validatorsByProperty.put("pdfFormat", validatorsPdfFormat); return validatorsByProperty; }
@Test public void testOrientation() { assertTrue(ORIENTATION_VALIDATOR.validate(PdfExportPreferences.Orientation.PORTRAIT.name()).isValid()); assertTrue(ORIENTATION_VALIDATOR.validate(PdfExportPreferences.Orientation.LANDSCAPE.name()).isValid()); assertFalse(ORIENTATION_VALIDATOR.validate("someOrientation").isValid()); }
@Test public void testOrientation() { assertTrue(ORIENTATION_VALIDATOR.validate(PdfExportPreferences.Orientation.PORTRAIT.name()).isValid()); assertTrue(ORIENTATION_VALIDATOR.validate(PdfExportPreferences.Orientation.LANDSCAPE.name()).isValid()); assertFalse(ORIENTATION_VALIDATOR.validate("someOrientation").isValid()); }
@Override public Map<String, List<PropertyValidator>> getPropertiesValidators() { Map<String, List<PropertyValidator>> validatorsByProperty = new HashMap<>(); List<PropertyValidator> validatorsPdfOrientation = new ArrayList<>(); validatorsPdfOrientation.add(new org.uberfire.ext.editor.commons.file.exports.PdfOrientationValidator()); validatorsByProperty.put("pdfOrientation", validatorsPdfOrientation); List<PropertyValidator> validatorsPdfUnit = new ArrayList<>(); validatorsPdfUnit.add(new org.uberfire.ext.editor.commons.file.exports.PdfUnitValidator()); validatorsByProperty.put("pdfUnit", validatorsPdfUnit); List<PropertyValidator> validatorsPdfFormat = new ArrayList<>(); validatorsPdfFormat.add(new org.uberfire.ext.editor.commons.file.exports.PdfFormatValidator()); validatorsByProperty.put("pdfFormat", validatorsPdfFormat); return validatorsByProperty; }