Example #1
0
 @Test
 public void testFormatDateFor10Min() throws Exception {
   String expected = FormatterCalendar.format(FilterRange.R10MIN, date);
   table.setFormatterCalendar(FilterRange.R10MIN);
   table.setItems(items);
   Object firstPeriod = getFirstPeriod();
   assertEquals(expected, firstPeriod);
 }
Example #2
0
 @Test
 public void testTotal() throws Exception {
   table.setItems(items);
   assertItemAndValue(TimingsTable.PERIOD, TimingsTable.TOTAL);
   assertItemAndValue(TimingsType.MIN.getName(), "5");
   assertItemAndValue(TimingsType.MAX.getName(), "10");
   assertItemAndValue(TimingsType.AVG.getName(), "26");
   assertItemAndValue(TimingsType.P90.getName(), "19");
   assertItemAndValue(TimingsType.P95.getName(), "13");
   assertItemAndValue(TimingsType.P99.getName(), "25");
   assertItemAndValue(TimingsType.QUERIES.getName(), "7");
   assertItemAndValue(TimingsType.ERRORS.getName(), "17");
 }
Example #3
0
 @Test
 public void testClearTotal() throws Exception {
   table.setItems(items);
   testTotal();
 }
Example #4
0
 @Test
 public void testRemoveAllItems() throws Exception {
   table.setItems(items);
   testCountRows();
 }
Example #5
0
 @Test
 public void testCountRows() throws Exception {
   table.setItems(items);
   int size = table.getItemIds().size();
   assertEquals(3, size);
 }
Example #6
0
 @Test
 public void testCountColumns() throws Exception {
   int size = table.getColumnHeaders().length;
   assertEquals(9, size);
 }
Example #7
0
 public void assertItemAndValue(String columnId, Object value) {
   String footer = table.getColumnFooter(columnId);
   assertEquals(value, footer);
 }
Example #8
0
 private Object getFirstPeriod() {
   Object itemId = table.getCurrentPageFirstItemId();
   Item item = table.getItem(itemId);
   Property property = item.getItemProperty(TimingsTable.PERIOD);
   return property.getValue();
 }