1 |
alfonx |
1277 |
package skrueger.geotools; |
2 |
|
|
|
3 |
|
|
import static org.junit.Assert.assertNotNull; |
4 |
|
|
|
5 |
|
|
import java.awt.Dimension; |
6 |
|
|
import java.awt.image.BufferedImage; |
7 |
|
|
import java.io.IOException; |
8 |
|
|
|
9 |
|
|
import org.geotools.styling.Rule; |
10 |
|
|
import org.junit.After; |
11 |
|
|
import org.junit.Before; |
12 |
|
|
import org.junit.Test; |
13 |
|
|
|
14 |
|
|
import schmitzm.geotools.styling.StylingUtil; |
15 |
alfonx |
1332 |
import schmitzm.junit.TestingClass; |
16 |
alfonx |
1277 |
import schmitzm.swing.TestingUtil; |
17 |
alfonx |
1332 |
public class LegendIconFeatureRendererTest extends TestingClass { |
18 |
alfonx |
1277 |
|
19 |
|
|
@Before |
20 |
|
|
public void setUp() throws Exception { |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
@After |
24 |
|
|
public void tearDown() throws Exception { |
25 |
|
|
} |
26 |
|
|
|
27 |
|
|
@Test |
28 |
|
|
public void testCreateImageForRule() throws IOException { |
29 |
|
|
LegendIconFeatureRenderer r = LegendIconFeatureRenderer.getInstance(); |
30 |
|
|
Rule rule = StylingUtil.STYLE_BUILDER |
31 |
|
|
.createRule(StylingUtil.STYLE_BUILDER.createPolygonSymbolizer()); |
32 |
|
|
|
33 |
|
|
StyledFS polyAs = TestingUtil.TestDatasetsVector.countryShp |
34 |
|
|
.getStyledFS(); |
35 |
|
|
|
36 |
|
|
BufferedImage createImageForRule = r.createImageForRule(rule, polyAs |
37 |
|
|
.getFeatureSource().getSchema(), new Dimension(50, 50)); |
38 |
|
|
|
39 |
|
|
assertNotNull(createImageForRule); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
} |