public boolean compare(NetcdfFile org, NetcdfFile copy, boolean showCompare, boolean showEach, boolean compareData) { return compare(org, copy, null, showCompare, showEach, compareData); }
public boolean compare(NetcdfFile org, NetcdfFile copy, boolean showCompare, boolean showEach, boolean compareData) { return compare(org, copy, null, showCompare, showEach, compareData); }
public boolean compare(NetcdfFile org, NetcdfFile copy) { return compare(org, copy, showCompare, showEach, compareData); }
public boolean compare(NetcdfFile org, NetcdfFile copy) { return compare(org, copy, showCompare, showEach, compareData); }
public boolean compare(NetcdfFile org, NetcdfFile copy, boolean showCompare, boolean showEach, boolean compareData) { return compare(org, copy, null, showCompare, showEach, compareData); }
public boolean compare(NetcdfFile org, NetcdfFile copy) { return compare(org, copy, showCompare, showEach, compareData); }
static public boolean compareFiles(NetcdfFile org, NetcdfFile copy, Formatter f, boolean _compareData, boolean _showCompare, boolean _showEach) { CompareNetcdf2 tc = new CompareNetcdf2(f, _showCompare, _showEach, _compareData); return tc.compare(org, copy); }
static public boolean compareFiles(NetcdfFile org, NetcdfFile copy, Formatter f, boolean _compareData, boolean _showCompare, boolean _showEach) { CompareNetcdf2 tc = new CompareNetcdf2(f, _showCompare, _showEach, _compareData); return tc.compare(org, copy); }
static public boolean compareFiles(NetcdfFile org, NetcdfFile copy, Formatter f, boolean _compareData, boolean _showCompare, boolean _showEach) { CompareNetcdf2 tc = new CompareNetcdf2(f, _showCompare, _showEach, _compareData); return tc.compare(org, copy); }
private boolean compare(NetcdfFile nc1, NetcdfFile nc2, boolean showCompare, boolean showEach, boolean compareData) throws IOException { Formatter f = new Formatter(); CompareNetcdf2 tc = new CompareNetcdf2(f, showCompare, showEach, compareData); boolean ok = tc.compare(nc1, nc2, new CompareNetcdf2.Netcdf4ObjectFilter(), showCompare, showEach, compareData); System.out.printf(" %s compare %s to %s ok = %s%n", ok ? "" : "***", nc1.getLocation(), nc2.getLocation(), ok); if(!ok) System.out.printf(" %s%n", f); return ok; }
static int compareDatasets(String local, String remote, boolean readData) throws IOException { System.out.printf("--Compare %s to %s%n", local, remote); try (NetcdfFile ncfile = NetcdfDataset.openFile(local, null); NetcdfFile ncremote = new CdmRemote(remote)) { Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, false, false, false); boolean ok = mind.compare(ncfile, ncremote, new NcstreamObjFilter(), false, false, readData); if (!ok) { System.out.printf(" %s%n", f); } Assert.assertTrue(local + " != " + remote, ok); } return 1; }
static int compareDatasets(String local, String remote, boolean readData) throws IOException { try (NetcdfFile ncfile = NetcdfDataset.openFile(local, null); NetcdfFile ncremote = new CdmRemote(remote)) { Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, false, false, false); boolean ok = mind.compare(ncfile, ncremote, new NcstreamObjFilter(), false, false, readData); if (!ok) { System.out.printf("--Compare %s to %s%n", local, remote); System.out.printf(" %s%n", f); } Assert.assertTrue(local + " != " + remote, ok); } return 1; }
private boolean doCompare(String location, boolean showCompare, boolean showEach, boolean compareData) throws IOException { NetcdfFile ncfile = NetcdfFile.open(location); NetcdfFile jni = openJni(location); jni.setLocation(location+" (jni)"); //System.out.printf("Compare %s to %s%n", ncfile.getIosp().getClass().getName(), jni.getIosp().getClass().getName()); Formatter f= new Formatter(); CompareNetcdf2 tc = new CompareNetcdf2(f, showCompare, showEach, compareData); boolean ok = tc.compare(ncfile, jni, new CompareNetcdf2.Netcdf4ObjectFilter(), showCompare, showEach, compareData); System.out.printf(" %s compare %s ok = %s%n", ok ? "" : "***", location, ok); if (!ok ||(showCompare && showCompareResults)) System.out.printf("%s%n=====================================%n", f); ncfile.close(); jni.close(); return ok; }
public int doAct(String filename) throws IOException { filename = StringUtil2.replace(filename, '\\', "/"); filename = StringUtil2.remove(filename, dirName); String dodsUrl = urlPrefix + filename; String localPath = dirName + filename; logger.debug("--Compare {} to {}", localPath, dodsUrl); NetcdfDataset org_ncfile = NetcdfDataset.openDataset(localPath); NetcdfDataset dods_file = NetcdfDataset.openDataset(dodsUrl); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, false, false, false); boolean ok = mind.compare(org_ncfile, dods_file, new TestDODScompareWithFiles.DodsObjFilter(), false, false, false); if (!ok) { logger.debug("--Compare {}", filename); logger.debug(" {}", f); } Assert.assertTrue( localPath+ " != "+dodsUrl, ok); return 1; } }, false);
@Test public void testChardata() { // was failing on char data being sign extended try { String filename = "/netcdf3/files/c0_64.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
@Test public void testVariableNameWithDot() { try { String filename = "/hdf5/grid_1_3d_xyz_aug.h5"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), false, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } } }
@Test public void testByteOrder() { try { String filename = "/netcdf3/longOffset.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath + filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, true, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
@Test public void testVlen() { try { String filename = "/netcdf4/vlen/tst_vl.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
@Test public void testVlenInStructure() { try { String filename = "/netcdf4/vlen/IntTimSciSamp.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }
@Test public void testStringArray() { try { String filename = "/netcdf4/files/tst_string_data.nc"; String remoteFile = TestOnLocalServer.withHttpPath(urlPath+filename); CdmRemote ncfileRemote = new CdmRemote(remoteFile); String localFile = contentRoot+filename; NetcdfFile ncfileLocal = NetcdfFile.open(localFile); Formatter f = new Formatter(); CompareNetcdf2 mind = new CompareNetcdf2(f, true, true, true); boolean ok = mind.compare(ncfileLocal, ncfileRemote, new TestCdmRemoteCompareHeadersP.NcstreamObjFilter(), true, false, true); System.out.printf("--Compare %s to %s%n", localFile, remoteFile); System.out.printf(" %s%n", f); Assert.assertTrue(ok); ncfileLocal.close(); ncfileRemote.close(); } catch (Exception e) { e.printStackTrace(); assert false; } }