1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.imaging.formats.tiff.fieldtypes;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20 import static org.junit.jupiter.api.Assertions.fail;
21
22 import java.nio.ByteOrder;
23
24 import org.junit.jupiter.api.Test;
25
26 public class FieldTypeLongTest {
27
28 @Test
29 public void testWriteDataWithNonNull() {
30 final FieldTypeLong fieldTypeLong = AbstractFieldType.IFD;
31 final ByteOrder byteOrder = ByteOrder.BIG_ENDIAN;
32
33 try {
34 fieldTypeLong.writeData(byteOrder, byteOrder);
35 fail("Expecting exception: Exception");
36 } catch (final Exception e) {
37 assertEquals("Invalid data: BIG_ENDIAN (java.nio.ByteOrder)", e.getMessage());
38 assertEquals(FieldTypeLong.class.getName(), e.getStackTrace()[0].getClassName());
39 }
40 }
41
42 }