summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes2
-rw-r--r--MANIFEST2
-rw-r--r--java/test/CMakeLists.txt105
-rw-r--r--java/test/JUnit-unit.txt614
-rw-r--r--java/test/Makefile.am9
-rw-r--r--java/test/TestH5E.java268
-rw-r--r--java/test/TestH5Eparams.java343
-rw-r--r--java/test/TestUnit.java36
-rw-r--r--java/test/junit.sh.in8
9 files changed, 1080 insertions, 307 deletions
diff --git a/.gitattributes b/.gitattributes
index 3c7dae1..de68733 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -321,6 +321,7 @@ java/test/TestH5Dparams.java -text
java/test/TestH5Dplist.java -text
java/test/TestH5E.java -text
java/test/TestH5Edefault.java -text
+java/test/TestH5Eparams.java -text
java/test/TestH5Eregister.java -text
java/test/TestH5F.java -text
java/test/TestH5Fbasic.java -text
@@ -347,6 +348,7 @@ java/test/TestH5Sbasic.java -text
java/test/TestH5T.java -text
java/test/TestH5Tbasic.java -text
java/test/TestH5Tparams.java -text
+java/test/TestUnit.java -text
java/test/TestH5Z.java -text
java/test/h5ex_g_iterate.orig -text svneol=unset#application/x-hdf
java/test/junit.sh.in -text
diff --git a/MANIFEST b/MANIFEST
index 4b32587..1cccdf2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3057,6 +3057,7 @@
./java/test/TestH5Dplist.java
./java/test/TestH5E.java
./java/test/TestH5Edefault.java
+./java/test/TestH5Eparams.java
./java/test/TestH5Eregister.java
./java/test/TestH5Fparams.java
./java/test/TestH5Fbasic.java
@@ -3086,6 +3087,7 @@
./java/test/TestH5T.java
./java/test/TestH5Z.java
./java/test/TestAll.java
+./java/test/TestUnit.java
./java/lib/hamcrest-core.jar
./java/lib/junit.jar
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index 6158055..10a38b0 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -10,16 +10,13 @@ INCLUDE_DIRECTORIES (
set (HDF5_JAVA_TEST_SOURCES
TestH5.java
- TestH5E.java
- TestH5Edefault.java
- TestH5Eregister.java
+ TestH5Eparams.java
TestH5Fparams.java
TestH5Fbasic.java
TestH5F.java
TestH5Fswmr.java
TestH5Gbasic.java
TestH5G.java
- TestH5Giterate.java
TestH5Sbasic.java
TestH5S.java
TestH5Tparams.java
@@ -44,13 +41,33 @@ set (HDF5_JAVA_TEST_SOURCES
TestH5Ocopy.java
TestH5PL.java
TestH5Z.java
- TestAll.java
)
-file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
-"Main-Class: test.TestAll
+if (HDF5_ENABLE_DEBUG_APIS)
+ set (HDF5_JAVA_TEST_SOURCES
+ ${HDF5_JAVA_TEST_SOURCES}
+ TestUnit.java
+ )
+
+ file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ "Main-Class: test.TestUnit
"
-)
+ )
+else ()
+ set (HDF5_JAVA_TEST_SOURCES
+ ${HDF5_JAVA_TEST_SOURCES}
+ TestH5E.java
+ TestH5Edefault.java
+ TestH5Eregister.java
+ TestH5Giterate.java
+ TestAll.java
+ )
+
+ file (WRITE ${PROJECT_BINARY_DIR}/Manifest.txt
+ "Main-Class: test.TestAll
+"
+ )
+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}")
@@ -63,10 +80,19 @@ get_target_property (${HDF5_JAVA_TEST_LIB_TARGET}_JAR_FILE ${HDF5_JAVA_TEST_LIB_
add_dependencies (${HDF5_JAVA_TEST_LIB_TARGET} ${HDF5_JAVA_HDF5_LIB_TARGET})
set_target_properties (${HDF5_JAVA_TEST_LIB_TARGET} PROPERTIES FOLDER test/java)
-set (HDF_JAVA_TEST_FILES
+if (HDF5_ENABLE_DEBUG_APIS)
+ set (HDF_JAVA_TEST_FILES
+ JUnit-unit.txt
+ JUnit-interface.ert
+ )
+ set (testfilter "OK (608 tests)")
+else ()
+ set (HDF_JAVA_TEST_FILES
JUnit-interface.txt
JUnit-interface.ert
-)
+ )
+ set (testfilter "OK (645 tests)")
+endif ()
foreach (h5_file ${HDF_JAVA_TEST_FILES})
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
@@ -86,7 +112,6 @@ 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 (testfilter "OK (598 tests)")
set (CMD_ARGS "-Dhdf.hdf5lib.H5.loadLibraryName=$<TARGET_PROPERTY:${HDF5_JAVA_JNI_LIB_TARGET},OUTPUT_NAME$<$<CONFIG:Debug>:_DEBUG>>;")
add_test (
@@ -97,24 +122,46 @@ add_test (
JUnit-interface.out.err
)
-add_test (
- NAME JUnit-interface
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
- -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}"
- -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore"
- -D "TEST_PROGRAM=test.TestAll"
- -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
- -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
- -D "TEST_OUTPUT=JUnit-interface.out"
-# -D "TEST_LOG_LEVEL=trace"
- -D "TEST_EXPECT=0"
- -D "SKIP_APPEND=1"
- -D "TEST_MASK_ERROR=TRUE"
- -D "TEST_FILTER:STRING=${testfilter}"
- -D "TEST_REFERENCE=JUnit-interface.txt"
- -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
-)
+if (HDF5_ENABLE_DEBUG_APIS)
+ add_test (
+ NAME JUnit-interface
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore"
+ -D "TEST_PROGRAM=test.TestUnit"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
+ -D "TEST_OUTPUT=JUnit-interface.out"
+# -D "TEST_LOG_LEVEL=trace"
+ -D "TEST_EXPECT=0"
+ -D "SKIP_APPEND=1"
+ -D "TEST_MASK_ERROR=TRUE"
+ -D "TEST_FILTER:STRING=${testfilter}"
+ -D "TEST_REFERENCE=JUnit-unit.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+else ()
+ add_test (
+ NAME JUnit-interface
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}"
+ -D "TEST_CLASSPATH:STRING=${CMAKE_JAVA_CLASSPATH}"
+ -D "TEST_ARGS:STRING=${CMD_ARGS}-ea;org.junit.runner.JUnitCore"
+ -D "TEST_PROGRAM=test.TestAll"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ -D "TEST_FOLDER=${HDF5_BINARY_DIR}/java/test"
+ -D "TEST_OUTPUT=JUnit-interface.out"
+# -D "TEST_LOG_LEVEL=trace"
+ -D "TEST_EXPECT=0"
+ -D "SKIP_APPEND=1"
+ -D "TEST_MASK_ERROR=TRUE"
+ -D "TEST_FILTER:STRING=${testfilter}"
+ -D "TEST_REFERENCE=JUnit-interface.txt"
+ -P "${HDF_RESOURCES_DIR}/jrunTest.cmake"
+ )
+endif ()
+
set_tests_properties (JUnit-interface PROPERTIES
ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2"
DEPENDS "JUnit-interface-clearall-objects"
diff --git a/java/test/JUnit-unit.txt b/java/test/JUnit-unit.txt
new file mode 100644
index 0000000..fa33165
--- /dev/null
+++ b/java/test/JUnit-unit.txt
@@ -0,0 +1,614 @@
+JUnit version 4.11
+.testJ2C
+.testIsSerializable
+.testH5garbage_collect
+.testH5error_off
+.serializeToDisk
+.testH5open
+.testH5check_version
+.testH5get_libversion
+.testH5set_free_list_limits
+.testH5EprintInt
+.testH5Eget_msg_major
+.testH5Eget_msg_minor
+.testH5Eget_msg
+.testH5Eget_num
+.testH5Eget_class_name
+.testH5Eget_num_with_msg
+.testH5Eclear2
+.testH5Eprint2
+.testH5Ecreate_msg_major
+.testH5Ecreate_msg_minor
+.testH5Ecreate_stack
+.testH5Ecreate_msg_name_null
+.testH5Eauto_is_v2
+.testH5EclearInt
+.testH5Fcreate_null
+.testH5Fflush_local
+.testH5Fget_info
+.testH5Fmount_null
+.testH5Fcreate
+.testH5Fflush_global
+.testH5Funmount_null
+.testH5Fclose_negative
+.testH5Fopen_null
+.testH5Fis_hdf5_null
+.testH5Fis_hdf5_text
+.testH5Fget_mdc_size
+.testH5Fget_mdc_hit_rate
+.testH5Fis_hdf5
+.testH5Fget_freespace
+.testH5Fclose
+.testH5Fget_filesize
+.testH5Fcreate_EXCL
+.testH5Freopen_closed
+.testH5Freset_mdc_hit_rate_stats
+.testH5Fget_name
+.testH5Fcreate
+.testH5Fclear_elink_file_cache
+.testH5Fclose_twice
+.testH5Freopen
+.testH5Fopen_read_only
+.testH5Fget_access_plist
+.testH5Fget_obj_ids
+.testH5Fget_intent_rdwr
+.testH5Fget_access_plist_closed
+.testH5Fget_create_plist_closed
+.testH5Fget_intent_rdonly
+.testH5Fget_create_plist
+.testH5Fget_obj_count
+.testH5Fstart_swmr_write
+.testH5Fswmr_read_attempts
+.testH5Gget_info_by_name_not_exists
+.testH5Gget_info_by_idx_not_exists
+.testH5Gget_info_by_name
+.testH5Gget_create_plist
+.testH5Gopen
+.testH5Gget_info_by_idx_null
+.testH5Gopen_not_exists
+.testH5Gclose
+.testH5Gcreate_anon
+.testH5Gcreate_null
+.testH5Gget_info_by_idx_fileid
+.testH5Gclose_invalid
+.testH5Gflush_invalid
+.testH5Gopen_invalid
+.testH5Grefresh_invalid
+.testH5Gget_info_invalid
+.testH5Gcreate_invalid
+.testH5Gcreate_exists
+.testH5Gget_info_by_name_null
+.testH5Gget_info_by_name_invalid
+.testH5Gget_create_plist_invalid
+.testH5Gcreate
+.testH5Gget_info_by_name_fileid
+.testH5Gget_info_by_idx_invalid
+.testH5Gopen_null
+.testH5Gget_info_by_idx
+.testH5Gget_info
+.testH5Gget_info_by_name
+.testH5Gget_create_plist
+.testH5Gopen
+.testH5Gget_obj_info_all_gid2
+.testH5Gget_obj_info_all_byIndexType
+.testH5Gget_obj_info_max_limit
+.testH5Gget_obj_info_all
+.testH5Gget_obj_info_max
+.testH5Gget_obj_info_all_gid
+.testH5Gget_info_by_idx
+.testH5Gget_info
+.testH5Sclose_invalid
+.testH5Screate_simple_max_default
+.testH5Screate_simple_dims_null
+.testH5Sdecode_null
+.testH5Screate_simple_dims_exceed
+.testH5Screate_simple_unlimted_1d
+.testH5Screate_simple_dims_invalid
+.testH5Screate_scalar
+.testH5Screate_simple
+.testH5Screate_simple_rank_invalid
+.testH5Sget_simple_extent_type_invalid
+.testH5Sencode_invalid
+.testH5Screate_null
+.testH5Screate_simple_extent
+.testH5Screate_invalid
+.testH5Screate_simple_unlimted
+.testH5Sget_select_npoints
+.testH5Sget_select_type
+.testH5Sset_extent_simple
+.testH5Sget_select_hyper
+.testH5Sget_select_valid
+.testH5Sget_select_elem_pointlist
+.testH5Sset_extent_none
+.testH5Sencode_decode_scalar_dataspace
+.testH5Soffset_simple
+.testH5Scopy
+.testH5Sget_simple_extent_ndims
+.testH5Sextent_equal
+.testH5Sget_simple_extent_dims
+.testH5Sget_simple_extent_type
+.testH5Shyper_regular
+.testH5Sget_select_bounds
+.testH5Sget_select_elem_pointlist_invalid
+.testH5Sget_simple_extent_npoints
+.testH5Sextent_copy
+.testH5Sencode_decode_null_dataspace
+.testH5Sis_simple
+.testH5Sget_simple_extent_dims_null
+.testH5Sselect_none
+.testH5Tget_member_type_invalid
+.testH5Tenum_insert_null
+.testH5Tget_offset_invalid
+.testH5Tset_precision_invalid
+.testH5Tget_inpad_invalid
+.testH5Tenum_nameof_invalid
+.testH5Tget_member_value_invalid
+.testH5Tenum_nameof_value_null
+.testH5Tcreate_invalid
+.testH5Tget_strpad_invalid
+.testH5Tenum_valueof_invalid
+.testH5Tget_fields_null
+.testH5Topen_null
+.testH5Tpack_invalid
+.testH5Tcommit_null
+.testH5Tinsert_invalid
+.testH5Tenum_valueof_null
+.testH5Tset_norm_invalid
+.testH5Tlock_invalid
+.testH5Tarray_create_invalid
+.testH5Tget_member_value_null
+.testH5Tset_offset_invalid
+.testH5Tget_fields_invalid
+.testH5Tequal_invalid
+.testH5Tget_ebias_long_invalid
+.testH5Tget_cset_invalid
+.testH5Tget_size_invalid
+.testH5Tset_strpad_invalid
+.testH5Tset_ebias_invalid
+.testH5Tget_sign_invalid
+.testH5Tget_member_index_invalid
+.testH5Tget_precision_invalid
+.testH5Tset_fields_invalid
+.testH5Tcopy_invalid
+.testH5Tget_pad_invalid
+.testH5Tset_order_invalid
+.testH5Tget_member_class_invalid
+.testH5Tget_super_invalid
+.testH5Tget_class_invalid
+.testH5Topen_invalid
+.testH5Tget_precision_long_invalid
+.testH5Tget_ebias_invalid
+.testH5Tget_native_type_invalid
+.testH5Tget_fields_length_invalid
+.testH5Tget_norm_invalid
+.testH5Tenum_nameof_invalid_size
+.testH5Tset_pad_invalid
+.testH5Tget_pad_null
+.testH5Tset_tag_null
+.testH5Tget_order_invalid
+.testH5Tcommit_invalid
+.testH5Tget_array_ndims_invalid
+.testH5Tset_tag_invalid
+.testH5Tvlen_create_invalid
+.testH5Tenum_create_invalid
+.testH5Tinsert_null
+.testH5Tset_inpad_invalid
+.testH5Tenum_valueof_name_null
+.testH5Tset_cset_invalid
+.testH5Tclose_invalid
+.testH5Tget_nmembers_invalid
+.testH5Tarray_create_value_null
+.testH5Tset_size_invalid
+.testH5Tflush_invalid
+.testH5Tenum_insert_invalid
+.testH5Tget_array_dims_null
+.testH5Tget_member_index_null
+.testH5Trefresh_invalid
+.testH5Tset_sign_invalid
+.testH5Tenum_insert_name_null
+.testH5Tequal_not
+.testH5Tcopy
+.testH5Tequal
+.testH5Torder_size
+.testH5Tconvert
+.testH5Tvlen_create
+.testH5Tenum_create_functions
+.testH5Tenum_functions
+.testH5Tget_class
+.testH5Tget_array_ndims
+.testH5Tequal_type_error
+.testH5Tget_array_dims
+.testH5Tset_size
+.testH5Tis_variable_str
+.testH5Tcompound_functions
+.testH5Tget_size
+.testH5Tarray_create
+.testH5Topaque_functions
+.testH5Dget_space_status_invalid
+.testH5Dget_access_plist_invalid
+.testH5Dget_type_invalid
+.testH5Dget_create_plist_invalid
+.testH5Dget_offset_invalid
+.testH5Dvlen_get_buf_size_invalid
+.testH5Dcreate_null
+.testH5Dset_extent_status_null
+.testH5Dvlen_reclaim_null
+.testH5Dcreate_invalid
+.testH5Dcreate_anon_invalid
+.testH5Dset_extent_status_invalid
+.testH5Dvlen_reclaim_invalid
+.testH5Dopen_invalid
+.testH5Dclose_invalid
+.testH5Dflush_invalid
+.testH5Drefresh_invalid
+.testH5Dget_storage_size_invalid
+.testH5Dget_space_invalid
+.testH5Dopen_null
+.testH5Dget_storage_size
+.testH5Diterate_write
+.testH5Dcreate
+.testH5Dget_offset
+.testH5Dget_type
+.testH5Dfill
+.testH5Dopen
+.testH5Dcreate_anon
+.testH5Dfill_null
+.testH5Dget_storage_size_empty
+.testH5Diterate
+.testH5Dget_access_plist
+.testH5Dvlen_read_invalid_buffer
+.testH5Dvlen_get_buf_size
+.testH5Dget_space_closed
+.testH5Dget_space_status
+.testH5Dvlen_write_read
+.testH5Dget_space
+.testH5Dget_type_closed
+.testH5Dset_extent
+.testH5Lcopy_invalid
+.testH5Lget_value_by_idx_null
+.testH5Lcreate_external_invalid
+.testH5Lexists_null
+.testH5Lget_info_invalid
+.testH5Lget_name_by_idx_invalid
+.testH5Lmove_null_current
+.testH5Literate_by_name_nullname
+.testH5Lvisit_by_name_nullname
+.testH5Lvisit_null
+.testH5Lget_name_by_idx_null
+.testH5Lcreate_hard_null_dest
+.testH5Lget_value_null
+.testH5Lcreate_external_null_dest
+.testH5Lcreate_external_null_file
+.testH5Lcreate_external_null_current
+.testH5Ldelete_null
+.testH5Lexists_invalid
+.testH5Lmove_invalid
+.testH5Lcreate_hard_invalid
+.testH5Lcopy_null_dest
+.testH5Lcreate_soft_null_current
+.testH5Lcopy_null_current
+.testH5Lget_info_by_idx_null
+.testH5Literate_null
+.testH5Ldelete_invalid
+.testH5Lvisit_by_name_null
+.testH5Ldelete_by_idx_invalid
+.testH5Lget_info_by_idx_invalid
+.testH5Ldelete_by_idx_null
+.testH5Lcreate_soft_invalid
+.testH5Lcreate_hard_null_current
+.testH5Lget_value_by_idx_invalid
+.testH5Lmove_null_dest
+.testH5Lget_info_null
+.testH5Literate_by_name_null
+.testH5Lcreate_soft_null_dest
+.testH5Lget_value_invalid
+.testH5Lget_info_by_idx_not_exist_name
+.testH5Lget_name_by_idx_not_exist
+.testH5Lvisit
+.testH5Lget_name_by_idx_n0
+.testH5Lget_name_by_idx_n3
+.testH5Lvisit_by_name
+.testH5Literate_by_name
+.testH5Lget_info_hardlink
+.testH5Literate
+.testH5Lget_info_by_idx_n0
+.testH5Lget_info_by_idx_n3
+.testH5Lget_info_by_idx_name_not_exist_create
+.testH5Lexists
+.testH5Lget_info_by_idx_name_not_exist_name
+.testH5Lget_info_by_idx_not_exist_create
+.testH5Lget_info_not_exist
+.testH5Lget_info_dataset
+.testH5Lget_info_by_idx_n0_create
+.testH5Ldelete_soft_link_dangle
+.testH5Lget_value_by_idx_external_create
+.testH5Ldelete_by_idx_not_exist_create
+.testH5Lvisit_create
+.testH5Lmove_dst_link_exists
+.testH5Lcreate_soft_dangle
+.testH5Literate_create
+.testH5Lcopy_cur_not_exists
+.testH5Lcopy
+.testH5Lmove
+.testH5Lget_value_by_idx_n2_create
+.testH5Lget_value_soft
+.testH5Ldelete_by_idx_n2_name
+.testH5Lget_info_by_idx_n1_create
+.testH5Lcreate_external
+.testH5Lget_value_dangle
+.testH5Lcreate_hard_dst_link_exists
+.testH5Lget_value_by_idx_n2_name
+.testH5Lcreate_soft_dst_link_exists
+.testH5Lcreate_hard
+.testH5Lcreate_soft
+.testH5Lmove_cur_not_exists
+.testH5Lcreate_hard_cur_not_exists
+.testH5Lget_info_softlink_dangle
+.testH5Ldelete_by_idx_n2_create
+.testH5Ldelete_soft_link
+.testH5Lget_info_externallink
+.testH5Lcopy_dst_link_exists
+.testH5Lget_value_by_idx_external_name
+.testH5Ldelete_by_idx_not_exist_name
+.testH5Lget_info_softlink
+.testH5Lget_value_external
+.testH5Lget_value_by_idx_not_exist_create
+.testH5Lget_value_by_idx_not_exist_name
+.testH5Ldelete_hard_link
+.testH5Rgetregion_Nullreference
+.testH5Rget_obj_type2_Invalidreftype
+.testH5Rdereference
+.testH5Rget_name
+.testH5Rcreate_Invalidreftype
+.testH5Rget_name_NULLreference
+.testH5Rget_region
+.testH5Rdereference_Nullreference
+.testH5Rcreate_refobj
+.testH5Rcreate_Invalidspace_id
+.testH5Rdereference_Invalidreference
+.testH5Rgetregion_Badreferencetype
+.testH5Rcreate_regionrefobj
+.testH5Rget_name_Invalidreftype
+.testH5Rgetregion_Invalidreftype
+.testH5Rget_obj_type2
+.testH5Rcreate_InvalidObjectName
+.testH5Pset_nbit
+.testH5Pset_shared_mesg_index_InvalidFlag
+.testH5Pset_shared_mesg_phase_change
+.testH5PH5Pset_shared_mesg_phase_change_HighMaxlistValue
+.testH5P_layout
+.testH5Pget_link_creation_order
+.testH5Pget_efile_prefix
+.testH5Pset_shared_mesg_nindexes_InvalidHIGHnindexes
+.testH5P_file_space_page_size
+.testH5Pget_shared_mesg_index_Invalid_indexnum
+.testH5Pset_data_transform_NullExpression
+.testH5Pset_elink_prefix_null
+.testH5Pget_elink_prefix
+.testH5Pget_nlinks
+.testH5Pset_libver_bounds_invalidhigh
+.testH5Pget_char_encoding
+.testH5P_istore_k
+.testH5Pget_link_phase_change
+.testH5Pset_link_phase_change_max_compactLESSTHANmin_dense
+.testH5Pget_shared_mesg_phase_change_EqualsSET
+.testH5Pset_scaleoffset_Invalidscale_type
+.testH5Pget_istore_k_null
+.testH5Pset_libver_bounds_invalidlow
+.testH5Pset_est_link_info
+.testH5Pget_link_phase_change_Null
+.testH5P_fill_time
+.testH5Pget_userblock_null
+.testH5Pset_link_creation_order_tracked
+.testH5Pset_shared_mesg_index
+.testH5Pset_copy_object
+.testH5Pset_link_creation_order_trackedPLUSindexed
+.testH5P_file_space_strategy
+.testH5Pset_copy_object_invalidobject
+.testH5Pset_est_link_info_InvalidValues
+.testH5Pset_local_heap_size_hint
+.testH5Pget_est_link_info
+.testH5Pset_efile_prefix_null
+.testH5Pset_scaleoffset
+.testH5Pset_create_intermediate_group_invalidobject
+.testH5PH5Pset_shared_mesg_phase_change_HighMinbtreeValue
+.testH5Pset_create_intermediate_group
+.testH5P_alloc_time
+.testH5Pset_elink_acc_flags
+.testH5Pset_link_phase_change_Highmax_Compact
+.testH5P_chunk
+.testH5P_sizes
+.testH5Pset_link_creation_order_invalidvalue
+.testH5P_sym_k
+.testH5PH5Pset_shared_mesg_phase_change_MinbtreeGreaterThanMaxlist
+.testH5Pget_version_null
+.testH5Pset_scaleoffset_Invalidscale_factor
+.testH5Pget_elink_prefix_null
+.testH5Pget_data_transform_IllegalSize
+.testH5Pget_create_intermediate_group
+.testH5Pset_shared_mesg_nindexes
+.testH5Pset_attr_creation_order_trackedPLUSindexed
+.testH5Pget_sym_k_null
+.testH5Pset_nlinks
+.testH5P_obj_track_times
+.testH5Pset_efile_prefix
+.testH5P_userblock
+.testH5Pget_local_heap_size_hint
+.testH5Pset_shared_mesg_index_Invalid_indexnum
+.testH5Pset_data_transform_InvalidExpression1
+.testH5Pset_data_transform_InvalidExpression2
+.testH5Pget_attr_phase_change
+.testH5Pget_data_transform
+.testH5Pget_create_intermediate_group_notcreated
+.testH5Pset_elink_prefix
+.testH5Pget_attr_creation_order
+.testH5Pset_attr_creation_order_invalidvalue
+.testH5Pget_shared_mesg_phase_change
+.testH5Pget_shared_mesg_index
+.testH5Pset_link_phase_change
+.testH5Pget_shared_mesg_nindexes
+.testH5Pget_version
+.testH5Pset_elink_acc_flags_InvalidFlag1
+.testH5Pset_elink_acc_flags_InvalidFlag2
+.testH5Pget_link_phase_change_EqualsSet
+.testH5Pget_elink_acc_flags
+.testH5Pget_data_transform_ExpressionNotSet
+.testH5P_fill_value
+.testH5Pget_sizes_null
+.testH5Pset_data_transform
+.testH5Pset_attr_creation_order_tracked
+.testH5P_buffer
+.testH5Pdata_transform
+.testH5P_elink_fapl
+.testH5P_fapl_direct
+.testH5P_alignment
+.testH5P_fapl_family
+.testH5P_chunk_cache
+.testH5P_meta_block_size
+.testH5Fmdc_logging
+.testH5Pget_elink_fapl
+.testH5Pset_mdc_config
+.testH5P_small_data_block_size
+.testH5Pset_fapl_log
+.testH5P_evict_on_close
+.testH5Pset_libver_bounds
+.testH5P_sieve_buf_size
+.testH5P_elink_file_cache_size
+.testH5P_cache
+.testH5Pget_mdc_config
+.testH5P_fapl_muti_defaults
+.testH5Pget_libver_bounds
+.testH5P_btree_ratios
+.testH5P_fapl_muti_nulls
+.testH5Pset_fapl_sec2
+.testH5Pmulti_transform
+.testH5Pset_elink_fapl_NegativeID
+.testH5Pset_fapl_stdio
+.testH5P_edc_check
+.testH5Pset_elink_fapl
+.testH5P_hyper_vector_size
+.testH5P_gc_references
+.testH5P_family_offset
+.testH5P_fapl_core
+.testH5P_fapl_muti
+.testH5P_fapl_split
+.testH5Pset_fapl_windows
+.testH5P_fclose_degree
+.testH5Pget_source_datasetname
+.testH5Pvirtual_storage
+.testH5Pget_selection_source_dataset
+.testH5Pget_virtual_prefix
+.testH5Pget_source_filename
+.testH5Pset_get_virtual_printf_gap
+.testH5Pget_virtual_count
+.testH5Pset_virtual_prefix
+.testH5Pset_get_virtual_view
+.testH5Pget_mapping_parameters
+.testH5Pset_virtual_prefix_null
+.testH5P_genprop_basic_class
+.testH5P_genprop_class_iter
+.testH5P_genprop_basic_class_prop
+.testH5P_genprop_basic_list_prop
+.testH5Acreate2_nullname
+.testH5Acreate_by_name
+.testH5Aget_name_by_idx
+.testH5Aget_storage_size
+.testH5Aiterate
+.testH5Aopen_by_idx
+.testH5Aopen_invalidname
+.testH5Aopen
+.testH5Aget_info_by_name
+.testH5Aget_create_plist
+.testH5Adelete_by_name
+.testH5Aopen_by_name
+.testH5Aget_info
+.testH5Aget_name
+.testH5Aexists
+.testH5Aget_info_by_idx
+.testH5Arename
+.testH5Adelete_by_idx_name1
+.testH5Adelete_by_idx_name2
+.testH5Adelete_by_idx_order
+.testH5Arename_by_name
+.testH5Acreate2_invalidobject
+.testH5Acreate2
+.testH5Aiterate_by_name
+.testH5Adelete_by_idx_null
+.testH5Adelete_by_idx_invalidobject
+.testH5Awrite_readVL
+.testH5Aget_info1
+.testH5Oget_comment_by_name_null
+.testH5Ovisit_by_name_nullname
+.testH5Oget_info_invalid
+.testH5Ovisit_by_name_null
+.testH5Oget_comment_invalid
+.testH5Oset_comment_by_name_invalid
+.testH5Oopen_null
+.testH5Oclose_invalid
+.testH5Oflush_invalid
+.testH5Oget_comment_by_name_invalid
+.testH5Orefresh_invalid
+.testH5Ocopy_null_dest
+.testH5Olink_invalid
+.testH5Oget_info_by_idx_invalid
+.testH5Oget_info_by_idx_null
+.testH5Olink_null_dest
+.testH5Oget_info_by_name_invalid
+.testH5Oget_info_by_name_null
+.testH5Ocopy_invalid
+.testH5Oset_comment_by_name_null
+.testH5Ocopy_null_current
+.testH5Oset_comment_invalid
+.testH5Oopen_invalid
+.testH5Ovisit_null
+.testH5Oexists_by_name
+.testH5Oget_info_by_idx_n0
+.testH5Oget_info_by_idx_n3
+.testH5Oget_info_by_name_not_exist_name
+.testH5Ovisit_by_name
+.testH5Oget_info_by_idx_name_not_exist_name
+.testH5Oget_info_datatype
+.testH5Oget_info_by_idx_not_exist_name
+.testH5Oopen_by_idx_n0
+.testH5Oopen_by_idx_n3
+.testH5Oopen_not_exists
+.testH5Ovisit
+.testH5Oget_info_by_idx_not_exist_create
+.testH5Oget_info_by_name_hardlink
+.testH5Oget_info_by_name_group
+.testH5Oopen_by_addr
+.testH5Oget_info_by_name_not_exists
+.testH5Oget_info_by_name_dataset
+.testH5Oget_info_group
+.testH5Oget_info_by_name_datatype
+.testH5Oget_info_hardlink
+.testH5Oget_info_by_idx_name_not_exist_create
+.testH5Oget_info_dataset
+.testH5OcopyRefsDatasettosameFile
+.testH5OcopyRefsDatasettodiffFile
+.testH5OcopyRefsAttr
+.testH5Oget_info_by_idx_n0_create
+.testH5Oget_info_softlink_dangle
+.testH5Oget_info_softlink
+.testH5Oget_info_externallink
+.testH5Ocopy
+.testH5Olink
+.testH5Ocomment_by_name
+.testH5Oget_info_by_idx_n1_create
+.testH5Ocomment
+.testH5Oinc_dec_count
+.testH5Ocomment_by_name_clear
+.testH5Ovisit_create
+.testH5Ocopy_dst_link_exists
+.testH5Ocomment_clear
+.testH5Ocopy_cur_not_exists
+.TestH5PLplugins
+.TestH5PLpaths
+.testH5Zfilter_avail
+.testH5Zunregister_predefined
+.testH5Zget_filter_info
+
+Time: XXXX
+
+OK (608 tests)
+
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index b7409cf..9ed8517 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -35,16 +35,13 @@ AM_JAVACFLAGS = $(H5_JAVACFLAGS) -deprecation
noinst_JAVA = \
TestH5.java \
- TestH5E.java \
- TestH5Edefault.java \
- TestH5Eregister.java \
+ TestH5Eparams.java \
TestH5Fparams.java \
TestH5Fbasic.java \
TestH5F.java \
TestH5Fswmr.java \
TestH5Gbasic.java \
TestH5G.java \
- TestH5Giterate.java \
TestH5Sbasic.java \
TestH5S.java \
TestH5Tparams.java \
@@ -69,7 +66,7 @@ noinst_JAVA = \
TestH5Ocopy.java \
TestH5PL.java \
TestH5Z.java \
- TestAll.java
+ TestUnit.java
$(jarfile): classnoinst.stamp classes
$(JAR) cvf $@ -C $(JAVAROOT)/ $(pkgpath)
@@ -91,7 +88,7 @@ TESTS_JUNIT = AllJunitTests
AllJunitTests :
echo "#! /bin/sh" > $@
- echo "exec @JUNIT@ test.TestAll" >> $@
+ echo "exec @JUNIT@ test.TestUnit" >> $@
chmod +x $@
clean:
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index f3c6c91..1eb1914 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -73,179 +73,6 @@ public class TestH5E {
}
@Test
- public void testH5Eget_class_name() {
- try {
- String class_name = H5.H5Eget_class_name(hdf_java_classid);
- assertNotNull("H5.H5Eget_class_name: " + class_name, class_name);
- assertEquals("H5.H5Eget_class_name: ", "HDF-Java-Error", class_name);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_class_name: " + err);
- }
- }
-
- @Test
- public void testH5Eprint2() {
- try {
- assertFalse(current_stackid < 0);
- H5.H5Eprint2(current_stackid, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eprint2: " + err);
- }
- }
-
- @Ignore("Tested with create_msg_major[minor]")
- public void testH5Eclose_msg() {
- fail("Not yet implemented");
- }
-
- @Test(expected = NullPointerException.class)
- public void testH5Ecreate_msg_name_null() throws Throwable {
- H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, null);
- }
-
- @Test
- public void testH5Ecreate_msg_major() {
- try {
- long err_id = H5.H5Ecreate_msg(hdf_java_classid,
- HDF5Constants.H5E_MAJOR, "Error in Test");
- assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0);
- H5.H5Eclose_msg(err_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Ecreate_msg_major: " + err);
- }
- }
-
- @Test
- public void testH5Ecreate_msg_minor() {
- try {
- long err_id = H5.H5Ecreate_msg(hdf_java_classid,
- HDF5Constants.H5E_MINOR, "Error in Test Function");
- assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0);
- H5.H5Eclose_msg(err_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Ecreate_msg_minor: " + err);
- }
- }
-
- @Test
- public void testH5Eget_msg() {
- int[] error_msg_type = { HDF5Constants.H5E_MINOR };
- long err_id = -1;
- String msg = null;
- try {
- err_id = H5.H5Ecreate_msg(hdf_java_classid,
- HDF5Constants.H5E_MAJOR, "Error in Test");
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- assertFalse("H5.H5Eget_msg: H5Ecreate_msg - " + err_id, err_id < 0);
- try {
- msg = H5.H5Eget_msg(err_id, error_msg_type);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- assertNotNull("H5.H5Eget_msg: " + msg, msg);
- assertEquals("H5.H5Eget_msg: ", "Error in Test", msg);
- assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR,
- error_msg_type[0]);
- try {
- H5.H5Eclose_msg(err_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- }
-
- @Test
- public void testH5Eget_msg_major() {
-
- try {
- H5.H5Fopen("test", 0, 1);
- }
- catch (HDF5LibraryException hdferr) {
- int[] error_msg_type = { HDF5Constants.H5E_MAJOR };
- String msg = null;
- try {
- msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(),
- error_msg_type);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- assertNotNull("H5.H5Eget_msg: " + msg, msg);
- assertEquals("H5.H5Eget_msg: ", "Object atom",
- msg);
- assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR,
- error_msg_type[0]);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- }
-
- @Test
- public void testH5Eget_msg_minor() {
- try {
- H5.H5Fopen("test", 0, 1);
- }
- catch (HDF5LibraryException hdferr) {
- int[] error_msg_type = { HDF5Constants.H5E_MINOR };
- String msg = null;
- try {
- msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(),
- error_msg_type);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- assertNotNull("H5.H5Eget_msg: " + msg, msg);
- assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg);
- assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR,
- error_msg_type[0]);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_msg: " + err);
- }
- }
-
- @Test
- public void testH5Ecreate_stack() {
- long stk_id = -1;
- try {
- stk_id = H5.H5Ecreate_stack();
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Ecreate_stack: " + err);
- }
- assertFalse("H5.H5Ecreate_stack: " + stk_id, stk_id < 0);
- try {
- H5.H5Eclose_stack(stk_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Ecreate_stack: " + err);
- }
- }
-
- @Test
public void testH5Epop() {
try {
H5.H5Eset_current_stack(current_stackid);
@@ -381,101 +208,6 @@ public class TestH5E {
} /* end test_create() */
@Test
- public void testH5EprintInt() {
- assertFalse(current_stackid < 0);
- try {
- H5.H5Eprint2(current_stackid, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5EprintInt: " + err);
- }
- }
-
- @Test
- public void testH5EclearInt() {
- try {
- H5.H5Eclear(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5EclearInt: " + err);
- }
- }
-
- @Test
- public void testH5Eclear2() {
- try {
- H5.H5Eclear2(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eclear2: " + err);
- }
- }
-
- @Test
- public void testH5Eauto_is_v2() {
- boolean is_v2 = false;
- try {
- is_v2 = H5.H5Eauto_is_v2(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eauto_is_v2: " + err);
- }
- assertTrue("H5.H5Eauto_is_v2: ", is_v2);
- }
-
- @Test
- public void testH5Eget_num() {
- long num_msg = -1;
- try {
- num_msg = H5.H5Eget_num(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eget_num: " + err);
- }
- assertTrue("H5.H5Eget_num", num_msg == 0);
- }
-
- @Test
- public void testH5Eget_num_with_msg() {
- try {
- H5.H5Eset_current_stack(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Epop: " + err);
- }
- try {
- H5.H5Fopen("test", 0, 1);
- }
- catch (Throwable err) {
- }
-
- // save current stack contents
- try {
- current_stackid = H5.H5Eget_current_stack();
- }
- catch (HDF5LibraryException err) {
- err.printStackTrace();
- fail("H5.H5Epop: " + err);
- }
-
- long num_msg = -1;
- try {
- num_msg = H5.H5Eget_num(current_stackid);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Epop: " + err);
- }
- assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0);
- }
-
- @Test
public void testH5Ewalk() {
class wdata {
public String err_desc = null;
diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java
new file mode 100644
index 0000000..fa9d776
--- /dev/null
+++ b/java/test/TestH5Eparams.java
@@ -0,0 +1,343 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+import hdf.hdf5lib.callbacks.H5E_walk_cb;
+import hdf.hdf5lib.callbacks.H5E_walk_t;
+import hdf.hdf5lib.structs.H5E_error2_t;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Eparams {
+ @Rule public TestName testname = new TestName();
+ long hdf_java_classid = -1;
+ long current_stackid = -1;
+
+ @Before
+ public void H5Eget_stack_class() {
+ assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+
+ hdf_java_classid = -1;
+ try {
+ hdf_java_classid = H5.H5Eregister_class("HDF-Java-Error",
+ "hdf-java", "2.5");
+ current_stackid = H5.H5Eget_current_stack();
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_stack_class: " + err);
+ }
+ }
+
+ @After
+ public void H5Erestore_stack_class() {
+ try {
+ H5.H5Eunregister_class(hdf_java_classid);
+ hdf_java_classid = -1;
+ H5.H5Eclose_stack(current_stackid);
+ current_stackid = -1;
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Erestore_stack_class: " + err);
+ }
+ System.out.println();
+ }
+
+ @Test
+ public void testH5Eget_class_name() {
+ try {
+ String class_name = H5.H5Eget_class_name(hdf_java_classid);
+ assertNotNull("H5.H5Eget_class_name: " + class_name, class_name);
+ assertEquals("H5.H5Eget_class_name: ", "HDF-Java-Error", class_name);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_class_name: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eprint2() {
+ try {
+ assertFalse(current_stackid < 0);
+ H5.H5Eprint2(current_stackid, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eprint2: " + err);
+ }
+ }
+
+ @Ignore("Tested with create_msg_major[minor]")
+ public void testH5Eclose_msg() {
+ fail("Not yet implemented");
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testH5Ecreate_msg_name_null() throws Throwable {
+ H5.H5Ecreate_msg(hdf_java_classid, HDF5Constants.H5E_MAJOR, null);
+ }
+
+ @Test
+ public void testH5Ecreate_msg_major() {
+ try {
+ long err_id = H5.H5Ecreate_msg(hdf_java_classid,
+ HDF5Constants.H5E_MAJOR, "Error in Test");
+ assertFalse("H5.H5Ecreate_msg_major: " + err_id, err_id < 0);
+ H5.H5Eclose_msg(err_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Ecreate_msg_major: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Ecreate_msg_minor() {
+ try {
+ long err_id = H5.H5Ecreate_msg(hdf_java_classid,
+ HDF5Constants.H5E_MINOR, "Error in Test Function");
+ assertFalse("H5.H5Ecreate_msg_minor: " + err_id, err_id < 0);
+ H5.H5Eclose_msg(err_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Ecreate_msg_minor: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eget_msg() {
+ int[] error_msg_type = { HDF5Constants.H5E_MINOR };
+ long err_id = -1;
+ String msg = null;
+ try {
+ err_id = H5.H5Ecreate_msg(hdf_java_classid,
+ HDF5Constants.H5E_MAJOR, "Error in Test");
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ assertFalse("H5.H5Eget_msg: H5Ecreate_msg - " + err_id, err_id < 0);
+ try {
+ msg = H5.H5Eget_msg(err_id, error_msg_type);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ assertNotNull("H5.H5Eget_msg: " + msg, msg);
+ assertEquals("H5.H5Eget_msg: ", "Error in Test", msg);
+ assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR,
+ error_msg_type[0]);
+ try {
+ H5.H5Eclose_msg(err_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eget_msg_major() {
+
+ try {
+ H5.H5Fopen("test", 0, 1);
+ }
+ catch (HDF5LibraryException hdferr) {
+ int[] error_msg_type = { HDF5Constants.H5E_MAJOR };
+ String msg = null;
+ try {
+ msg = H5.H5Eget_msg(hdferr.getMajorErrorNumber(),
+ error_msg_type);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ assertNotNull("H5.H5Eget_msg: " + msg, msg);
+ assertEquals("H5.H5Eget_msg: ", "Object atom",
+ msg);
+ assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MAJOR,
+ error_msg_type[0]);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eget_msg_minor() {
+ try {
+ H5.H5Fopen("test", 0, 1);
+ }
+ catch (HDF5LibraryException hdferr) {
+ int[] error_msg_type = { HDF5Constants.H5E_MINOR };
+ String msg = null;
+ try {
+ msg = H5.H5Eget_msg(hdferr.getMinorErrorNumber(),
+ error_msg_type);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ assertNotNull("H5.H5Eget_msg: " + msg, msg);
+ assertEquals("H5.H5Eget_msg: ", "Unable to find atom information (already closed?)", msg);
+ assertEquals("H5.H5Eget_msg: ", HDF5Constants.H5E_MINOR,
+ error_msg_type[0]);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_msg: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Ecreate_stack() {
+ long stk_id = -1;
+ try {
+ stk_id = H5.H5Ecreate_stack();
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Ecreate_stack: " + err);
+ }
+ assertFalse("H5.H5Ecreate_stack: " + stk_id, stk_id < 0);
+ try {
+ H5.H5Eclose_stack(stk_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Ecreate_stack: " + err);
+ }
+ }
+
+ @Test
+ public void testH5EprintInt() {
+ assertFalse(current_stackid < 0);
+ try {
+ H5.H5Eprint2(current_stackid, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5EprintInt: " + err);
+ }
+ }
+
+ @Test
+ public void testH5EclearInt() {
+ try {
+ H5.H5Eclear(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5EclearInt: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eclear2() {
+ try {
+ H5.H5Eclear2(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eclear2: " + err);
+ }
+ }
+
+ @Test
+ public void testH5Eauto_is_v2() {
+ boolean is_v2 = false;
+ try {
+ is_v2 = H5.H5Eauto_is_v2(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eauto_is_v2: " + err);
+ }
+ assertTrue("H5.H5Eauto_is_v2: ", is_v2);
+ }
+
+ @Test
+ public void testH5Eget_num() {
+ long num_msg = -1;
+ try {
+ num_msg = H5.H5Eget_num(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eget_num: " + err);
+ }
+ assertTrue("H5.H5Eget_num", num_msg == 0);
+ }
+
+ @Test
+ public void testH5Eget_num_with_msg() {
+ try {
+ H5.H5Eset_current_stack(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Epop: " + err);
+ }
+ try {
+ H5.H5Fopen("test", 0, 1);
+ }
+ catch (Throwable err) {
+ }
+
+ // save current stack contents
+ try {
+ current_stackid = H5.H5Eget_current_stack();
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5.H5Epop: " + err);
+ }
+
+ long num_msg = -1;
+ try {
+ num_msg = H5.H5Eget_num(current_stackid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Epop: " + err);
+ }
+ assertTrue("H5.H5Eget_num_with_msg #:" + num_msg, num_msg > 0);
+ }
+
+}
diff --git a/java/test/TestUnit.java b/java/test/TestUnit.java
new file mode 100644
index 0000000..b55e415
--- /dev/null
+++ b/java/test/TestUnit.java
@@ -0,0 +1,36 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses( { TestH5.class,
+ TestH5Eparams.class,
+ TestH5Fparams.class, TestH5Fbasic.class, TestH5F.class, TestH5Fswmr.class,
+ TestH5Gbasic.class, TestH5G.class,
+ TestH5Sbasic.class, TestH5S.class,
+ TestH5Tparams.class, TestH5Tbasic.class, TestH5T.class,
+ TestH5Dparams.class, TestH5D.class, TestH5Dplist.class,
+ TestH5Lparams.class, TestH5Lbasic.class, TestH5Lcreate.class,
+ TestH5R.class,
+ TestH5P.class, TestH5PData.class, TestH5Pfapl.class, TestH5Pvirtual.class, TestH5Plist.class,
+ TestH5A.class,
+ TestH5Oparams.class, TestH5Obasic.class, TestH5Ocopy.class, TestH5Ocreate.class,
+ TestH5PL.class, TestH5Z.class
+})
+
+public class TestUnit {
+}
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 77379d0..ca3790d 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -64,11 +64,11 @@ $HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar
$top_builddir/java/src/$JARFILE
"
LIST_DATA_FILES="
-$HDFTEST_HOME/JUnit-interface.txt
+$HDFTEST_HOME/JUnit-unit.txt
$HDFTEST_HOME/JUnit-interface.ert
"
-expect="JUnit-interface.txt"
+expect="JUnit-unit.txt"
actual="JUnit-interface.out"
actual_err="JUnit-interface.err"
actual_ext="JUnit-interface.ext"
@@ -257,11 +257,11 @@ esac
export LD_LIBRARY_PATH
-echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll"
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestUnit"
# Run test.
TESTING JUnit
(
- $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll
+ $RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestUnit
) >$actual_ext 2>$actual_err
# Extract file name, line number, version and thread IDs because they may be different