예제 #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);
 }
예제 #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");
 }
예제 #3
0
 @Test
 public void testClearTotal() throws Exception {
   table.setItems(items);
   testTotal();
 }
예제 #4
0
 @Test
 public void testRemoveAllItems() throws Exception {
   table.setItems(items);
   testCountRows();
 }
예제 #5
0
 @Test
 public void testCountRows() throws Exception {
   table.setItems(items);
   int size = table.getItemIds().size();
   assertEquals(3, size);
 }
예제 #6
0
 @Test
 public void testCountColumns() throws Exception {
   int size = table.getColumnHeaders().length;
   assertEquals(9, size);
 }
예제 #7
0
 public void assertItemAndValue(String columnId, Object value) {
   String footer = table.getColumnFooter(columnId);
   assertEquals(value, footer);
 }
예제 #8
0
 private Object getFirstPeriod() {
   Object itemId = table.getCurrentPageFirstItemId();
   Item item = table.getItem(itemId);
   Property property = item.getItemProperty(TimingsTable.PERIOD);
   return property.getValue();
 }