diff --git a/jhdf/src/main/java/io/jhdf/api/WritableAttributeImpl.java b/jhdf/src/main/java/io/jhdf/api/WritableAttributeImpl.java index 93c5a00a..4132d572 100644 --- a/jhdf/src/main/java/io/jhdf/api/WritableAttributeImpl.java +++ b/jhdf/src/main/java/io/jhdf/api/WritableAttributeImpl.java @@ -1,3 +1,12 @@ +/* + * This file is part of jHDF. A pure Java library for accessing HDF5 files. + * + * http://jhdf.io + * + * Copyright (c) 2024 James Mudd + * + * MIT License see 'LICENSE' file + */ package io.jhdf.api; import io.jhdf.Utils; diff --git a/jhdf/src/test/java/io/jhdf/SimpleWritingTest.java b/jhdf/src/test/java/io/jhdf/SimpleWritingTest.java index 26713c07..a11803b6 100644 --- a/jhdf/src/test/java/io/jhdf/SimpleWritingTest.java +++ b/jhdf/src/test/java/io/jhdf/SimpleWritingTest.java @@ -173,6 +173,19 @@ void writeAttributes() throws Exception { assertThat(attribute.getDimensions()).isEqualTo(new int[] {3}); assertThat(attribute.getJavaType()).isEqualTo(int.class); } + } + + @Test + @Order(6) + @EnabledIfH5DumpAvailable + void readAttributesWithH5Dump() throws Exception { + // Read with h5dump + HDF5FileXml hdf5FileXml = H5Dump.dumpAndParse(tempFile); + // Read with jhdf + try(HdfFile hdfFile = new HdfFile(tempFile)) { + // Compare + H5Dump.assetXmlAndHdfFileMatch(hdf5FileXml, hdfFile); + } } } diff --git a/jhdf/src/test/java/io/jhdf/object/message/AttributeMessageTest.java b/jhdf/src/test/java/io/jhdf/object/message/AttributeMessageTest.java index f73d9209..67139f44 100644 --- a/jhdf/src/test/java/io/jhdf/object/message/AttributeMessageTest.java +++ b/jhdf/src/test/java/io/jhdf/object/message/AttributeMessageTest.java @@ -1,17 +1,24 @@ +/* + * This file is part of jHDF. A pure Java library for accessing HDF5 files. + * + * http://jhdf.io + * + * Copyright (c) 2024 James Mudd + * + * MIT License see 'LICENSE' file + */ package io.jhdf.object.message; import io.jhdf.Superblock; import io.jhdf.api.WritableAttributeImpl; import io.jhdf.storage.HdfBackingStorage; import org.junit.jupiter.api.Test; -import org.mockito.Mockito; import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.util.BitSet; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when;