@Test public void testDates() throws IOException { String fullpath = TestDir.cdmUnitTestDir + filename; Formatter errlog = new Formatter(); RadialDatasetSweep rds = (RadialDatasetSweep) FeatureDatasetFactoryManager.open(FeatureType.RADIAL, fullpath, null, errlog); Assert.assertEquals(start, rds.getCalendarDateStart()); Assert.assertEquals(end, rds.getCalendarDateEnd()); } }
private void testAllMethods(String location) throws IOException { Formatter errlog = new Formatter(); RadialDatasetSweep rds = (RadialDatasetSweep) FeatureDatasetFactoryManager.open(FeatureType.RADIAL, location, null, errlog); System.out.println(location+"-----------"); rds.getDetailInfo(errlog); if (show) System.out.println(errlog); CalendarDate d1 = rds.getCalendarDateStart(); CalendarDate d2 = rds.getCalendarDateEnd(); if ((d1 != null) && (d2 != null)) assert d1.isBefore(d2) || d1.equals( d2); ucar.unidata.geoloc.EarthLocation eloc = rds.getCommonOrigin(); assert eloc != null; LatLonPoint llp = new LatLonPointImpl( eloc.getLatitude(), eloc.getLongitude()); LatLonRect bb = rds.getBoundingBox(); assert bb.contains(llp); List rvars = rds.getDataVariables(); assert null != rvars; assert 0 < rvars.size(); for (int i = 0; i < rvars.size(); i++) { RadialDatasetSweep.RadialVariable rv = (RadialDatasetSweep.RadialVariable) rvars.get(i); testRadialVariable( rv); } }
@Test public void testDates() throws IOException { try (RadialDatasetSweep ds = testData()) { CalendarDate trueStart = CalendarDate.of(null, 2008, 6, 4, 0, 15, 3); Assert.assertEquals(trueStart, ds.getCalendarDateStart()); CalendarDate trueEnd = CalendarDate.of(null, 2008, 6, 4, 0, 22, 17); Assert.assertEquals(trueEnd, ds.getCalendarDateEnd()); } }