ImportProfile { public Integer getPreviewMaxHeight() { return getPositiveInteger(PREVIEW_MAX_HEIGHT); } ImportProfile(Configuration config);  ImportProfile(Configuration config, String profileId); String getProfileId(); ImportHandler createImporter(); String getModelId(); String getAudioModelID(); String getPlainOcrCharset(); String getPlainOcrFileSuffix(); String getPlainOcrFilePath(); int getOcrAltoFolderPath(); String getAltoFileSuffix(); String getAltoFilePath(); String getAltoFileVersion(); Configuration getNdkUserProcessor(); Configuration getNdkArchivalProcessor(); String getNdkArchivalFileSuffix(); String getNdkArchivalAudioFileSuffix(); String getNdkUserFileSuffix(); String getNdkUserAudioFileSuffix(); String getDefaultOcr(); String getDefaultAlto(); String getDefaultCatalog(); String getArchiveCatalog(); boolean getDefaultAltoAndOcr(); boolean getDeletePackageImport(); boolean getDefaultImportFolder(); String getImportFolderPath(); Configuration getConvertorJpgSmallProcessor(); Configuration getConvertorJpgLargeProcessor(); Configuration getConvertorJp2Processor(); Configuration getConvertorTiffToJpgProcessor(); Boolean getCreateModelsHierarchy(); boolean isTiffToJpgDefined(); Integer getPreviewMaxHeight(); Integer getPreviewMaxWidth(); ScalingMethod getPreviewScaling(); List<Object> getRequiredDatastreamId(); Configuration getThumbnailProcessor(); Integer getThumbnailMaxHeight(); Integer getThumbnailMaxWidth(); ScalingMethod getThumbnailScaling(); void checkPreviewScaleParams(); void checkThumbnailScaleParams(); static final String PROFILES; static final String ALTO_SUFFIX; static final String ALTO_FILE_PATH; static final String ALTO_VERSION; static final String MODEL_ID; static final String MODEL_AUDIO_ID; static final String NDK_ARCHIVAL_PROCESSOR; static final String NDK_ARCHIVAL_SUFFIX; static final String NDK_USER_PROCESSOR; static final String NDK_USER_SUFFIX; static final String PLAIN_OCR_CHARSET; static final String PLAIN_OCR_FILE_PATH; static final String OCRALTO_LAST_FOLDER_PATH; static final String PLAIN_OCR_SUFFIX; static final String PREVIEW_JAVA_SCALING; static final String PREVIEW_MAX_HEIGHT; static final String PREVIEW_MAX_WIDTH; static final String PROCESSOR; static final String REQUIRED_DATASTREAM; static final String THUMBNAIL_JAVA_SCALING; static final String THUMBNAIL_MAX_HEIGHT; static final String THUMBNAIL_MAX_WIDTH; static final String THUMBNAIL_PROCESSOR; static final String CONVERTOR_JPG_SMALL_PROCESSOR; static final String CONVERTOR_JPG_LARGE_PROCESSOR; static final String CONVERTOR_JP2_PROCESSOR; static final String CONVERTOR_TIFF_JPG_PROCESSOR; static final String NDK_ARCHOVAL_AUDIO_SUFFIX; static final String NDK_USER_AUDIO_SUFFIX; static final String CREATE_MODELS_HIERARCHY; static final String DEFAULT_ALTO; static final String DEFAULT_OCR; static final String DEFAULT_CATALOG; static final String DEFAULT_ARCHIVE_CATALOG; static final String DEFAULT_ALTO_AND_OCR; static final String DELETE_PACKAGE_IMPORT; static final String DEFAULT_IMPORT_FOLDER; static final String IMPORT_FOLDER_PATH; }
@Test public void testGetPreviewMaxHeight() { ImportProfile instance = new ImportProfile(conf); assertNull(instance.getPreviewMaxHeight()); conf.setProperty(ImportProfile.PREVIEW_MAX_HEIGHT, "100"); assertEquals(Integer.valueOf(100), instance.getPreviewMaxHeight()); try { conf.setProperty(ImportProfile.PREVIEW_MAX_HEIGHT, "nonsense"); instance.getPreviewMaxHeight(); fail(); } catch (Exception e) { } try { conf.setProperty(ImportProfile.PREVIEW_MAX_HEIGHT, -100); instance.getPreviewMaxHeight(); fail(); } catch (Exception e) { } }