diff options
author | Quincey Koziol <koziol@lbl.gov> | 2021-07-01 23:52:04 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@lbl.gov> | 2021-07-01 23:52:04 (GMT) |
commit | 682fc6ba3af245cc44de9ca5e9b35527460c512a (patch) | |
tree | 1f44496a052568150f338404b34db1fdd8964a3f /java | |
parent | 8c4af2a23ef3e512507e1fdef7624f7a1fb2ab25 (diff) | |
download | hdf5-682fc6ba3af245cc44de9ca5e9b35527460c512a.zip hdf5-682fc6ba3af245cc44de9ca5e9b35527460c512a.tar.gz hdf5-682fc6ba3af245cc44de9ca5e9b35527460c512a.tar.bz2 |
Jordan's patch to add test library to java builds
Diffstat (limited to 'java')
51 files changed, 296 insertions, 5 deletions
diff --git a/java/src/jni/CMakeLists.txt b/java/src/jni/CMakeLists.txt index ab306ef..dff0a88 100644 --- a/java/src/jni/CMakeLists.txt +++ b/java/src/jni/CMakeLists.txt @@ -73,6 +73,14 @@ set (HDF5_JAVA_JNI_CHDRS ${HDF5_JAVA_JNI_SOURCE_DIR}/nativeData.h ) +set (HDF5_JAVA_TEST_CSRCS + ${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni_test.c +) + +set (HDF5_JAVA_TEST_CHDRS + ${HDF5_JAVA_JNI_SOURCE_DIR}/h5jni_test.h +) + set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) ########### JNI libraries always must be built shared ############### @@ -87,6 +95,18 @@ set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/j SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_LIB_TARGET} ${HDF5_JAVA_JNI_LIB_NAME} SHARED "JAVA") +# Build Testing library +add_library (${HDF5_JAVA_JNI_TEST_LIB_TARGET} SHARED ${HDF5_JAVA_TEST_CSRCS} ${HDF5_JAVA_TEST_CHDRS}) +target_include_directories (${HDF5_JAVA_JNI_TEST_LIB_TARGET} + PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>" +) +target_compile_options(${HDF5_JAVA_JNI_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}") +TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_TEST_LIB_TARGET} SHARED) +target_link_libraries (${HDF5_JAVA_JNI_TEST_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET} ${HDF5_JAVA_JNI_LIB_TARGET}) +set_target_properties (${HDF5_JAVA_JNI_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/jni) +#SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_JAVA_JNI_TEST_LIB_TARGET}") +H5_SET_LIB_OPTIONS (${HDF5_JAVA_JNI_TEST_LIB_TARGET} ${HDF5_JAVA_JNI_TEST_LIB_NAME} SHARED "JAVA") + #----------------------------------------------------------------------------- # Add Target to clang-format #----------------------------------------------------------------------------- diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index bf086d2..d17d3d1 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -25,12 +25,15 @@ JAVA_API=yes AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) # This is our main target -lib_LTLIBRARIES=libhdf5_java.la +lib_LTLIBRARIES=libhdf5_java.la libhdf5_java_test.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) libhdf5_java_la_LDFLAGS = -avoid-version -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) -# Source files for the library +# Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) +libhdf5_java_test_la_LDFLAGS = -avoid-version -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) + +# Source files for the main Java library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ h5aImp.c h5dImp.c h5eImp.c h5fImp.c h5gImp.c h5iImp.c h5lImp.c h5oImp.c \ h5pImp.c h5pACPLImp.c h5pDAPLImp.c h5pDCPLImp.c h5pDXPLImp.c \ @@ -38,7 +41,13 @@ libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp h5pOCPLImp.c h5pOCpyPLImp.c h5pStrCPLImp.c h5plImp.c h5rImp.c h5sImp.c h5tImp.c \ h5vlImp.c h5zImp.c +# Source files for the Java testing library +libhdf5_java_test_la_SOURCES=h5jni_test.c + # HDF5 Java (JNI) library depends on HDF5 Library. libhdf5_java_la_LIBADD=$(LIBHDF5) +# HDF5 Java (JNI) Testing library depends on HDF5 Library and Java Library. +libhdf5_java_test_la_LIBADD=$(LIBHDF5) libhdf5_java.la + include $(top_srcdir)/config/conclude.am diff --git a/java/src/jni/h5jni_test.c b/java/src/jni/h5jni_test.c new file mode 100644 index 0000000..9929148 --- /dev/null +++ b/java/src/jni/h5jni_test.c @@ -0,0 +1,54 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * For details of the HDF libraries, see the HDF Documentation at: + * http://hdfgroup.org/HDF5/doc/ + * + */ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include <jni.h> +#include <stdlib.h> +#include "hdf5.h" +#include "H5VLprivate.h" +#include "h5jni.h" +#include "h5jni_test.h" + +/* + * Class: test_H5TestUtils + * Method: H5VLfapl_is_native + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL +Java_test_H5TestUtils_H5VLfapl_1is_1native(JNIEnv *env, jclass clss, jlong fapl_id) +{ + hbool_t bval = JNI_FALSE; + + UNUSED(clss); + + if (H5VL_fapl_is_native((hid_t)fapl_id, &bval) < 0) + H5_LIBRARY_ERROR(ENVONLY); + + bval = (bval > 0) ? JNI_TRUE : JNI_FALSE; + +done: + return (jboolean)bval; +} + +#ifdef __cplusplus +} /* end extern "C" */ +#endif /* __cplusplus */ + diff --git a/java/src/jni/h5jni_test.h b/java/src/jni/h5jni_test.h new file mode 100644 index 0000000..9f1968b --- /dev/null +++ b/java/src/jni/h5jni_test.h @@ -0,0 +1,34 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include <jni.h> +/* Header for HDF5 JNI test routines */ + +#ifndef Included_h5jni_test +#define Included_h5jni_test + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Class: test_H5TestUtils + * Method: H5VLfapl_is_native + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_test_H5TestUtils_H5VLfapl_1is_1native(JNIEnv *, jclass, jlong); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif /* __cplusplus */ + +#endif /* Included_h5jni_test */ diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index ffaf5f5..44c95cb 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -5,6 +5,10 @@ set (CMAKE_VERBOSE_MAKEFILE 1) set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${HDF5_JAVA_JNI_BINARY_DIR};${HDF5_JAVA_HDF5_LIB_DIR}") +set (HDF5_JAVA_TEST_JAR_SOURCES + H5TestUtils.java +) + set (HDF5_JAVA_TEST_SOURCES TestH5 TestH5Eparams @@ -68,7 +72,19 @@ if (HDF5_ENABLE_HDFS) ) endif () -set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_LIB_DIR}/junit.jar;${HDF5_JAVA_LIB_DIR}/hamcrest-core.jar;${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_SIMPLE_JAR}") +set (CMAKE_JAVA_INCLUDE_PATH "${HDF5_JAVA_LIB_DIR}/junit.jar;${HDF5_JAVA_LIB_DIR}/hamcrest-core.jar;${HDF5_JAVA_JARS};${HDF5_JAVA_LOGGING_JAR};${HDF5_JAVA_LOGGING_SIMPLE_JAR};${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") + +file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt +" +" +) + +# Build Testing JAR +add_jar (${HDF5_JAVA_TEST_LIB_TARGET} MANIFEST ${PROJECT_BINARY_DIR}/Manifest.txt ${HDF5_JAVA_TEST_JAR_SOURCES}) +add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET} ${HDF5_JAVA_HDF5_LIB_TARGET}) +get_target_property (${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_TEST_LIB_TARGET} JAR_FILE) + +set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") foreach (test_file ${HDF5_JAVA_TEST_SOURCES}) @@ -84,6 +100,7 @@ foreach (test_file ${HDF5_JAVA_TEST_SOURCES}) #get_target_property (${HDF5_JAVA_TEST_LIB_TARGET}_${test_file}_CLASSPATH ${HDF5_JAVA_TEST_LIB_TARGET}_${test_file} CLASSDIR) add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET}_${test_file} ${HDF5_JAVA_HDF5_LIB_TARGET}) + add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET}_${test_file} ${HDF5_JAVA_TEST_LIB_TARGET}) set_target_properties (${HDF5_JAVA_TEST_LIB_TARGET}_${test_file} PROPERTIES FOLDER test/java) endforeach () @@ -120,6 +137,7 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${CMAKE_INCLUDE_PATH}") endforeach () + set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE}") set (CMAKE_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_${test_file}_JAR_FILE}") add_test ( diff --git a/java/test/H5TestUtils.java b/java/test/H5TestUtils.java new file mode 100644 index 0000000..c96e856 --- /dev/null +++ b/java/test/H5TestUtils.java @@ -0,0 +1,77 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +package test; + +import hdf.hdf5lib.H5; +import hdf.hdf5lib.HDF5Constants; +import hdf.hdf5lib.exceptions.HDF5Exception; +import hdf.hdf5lib.exceptions.HDF5JavaException; +import hdf.hdf5lib.exceptions.HDF5LibraryException; + +/** + * This class contains testing routines for the Java interface which are + * public, but are not meant for general use. + **/ +public class H5TestUtils { + + private final static org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(H5TestUtils.class); + + private static boolean isLibraryLoaded = false; + + static { + loadH5TestLib(); + } + + /** + * load native testing library + */ + public static void loadH5TestLib() { + String s_libraryName = null; + String mappedName = null; + + // Make sure that the library is loaded only once + if (isLibraryLoaded) + return; + + try { + s_libraryName = "hdf5_java_test"; + mappedName = System.mapLibraryName(s_libraryName); + System.loadLibrary("hdf5_java_test"); + isLibraryLoaded = true; + } + catch (Throwable err) { + err.printStackTrace(); + isLibraryLoaded = false; + } + finally { + log.info("HDF5 Java test library: " + s_libraryName); + log.debug(" resolved to: " + mappedName + "; "); + log.info((isLibraryLoaded ? "" : " NOT") + " successfully loaded from java.library.path"); + } + + /* Important! Disable error output to C stdout */ + if (!log.isDebugEnabled()) + H5.H5error_off(); + } + + /** + * H5VLfapl_is_native queries if a FAPL will use the native VOL connector. + * + * @param fapl_id + * The ID of the FAPL to query. + * @return true if fapl_id uses the native VOL connector. + * + **/ + public synchronized static native boolean H5VLfapl_is_native(long fapl_id) throws HDF5LibraryException; + +} diff --git a/java/test/Makefile.am b/java/test/Makefile.am index ac3b619..b69e019 100644 --- a/java/test/Makefile.am +++ b/java/test/Makefile.am @@ -36,7 +36,8 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation TESTPACKAGE = noinst_JAVA = \ - TestH5.java \ + H5TestUtils.java \ + TestH5.java \ TestH5Eparams.java \ TestH5Eregister.java \ TestH5Fparams.java \ diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 1f298f3..a5d0063 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -34,6 +34,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java index f2134d2..77652e3 100644 --- a/java/test/TestH5A.java +++ b/java/test/TestH5A.java @@ -30,6 +30,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5A_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Arw.java b/java/test/TestH5Arw.java index 282b736..2f5497b 100644 --- a/java/test/TestH5Arw.java +++ b/java/test/TestH5Arw.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.callbacks.H5A_iterate_t; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java index dac3a9c..8b34516 100644 --- a/java/test/TestH5D.java +++ b/java/test/TestH5D.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.callbacks.H5D_iterate_t; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java index 3661139..91a2d33 100644 --- a/java/test/TestH5Dparams.java +++ b/java/test/TestH5Dparams.java @@ -15,6 +15,7 @@ package test; import static org.junit.Assert.assertTrue; import hdf.hdf5lib.H5; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Dplist.java b/java/test/TestH5Dplist.java index 774b9dd..cfd9661 100644 --- a/java/test/TestH5Dplist.java +++ b/java/test/TestH5Dplist.java @@ -23,6 +23,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Drw.java b/java/test/TestH5Drw.java index 69fb9d7..782245f 100644 --- a/java/test/TestH5Drw.java +++ b/java/test/TestH5Drw.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.callbacks.H5D_iterate_t; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java index cad0a06..d4a9c82 100644 --- a/java/test/TestH5E.java +++ b/java/test/TestH5E.java @@ -27,6 +27,8 @@ import hdf.hdf5lib.callbacks.H5E_walk_cb; import hdf.hdf5lib.callbacks.H5E_walk_t; import hdf.hdf5lib.structs.H5E_error2_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java index 9e93cea..e807e27 100644 --- a/java/test/TestH5Edefault.java +++ b/java/test/TestH5Edefault.java @@ -18,6 +18,7 @@ import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java index e55f1fc..2e40e94 100644 --- a/java/test/TestH5Eparams.java +++ b/java/test/TestH5Eparams.java @@ -27,6 +27,8 @@ import hdf.hdf5lib.callbacks.H5E_walk_cb; import hdf.hdf5lib.callbacks.H5E_walk_t; import hdf.hdf5lib.structs.H5E_error2_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java index 99e8e5f..cec51c2 100644 --- a/java/test/TestH5Eregister.java +++ b/java/test/TestH5Eregister.java @@ -15,6 +15,7 @@ package test; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import hdf.hdf5lib.H5; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java index 16786b9..d016b27 100644 --- a/java/test/TestH5F.java +++ b/java/test/TestH5F.java @@ -23,6 +23,8 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Fbasic.java b/java/test/TestH5Fbasic.java index 4f3d928..9310feb 100644 --- a/java/test/TestH5Fbasic.java +++ b/java/test/TestH5Fbasic.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java index 0376485..accca98 100644 --- a/java/test/TestH5Fparams.java +++ b/java/test/TestH5Fparams.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException; import hdf.hdf5lib.structs.H5F_info2_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java index 1ec78fe..88d683b 100644 --- a/java/test/TestH5Fswmr.java +++ b/java/test/TestH5Fswmr.java @@ -22,6 +22,8 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5G.java b/java/test/TestH5G.java index edf2cbe..cf51100 100644 --- a/java/test/TestH5G.java +++ b/java/test/TestH5G.java @@ -25,6 +25,8 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5G_info_t; import hdf.hdf5lib.structs.H5O_token_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java index 6e2e450..017452b 100644 --- a/java/test/TestH5Gbasic.java +++ b/java/test/TestH5Gbasic.java @@ -23,6 +23,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5G_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Giterate.java b/java/test/TestH5Giterate.java index 388d2ac..7eb44b7 100644 --- a/java/test/TestH5Giterate.java +++ b/java/test/TestH5Giterate.java @@ -20,6 +20,7 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5G_info_t; import hdf.hdf5lib.structs.H5O_token_t; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Lbasic.java b/java/test/TestH5Lbasic.java index a28fc3d..40397bf 100644 --- a/java/test/TestH5Lbasic.java +++ b/java/test/TestH5Lbasic.java @@ -25,6 +25,8 @@ import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5L_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java index 44af2e5..11c6d2c 100644 --- a/java/test/TestH5Lcreate.java +++ b/java/test/TestH5Lcreate.java @@ -27,6 +27,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5L_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Lparams.java b/java/test/TestH5Lparams.java index 30ee242..4a1ce7e 100644 --- a/java/test/TestH5Lparams.java +++ b/java/test/TestH5Lparams.java @@ -16,6 +16,8 @@ import static org.junit.Assert.assertTrue; import hdf.hdf5lib.H5; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Obasic.java b/java/test/TestH5Obasic.java index 350b7aa..4ab60bd 100644 --- a/java/test/TestH5Obasic.java +++ b/java/test/TestH5Obasic.java @@ -29,6 +29,8 @@ import hdf.hdf5lib.structs.H5O_token_t; import hdf.hdf5lib.structs.H5O_hdr_info_t; import hdf.hdf5lib.structs.H5_ih_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java index b3b1acd..df646ca 100644 --- a/java/test/TestH5Ocopy.java +++ b/java/test/TestH5Ocopy.java @@ -23,6 +23,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java index 78ea744..bab8add 100644 --- a/java/test/TestH5Ocreate.java +++ b/java/test/TestH5Ocreate.java @@ -27,6 +27,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5O_info_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java index 5cbabe1..3a6f602 100644 --- a/java/test/TestH5Oparams.java +++ b/java/test/TestH5Oparams.java @@ -16,6 +16,7 @@ import static org.junit.Assert.assertTrue; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java index 3879128..9db1e5a 100644 --- a/java/test/TestH5P.java +++ b/java/test/TestH5P.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5F_info2_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5PData.java b/java/test/TestH5PData.java index 8b04629..9bf458c 100644 --- a/java/test/TestH5PData.java +++ b/java/test/TestH5PData.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index d44cc0b..738ff39 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -17,6 +17,7 @@ import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java index cc674e2..06eb191 100644 --- a/java/test/TestH5Pfapl.java +++ b/java/test/TestH5Pfapl.java @@ -28,6 +28,8 @@ import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.exceptions.HDF5PropertyListInterfaceException; import hdf.hdf5lib.structs.H5AC_cache_config_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java index d922666..2631f99 100644 --- a/java/test/TestH5Pfaplhdfs.java +++ b/java/test/TestH5Pfaplhdfs.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java index dda2716..48b1cfa 100644 --- a/java/test/TestH5Pfapls3.java +++ b/java/test/TestH5Pfapls3.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5FD_ros3_fapl_t; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java index 0d53071..429915b 100644 --- a/java/test/TestH5Plist.java +++ b/java/test/TestH5Plist.java @@ -44,6 +44,7 @@ import hdf.hdf5lib.callbacks.H5P_iterate_t; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.structs.H5AC_cache_config_t; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java index 0478356..f82cfab 100644 --- a/java/test/TestH5Pvirtual.java +++ b/java/test/TestH5Pvirtual.java @@ -24,6 +24,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5R.java b/java/test/TestH5R.java index 031b8e4..381ed08 100644 --- a/java/test/TestH5R.java +++ b/java/test/TestH5R.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5Rref.java b/java/test/TestH5Rref.java index 5733aae..b682d95 100644 --- a/java/test/TestH5Rref.java +++ b/java/test/TestH5Rref.java @@ -26,6 +26,8 @@ import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Ignore; diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java index 7eeed7a..22a36f5 100644 --- a/java/test/TestH5S.java +++ b/java/test/TestH5S.java @@ -20,6 +20,7 @@ import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java index 548ac95..e4d052e 100644 --- a/java/test/TestH5Sbasic.java +++ b/java/test/TestH5Sbasic.java @@ -17,6 +17,7 @@ import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java index ed4e2a9..de30b63 100644 --- a/java/test/TestH5T.java +++ b/java/test/TestH5T.java @@ -23,6 +23,8 @@ import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5Exception; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; + import org.junit.After; import org.junit.Before; import org.junit.Rule; diff --git a/java/test/TestH5Tbasic.java b/java/test/TestH5Tbasic.java index 7aac2ab..082a66e 100644 --- a/java/test/TestH5Tbasic.java +++ b/java/test/TestH5Tbasic.java @@ -17,6 +17,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java index 92a034c..a19698d 100644 --- a/java/test/TestH5Tparams.java +++ b/java/test/TestH5Tparams.java @@ -15,6 +15,7 @@ package test; import static org.junit.Assert.assertTrue; import hdf.hdf5lib.H5; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java index 4253d20..c1766ff 100644 --- a/java/test/TestH5VL.java +++ b/java/test/TestH5VL.java @@ -19,6 +19,7 @@ import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import java.io.File; @@ -168,5 +169,10 @@ public class TestH5VL { public void testH5VLunregister_connector_NegativeID() throws Throwable { H5.H5VLunregister_connector(-1); } + + @Test(expected = HDF5LibraryException.class) + public void testH5VLfapl_is_native() throws Throwable { + H5TestUtils.H5VLfapl_is_native(-1); + } } diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java index fde8f1a..53e57de 100644 --- a/java/test/TestH5Z.java +++ b/java/test/TestH5Z.java @@ -17,6 +17,7 @@ import static org.junit.Assert.fail; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; import hdf.hdf5lib.exceptions.HDF5LibraryException; +import test.H5TestUtils; import org.junit.After; import org.junit.Before; diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 39db296..0bbc3e4 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -62,6 +62,7 @@ test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR LIST_LIBRARY_FILES=" $top_builddir/src/.libs/libhdf5.* $top_builddir/java/src/jni/.libs/libhdf5_java.* +$top_builddir/java/src/jni/.libs/libhdf5_java_test.* " LIST_JAR_TESTFILES=" $HDFLIB_HOME/hamcrest-core.jar diff --git a/java/test/testfiles/JUnit-TestH5VL.txt b/java/test/testfiles/JUnit-TestH5VL.txt index ff94969..96247af 100644 --- a/java/test/testfiles/JUnit-TestH5VL.txt +++ b/java/test/testfiles/JUnit-TestH5VL.txt @@ -1,5 +1,6 @@ JUnit version 4.11 .testH5VLget_connector_id_by_name +.testH5VLfapl_is_native .testH5VLget_connector_id_by_value .testH5VLget_connector_id .testH5VLnative_init @@ -9,5 +10,5 @@ JUnit version 4.11 Time: XXXX -OK (7 tests) +OK (8 tests) |