source: josm/trunk/test/unit/org/openstreetmap/josm/tools/ImageProviderTest.java@ 8510

Last change on this file since 8510 was 7937, checked in by bastiK, 9 years ago

add subversion property svn:eol=native

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import static org.hamcrest.CoreMatchers.is;
5import static org.junit.Assert.assertThat;
6
7import java.awt.Transparency;
8import java.io.File;
9import java.io.IOException;
10
11import org.junit.Test;
12import org.openstreetmap.josm.TestUtils;
13
14/**
15 * Unit tests of {@link ImageProvider} class.
16 */
17public class ImageProviderTest {
18
19 /**
20 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/9984">#9984</a>
21 * @throws IOException if an error occurs during reading
22 */
23 @Test
24 public void testTicket9984() throws IOException {
25 File file = new File(TestUtils.getRegressionDataFile(9984, "tile.png"));
26 assertThat(ImageProvider.read(file, true, true).getTransparency(), is(Transparency.TRANSLUCENT));
27 assertThat(ImageProvider.read(file, false, true).getTransparency(), is(Transparency.TRANSLUCENT));
28 assertThat(ImageProvider.read(file, false, false).getTransparency(), is(Transparency.OPAQUE));
29 assertThat(ImageProvider.read(file, true, false).getTransparency(), is(Transparency.OPAQUE));
30 }
31
32 /**
33 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/10030">#10030</a>
34 * @throws IOException if an error occurs during reading
35 */
36 @Test
37 public void testTicket10030() throws IOException {
38 File file = new File(TestUtils.getRegressionDataFile(10030, "tile.jpg"));
39 ImageProvider.read(file, true, true);
40 }
41}
Note: See TracBrowser for help on using the repository browser.