diff options
Diffstat (limited to 'java/test/TestH5Pfaplhdfs.java')
-rw-r--r-- | java/test/TestH5Pfaplhdfs.java | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java index d922666..e99967b 100644 --- a/java/test/TestH5Pfaplhdfs.java +++ b/java/test/TestH5Pfaplhdfs.java @@ -31,12 +31,13 @@ import org.junit.Test; import org.junit.rules.TestName; public class TestH5Pfaplhdfs { - @Rule public TestName testname = new TestName(); + @Rule + public TestName testname = new TestName(); - long fapl_id = HDF5Constants.H5I_INVALID_HID; - long plapl_id = HDF5Constants.H5I_INVALID_HID; - long dapl_id = HDF5Constants.H5I_INVALID_HID; - long plist_id = HDF5Constants.H5I_INVALID_HID; + long fapl_id = HDF5Constants.H5I_INVALID_HID; + long plapl_id = HDF5Constants.H5I_INVALID_HID; + long dapl_id = HDF5Constants.H5I_INVALID_HID; + long plist_id = HDF5Constants.H5I_INVALID_HID; long btplist_id = HDF5Constants.H5I_INVALID_HID; @Before @@ -62,9 +63,9 @@ public class TestH5Pfaplhdfs { } assertTrue(plapl_id > 0); try { - plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); + plist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); btplist_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_XFER); - dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS); + dapl_id = H5.H5Pcreate(HDF5Constants.H5P_DATASET_ACCESS); } catch (Throwable err) { err.printStackTrace(); @@ -79,15 +80,35 @@ public class TestH5Pfaplhdfs { public void deleteFileAccess() throws HDF5LibraryException { if (fapl_id > 0) - try {H5.H5Pclose(fapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(fapl_id); + } + catch (Exception ex) { + } if (plapl_id > 0) - try {H5.H5Pclose(plapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(plapl_id); + } + catch (Exception ex) { + } if (dapl_id > 0) - try {H5.H5Pclose(dapl_id);} catch (Exception ex) {} + try { + H5.H5Pclose(dapl_id); + } + catch (Exception ex) { + } if (plist_id > 0) - try {H5.H5Pclose(plist_id);} catch (Exception ex) {} + try { + H5.H5Pclose(plist_id); + } + catch (Exception ex) { + } if (btplist_id > 0) - try {H5.H5Pclose(btplist_id);} catch (Exception ex) {} + try { + H5.H5Pclose(btplist_id); + } + catch (Exception ex) { + } System.out.println(); } @@ -97,19 +118,21 @@ public class TestH5Pfaplhdfs { if (HDF5Constants.H5FD_HDFS < 0) throw new HDF5LibraryException("skip"); - String nodename = "blues"; - int nodeport = 12345; - String username = "sparticus"; + String nodename = "blues"; + int nodeport = 12345; + String username = "sparticus"; String kerbcache = "/dev/null"; - int streamsize = 1024; + int streamsize = 1024; - final H5FD_hdfs_fapl_t config = new H5FD_hdfs_fapl_t(nodename, nodeport, username, kerbcache, streamsize); + 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)); 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) @@ -125,13 +148,12 @@ public class TestH5Pfaplhdfs { { if (HDF5Constants.H5FD_HDFS < 0) throw new HDF5LibraryException("skip"); - if (HDF5Constants.H5FD_SEC2 < 0 ) + if (HDF5Constants.H5FD_SEC2 < 0) throw new HDF5LibraryException("skip"); - /* TODO: for now, test against a sec2 fapl only */ + /* 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)); H5FD_hdfs_fapl_t fails = H5.H5Pget_fapl_hdfs(fapl_id); } - } |