@Test
public void testMountTableStatsDataSource()
    throws IOException, JSONException {

  RBFMetrics metrics = getRouter().getMetrics();
  String jsonString = metrics.getMountTable();
  JSONArray jsonArray = new JSONArray(jsonString);
  assertEquals(jsonArray.length(), getMockMountTable().size());
  int match = 0;
  for (int i = 0; i < jsonArray.length(); i++) {
    JSONObject json = jsonArray.getJSONObject(i);
    String src = json.getString("sourcePath");
    for (MountTable entry : getMockMountTable()) {
      if (entry.getSourcePath().equals(src)) {
        assertEquals(entry.getDefaultLocation().getNameserviceId(),
            json.getString("nameserviceId"));
        assertEquals(entry.getDefaultLocation().getDest(),
            json.getString("path"));
        assertEquals(entry.getOwnerName(), json.getString("ownerName"));
        assertEquals(entry.getGroupName(), json.getString("groupName"));
        assertEquals(entry.getMode().toString(), json.getString("mode"));
        assertEquals(entry.getQuota().toString(), json.getString("quota"));
        assertNotNullAndNotEmpty(json.getString("dateCreated"));
        assertNotNullAndNotEmpty(json.getString("dateModified"));
        match++;
      }
    }
  }
  assertEquals(match, getMockMountTable().size());
}