@Test public void testAvailableOutputFormats() throws Exception { final HashMap<Format, Set<Format>> formats = new HashMap<>(); for (Format format : ImageReader.supportedFormats()) { formats.put(format, ImageWriter.supportedFormats()); } instance.setSourceFormat(Format.JPG); Set<Format> expectedFormats = formats.get(Format.JPG); assertEquals(expectedFormats, instance.getAvailableOutputFormats()); }
@Test public void testGetSupportedFeatures() throws Exception { instance.setSourceFormat(getAnySupportedSourceFormat(instance)); Set<ProcessorFeature> expectedFeatures = new HashSet<>(); expectedFeatures.add(ProcessorFeature.MIRRORING); expectedFeatures.add(ProcessorFeature.REGION_BY_PERCENT); expectedFeatures.add(ProcessorFeature.REGION_BY_PIXELS); expectedFeatures.add(ProcessorFeature.REGION_SQUARE); expectedFeatures.add(ProcessorFeature.ROTATION_ARBITRARY); expectedFeatures.add(ProcessorFeature.ROTATION_BY_90S); expectedFeatures.add(ProcessorFeature.SIZE_ABOVE_FULL); expectedFeatures.add(ProcessorFeature.SIZE_BY_DISTORTED_WIDTH_HEIGHT); expectedFeatures.add(ProcessorFeature.SIZE_BY_FORCED_WIDTH_HEIGHT); expectedFeatures.add(ProcessorFeature.SIZE_BY_HEIGHT); expectedFeatures.add(ProcessorFeature.SIZE_BY_PERCENT); expectedFeatures.add(ProcessorFeature.SIZE_BY_WIDTH); expectedFeatures.add(ProcessorFeature.SIZE_BY_WIDTH_HEIGHT); assertEquals(expectedFeatures, instance.getSupportedFeatures()); }