package skrueger.geotools; import static org.junit.Assert.assertNotNull; import java.awt.Dimension; import java.awt.image.BufferedImage; import java.io.IOException; import org.geotools.styling.Rule; import org.junit.After; import org.junit.Before; import org.junit.Test; import schmitzm.geotools.styling.StylingUtil; import schmitzm.junit.TestingClass; import schmitzm.swing.TestingUtil; public class LegendIconFeatureRendererTest extends TestingClass { @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void testCreateImageForRule() throws IOException { LegendIconFeatureRenderer r = LegendIconFeatureRenderer.getInstance(); Rule rule = StylingUtil.STYLE_BUILDER .createRule(StylingUtil.STYLE_BUILDER.createPolygonSymbolizer()); StyledFS polyAs = TestingUtil.TestDatasetsVector.countryShp .getStyledFS(); BufferedImage createImageForRule = r.createImageForRule(rule, polyAs .getFeatureSource().getSchema(), new Dimension(50, 50)); assertNotNull(createImageForRule); } }