/**
  * Validates a JRB.
  *
  * <p>It assumes storeByGroup=true
  *
  * @param file the JRB file instance
  * @param dsnames the array of data source names
  * @param dsvalues the array of data source values
  * @throws Exception the exception
  */
 public void validateJrb(File file, String[] dsnames, Double[] dsvalues) throws Exception {
   Assert.assertTrue(file.exists());
   RrdDb jrb = new RrdDb(file);
   Assert.assertEquals(dsnames.length, jrb.getDsCount());
   for (int i = 0; i < dsnames.length; i++) {
     Datasource ds = jrb.getDatasource(dsnames[i]);
     Assert.assertNotNull(ds);
     Assert.assertEquals(dsvalues[i], Double.valueOf(ds.getLastValue()));
   }
 }