/** * Test that a file was really generated, and that the image, when loaded, has the specified size. * @throws IOException possible exception when reading the image for validation */ public void testXYLineChartDemo() throws IOException { String imageFilename = getOutputDirectory() + "xylinechart.png"; Demo demo = new Demo(); demo.createXYLineChart(imageFilename); File imagefile = new File(imageFilename); assertTrue(imagefile.exists()); BufferedImage image = ImageIO.read(imagefile); assertEquals(800, image.getWidth(null)); assertEquals(600, image.getHeight(null)); }