1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.apache.commons.imaging.formats.xpm;
16
17 import static org.junit.jupiter.api.Assertions.assertFalse;
18 import static org.junit.jupiter.api.Assertions.assertNotNull;
19
20 import java.awt.image.BufferedImage;
21 import java.io.File;
22 import java.util.List;
23
24 import org.apache.commons.imaging.ImageInfo;
25 import org.apache.commons.imaging.Imaging;
26 import org.apache.commons.imaging.common.ImageMetadata;
27 import org.apache.commons.imaging.internal.Debug;
28 import org.junit.jupiter.api.Test;
29
30 public class XpmReadTest extends AbstractXpmTest {
31
32 @Test
33 public void test() throws Exception {
34 Debug.debug("start");
35
36 final List<File> images = getXpmImages();
37 for (final File imageFile : images) {
38
39 Debug.debug("imageFile", imageFile);
40
41 final ImageMetadata metadata = Imaging.getMetadata(imageFile);
42 assertFalse(metadata instanceof File);
43
44 final ImageInfo imageInfo = Imaging.getImageInfo(imageFile);
45 assertNotNull(imageInfo);
46
47 final BufferedImage image = Imaging.getBufferedImage(imageFile);
48 assertNotNull(image);
49 }
50 }
51
52 }