if ( ! gribInit_1_8() ) return false;
netcdfObj = openNc( ncObjType, gribIospVer );
int timeDimLengthExpected = 8;
Dimension timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 2: data file (1-8), index file (1-8, CHANGE).
// [Sync should not use index in cache. HOW TO TEST?]
if ( ! indexSetup1_8() ) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 3: data file (1-12, CHANGE), index file (1-8).
if ( ! gribAppend9_12()) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 4: data file (1-12), index file (1-12, CHANGE).
if ( ! indexSetup1_12()) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDimLengthExpected = 12;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 5: data file (1-18, CHANGE), index file (1-12).
if ( ! gribAppend13_18()) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 6: data file (1-18), index file (1-18, CHANGE).
if ( ! indexSetup1_18()) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDimLengthExpected = 18;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
// Setup 7: data file (1-21, CHANGE), index file (1-21, CHANGE).
if ( ! gribAppend19_21()) return false;
if ( ! indexSetup1_21()) return false;
if ( ! syncNc( netcdfObj ) ) return false;
timeDimLengthExpected = 21;
timeDim = netcdfObj.findDimension( "time" );
assertEquals( "Length of time dimension [" + timeDim.getLength() + "] not as expected [" + timeDimLengthExpected + "].",
timeDim.getLength(),
timeDimLengthExpected );
DiskCache.simulateUnwritableDir = false;
return true;