Test of generate method, of class Legend.
()
| 175 | * Test of generate method, of class Legend. |
| 176 | */ |
| 177 | @Test |
| 178 | public void testGenerate() { |
| 179 | System.out.println("generate"); |
| 180 | |
| 181 | int imageWidth = 500; |
| 182 | int imageHeight = 700; |
| 183 | |
| 184 | Legend instance1 = new Legend(layer, Legend.Orientation.HORIZONTAL, imageWidth); |
| 185 | try { |
| 186 | BufferedImage result = instance1.generate(); |
| 187 | assertNotNull(result); |
| 188 | assertEquals(imageWidth, result.getWidth()); |
| 189 | } catch(Legend.RenderException ex){ |
| 190 | fail(ex.getMessage()); |
| 191 | } |
| 192 | |
| 193 | Legend instance2 = new Legend(layer, Legend.Orientation.VERTICAL, imageHeight); |
| 194 | try { |
| 195 | BufferedImage result = instance2.generate(); |
| 196 | assertNotNull(result); |
| 197 | assertEquals(imageHeight, result.getHeight()); |
| 198 | } catch(Legend.RenderException ex){ |
| 199 | fail(ex.getMessage()); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | } |