use of com.sldeditor.render.RenderSymbol in project sldeditor by robward-scisys.
the class RenderSymbolTest method testRenderSymbol.
/**
* Test method for {@link com.sldeditor.render.RenderSymbol#RenderSymbol()}.
*/
@Test
public void testRenderSymbol() {
RenderSymbol symbol = new RenderSymbol();
StyledLayerDescriptor sld = createSLD();
StyledLayer styledLayer = sld.layers().get(0);
if (styledLayer instanceof NamedLayerImpl) {
NamedLayerImpl namedLayerImpl = (NamedLayerImpl) styledLayer;
Style expectedStyle = namedLayerImpl.styles().get(0);
SelectedSymbol.getInstance().setSld(sld);
Style actualStyle = symbol.getRenderStyle(SelectedSymbol.getInstance());
assertNull(actualStyle.featureTypeStyles().get(0).rules().get(0).getFilter());
assertEquals(expectedStyle.getName(), actualStyle.getName());
Rule expectedRule = expectedStyle.featureTypeStyles().get(0).rules().get(1);
SelectedSymbol.getInstance().setFeatureTypeStyle(expectedStyle.featureTypeStyles().get(0));
SelectedSymbol.getInstance().setRule(expectedRule);
actualStyle = symbol.getRenderStyle(SelectedSymbol.getInstance());
assertNull(actualStyle.featureTypeStyles().get(0).rules().get(0).getFilter());
assertEquals(expectedRule.getName(), actualStyle.featureTypeStyles().get(0).rules().get(0).getName());
}
}
Aggregations