12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- /* $Id$ */
-
- package org.apache.fop.render.bitmap;
-
- import java.awt.image.BufferedImage;
-
- import org.junit.Test;
-
- import static org.junit.Assert.assertEquals;
-
- import org.apache.fop.apps.FopConfBuilder;
- import org.apache.fop.apps.MimeConstants;
- import org.apache.fop.apps.TIFFRendererConfBuilder;
- import org.apache.fop.render.bitmap.TIFFRendererConfig.TIFFRendererConfigParser;
-
- import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T4;
- import static org.apache.fop.render.bitmap.TIFFCompressionValue.CCITT_T6;
-
- public class TIFFRendererConfiguratorTestCase extends AbstractBitmapRendererConfiguratorTest {
-
- public TIFFRendererConfiguratorTestCase() {
- super(MimeConstants.MIME_TIFF, TIFFDocumentHandler.class);
- }
-
- @Override
- public TIFFRendererConfigurator createConfigurator() {
- return new TIFFRendererConfigurator(userAgent, new TIFFRendererConfigParser());
- }
-
- @Override
- protected TIFFRendererConfBuilder createBuilder() {
- return new FopConfBuilder().startRendererConfig(TIFFRendererConfBuilder.class);
- }
-
- @Test
- @Override
- public void testColorModes() throws Exception {
- for (TIFFCompressionValue value : TIFFCompressionValue.values()) {
- parseConfig(createBuilder().setCompressionMode(value.getName()));
- if (value == CCITT_T6 || value == CCITT_T4) {
- assertEquals(BufferedImage.TYPE_BYTE_BINARY, settings.getBufferedImageType());
- } else {
- assertEquals(BufferedImage.TYPE_INT_ARGB, settings.getBufferedImageType());
- }
- }
- }
- }
|