| | |
| | | assertFalse(java.util.Arrays.equals(twoDecimals, threeDecimals)); |
| | | } |
| | | |
| | | @Test |
| | | void rendersLineChartWithConfiguredDayLabels() { |
| | | HolidayTrendChartService service = new HolidayTrendChartService(); |
| | | HolidayTrendChartService.ChartSeries congestion = new HolidayTrendChartService.ChartSeries(); |
| | | congestion.setName("\u5e73\u5747\u62e5\u6324\u5ea6"); |
| | | congestion.setValues(java.util.Arrays.asList( |
| | | new BigDecimal("0.50"), new BigDecimal("0.48"), new BigDecimal("0.47"), |
| | | new BigDecimal("0.49"), new BigDecimal("0.49"), new BigDecimal("0.49"), |
| | | new BigDecimal("0.47"))); |
| | | java.util.List<String> sevenDays = java.util.Arrays.asList( |
| | | "10\u67081\u65e5", "10\u67082\u65e5", "10\u67083\u65e5", "10\u67084\u65e5", |
| | | "10\u67085\u65e5", "10\u67086\u65e5", "10\u67087\u65e5"); |
| | | |
| | | byte[] custom = service.lineChart("\u62e5\u6324\u5ea6", |
| | | java.util.Collections.singletonList(congestion), false, 2, sevenDays, 1100, 590); |
| | | byte[] defaults = service.lineChart("\u62e5\u6324\u5ea6", |
| | | java.util.Collections.singletonList(congestion), false, 2, 1100, 590); |
| | | |
| | | assertPng(custom); |
| | | assertPng(defaults); |
| | | assertFalse(java.util.Arrays.equals(custom, defaults), |
| | | "custom day labels should change the rendered axis"); |
| | | } |
| | | |
| | | private void assertNoLargeLightGrayBackground(byte[] data) throws Exception { |
| | | BufferedImage image = ImageIO.read(new ByteArrayInputStream(data)); |
| | | int matches = 0; |