summaryrefslogtreecommitdiffstats
path: root/java/test/TestH5Pfaplhdfs.java
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2019-09-19 17:05:08 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2019-09-19 17:05:08 (GMT)
commite2be2824f932297c8acd5fb6270c7b6e01c48579 (patch)
tree5719653bdbffc05e63afdcebc5da5ca61e577a1b /java/test/TestH5Pfaplhdfs.java
parentcf0fb665ac0083e79240d45b684f6c826ff1cb6b (diff)
parent4d4a88a9f3775d1c6be820208a2699ae38d586b4 (diff)
downloadhdf5-e2be2824f932297c8acd5fb6270c7b6e01c48579.zip
hdf5-e2be2824f932297c8acd5fb6270c7b6e01c48579.tar.gz
hdf5-e2be2824f932297c8acd5fb6270c7b6e01c48579.tar.bz2
Merge pull request #20 in ~VCHOI/my_third_fork from develop to bugfix/HDFFV-10585-investigate-slowness-of-regular
* commit '4d4a88a9f3775d1c6be820208a2699ae38d586b4': (29 commits) Fix for H5EA debug package when built in release mode. Moved NDEBUG guards to H5EA_DEBUG in H5EA package. Added MPICH_SKIP_MPICXX and OMPI_SKIP_CXX to H5public.h to avoid inadvertant linking to the deprecated MPI C++ wrappers. Fixes HDFFV-10893. Added a release note for HDFFV-10892 (fcntl lock bug). Fix segfault after H5VL_loc_params_t fix merge HDFFV-10901 add missing config options HDFFV-10854 add release note for windows Fix get home dir for windows Use variable for test output Allow tests to dump output if not comparing revert as CHECK will first check for exception Clear exception for getting JNI string to clear the exception Correct Windows check revert windows change Windows ssl headers are not in system loacation Add include dirs and default lib for windows Add policy to use <package>_ROOT Add statement for label if code unimplemented Update Windows require for CURL to CMake 3.13 Fix unused var ...
Diffstat (limited to 'java/test/TestH5Pfaplhdfs.java')
-rw-r--r--java/test/TestH5Pfaplhdfs.java69
1 files changed, 13 insertions, 56 deletions
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java
index 30d326e..b0d42d8 100644
--- a/java/test/TestH5Pfaplhdfs.java
+++ b/java/test/TestH5Pfaplhdfs.java
@@ -19,18 +19,11 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.io.File;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
-import hdf.hdf5lib.exceptions.HDF5PropertyListInterfaceException;
-import hdf.hdf5lib.structs.H5AC_cache_config_t;
import hdf.hdf5lib.structs.H5FD_hdfs_fapl_t;
-import hdf.hdf5lib.structs.H5FD_ros3_fapl_t;
import org.junit.After;
import org.junit.Before;
@@ -41,11 +34,6 @@ import org.junit.rules.TestName;
public class TestH5Pfaplhdfs {
@Rule public TestName testname = new TestName();
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5Fdsid = -1;
- long H5Fdid = -1;
long fapl_id = -1;
long plapl_id = -1;
long dapl_id = -1;
@@ -53,9 +41,9 @@ public class TestH5Pfaplhdfs {
long btplist_id = -1;
@Before
- public void createFileAccess()
- throws NullPointerException, HDF5Exception {
- assertTrue("H5 open ids is 0",H5.getOpenIDCount()==0);
+ public void createFileAccess() throws NullPointerException, HDF5Exception
+ {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount() == 0);
System.out.print(testname.getMethodName());
try {
@@ -89,7 +77,8 @@ public class TestH5Pfaplhdfs {
}
@After
- public void deleteFileAccess() throws HDF5LibraryException {
+ public void deleteFileAccess() throws HDF5LibraryException
+ {
if (fapl_id > 0)
try {H5.H5Pclose(fapl_id);} catch (Exception ex) {}
if (plapl_id > 0)
@@ -100,23 +89,11 @@ public class TestH5Pfaplhdfs {
try {H5.H5Pclose(plist_id);} catch (Exception ex) {}
if (btplist_id > 0)
try {H5.H5Pclose(btplist_id);} catch (Exception ex) {}
-
- if (H5Fdsid > 0)
- try {H5.H5Sclose(H5Fdsid);} catch (Exception ex) {}
- if (H5Fdid > 0)
- try {H5.H5Dclose(H5Fdid);} catch (Exception ex) {}
- if (H5dsid > 0)
- try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
- if (H5did > 0)
- try {H5.H5Dclose(H5did);} catch (Exception ex) {}
- if (H5fid > 0)
- try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
System.out.println();
}
@Test
- public void testHDFS_fapl()
- throws Exception
+ public void testHDFS_fapl() throws Exception
{
if (HDF5Constants.H5FD_HDFS < 0)
throw new HDF5LibraryException("skip");
@@ -127,34 +104,17 @@ public class TestH5Pfaplhdfs {
String kerbcache = "/dev/null";
int streamsize = 1024;
- final H5FD_hdfs_fapl_t config = new H5FD_hdfs_fapl_t(
- nodename,
- nodeport,
- username,
- kerbcache,
- streamsize
- );
- assertTrue("setting fapl should succeed",
- -1 < H5.H5Pset_fapl_hdfs(fapl_id, config));
+ final H5FD_hdfs_fapl_t config = new H5FD_hdfs_fapl_t(nodename, nodeport, username, kerbcache, streamsize);
+ assertTrue("setting fapl should succeed", -1 < H5.H5Pset_fapl_hdfs(fapl_id, config));
- assertEquals("driver types should match",
- HDF5Constants.H5FD_HDFS,
- H5.H5Pget_driver(fapl_id));
+ assertEquals("driver types should match", HDF5Constants.H5FD_HDFS, H5.H5Pget_driver(fapl_id));
H5FD_hdfs_fapl_t copy = H5.H5Pget_fapl_hdfs(fapl_id);
- assertEquals("fapl contents should match",
- new H5FD_hdfs_fapl_t(
- nodename,
- nodeport,
- username,
- kerbcache,
- streamsize),
- copy);
+ assertEquals("fapl contents should match", new H5FD_hdfs_fapl_t(nodename, nodeport, username, kerbcache, streamsize), copy);
}
@Test(expected = HDF5LibraryException.class)
- public void testH5Pget_fapl_hdfs_invalid_fapl_id()
- throws Exception
+ public void testH5Pget_fapl_hdfs_invalid_fapl_id() throws Exception
{
if (HDF5Constants.H5FD_HDFS < 0)
throw new HDF5LibraryException("skip");
@@ -162,8 +122,7 @@ public class TestH5Pfaplhdfs {
}
@Test(expected = HDF5LibraryException.class)
- public void testH5Pget_fapl_hdfs_fapl_id_of_wrong_driver_type()
- throws Exception
+ public void testH5Pget_fapl_hdfs_fapl_id_of_wrong_driver_type() throws Exception
{
if (HDF5Constants.H5FD_HDFS < 0)
throw new HDF5LibraryException("skip");
@@ -172,9 +131,7 @@ public class TestH5Pfaplhdfs {
/* TODO: for now, test against a sec2 fapl only */
H5.H5Pset_fapl_sec2(fapl_id);
- assertEquals("fapl_id was not set properly",
- HDF5Constants.H5FD_SEC2,
- H5.H5Pget_driver(fapl_id));
+ assertEquals("fapl_id was not set properly", HDF5Constants.H5FD_SEC2, H5.H5Pget_driver(fapl_id));
H5FD_hdfs_fapl_t fails = H5.H5Pget_fapl_hdfs(fapl_id);
}