use of com.sldeditor.ui.detail.PointSymbolizerDetails in project sldeditor by robward-scisys.
the class PointSymbolizerDetailsTest method testAddRenderer.
/**
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#addRenderer(com.sldeditor.datasource.RenderSymbolInterface)}.
*/
@Test
public void testAddRenderer() {
SelectedSymbol.destroyInstance();
PointSymbolizerDetails panel = new PointSymbolizerDetails();
panel.addRenderer(null);
}
use of com.sldeditor.ui.detail.PointSymbolizerDetails in project sldeditor by robward-scisys.
the class PointSymbolizerDetailsTest method testPointSymbolizerDetails.
/**
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#populate(com.sldeditor.common.data.SelectedSymbol)}.
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#dataChanged(com.sldeditor.ui.detail.config.FieldId)}.
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#getFieldDataManager()}.
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#isDataPresent()}.
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#preLoadSymbol()}.
* Test method for {@link com.sldeditor.ui.detail.PointSymbolizerDetails#PointSymbolizerDetails(com.sldeditor.filter.v2.function.FunctionNameInterface)}.
*/
@Test
public void testPointSymbolizerDetails() {
SelectedSymbol.destroyInstance();
PointSymbolizerDetails panel = new PointSymbolizerDetails();
panel.populate(null);
// Set up test data
StyledLayerDescriptor sld = DefaultSymbols.createNewSLD();
SelectedSymbol.getInstance().createNewSLD(sld);
NamedLayer namedLayer = DefaultSymbols.createNewNamedLayer();
String expectedNameLayerValue = "named layer test value";
namedLayer.setName(expectedNameLayerValue);
Style style = DefaultSymbols.createNewStyle();
String expectedNameStyleValue = "style test value";
style.setName(expectedNameStyleValue);
namedLayer.addStyle(style);
FeatureTypeStyle fts = DefaultSymbols.createNewFeatureTypeStyle();
String expectedNameFTSValue = "feature type style test value";
fts.setName(expectedNameFTSValue);
style.featureTypeStyles().add(fts);
Rule rule = DefaultSymbols.createNewRule();
String expectedRuleValue = "rule test value";
rule.setName(expectedRuleValue);
PointSymbolizer symbolizer = DefaultSymbols.createDefaultPointSymbolizer();
String expectedNameValue = "symbolizer test value";
symbolizer.setName(expectedNameValue);
rule.symbolizers().add(symbolizer);
fts.rules().add(rule);
sld.layers().add(namedLayer);
SelectedSymbol.getInstance().addNewStyledLayer(namedLayer);
SelectedSymbol.getInstance().setStyledLayer(namedLayer);
SelectedSymbol.getInstance().setStyle(style);
SelectedSymbol.getInstance().setFeatureTypeStyle(fts);
SelectedSymbol.getInstance().setRule(rule);
SelectedSymbol.getInstance().setSymbolizer(symbolizer);
panel.populate(SelectedSymbol.getInstance());
GraphicPanelFieldManager fieldDataManager = panel.getFieldDataManager();
assertNotNull(fieldDataManager);
panel.dataChanged(null);
FieldConfigString descriptionField = (FieldConfigString) fieldDataManager.get(FieldIdEnum.DESCRIPTION);
assertNull(descriptionField);
assertTrue(panel.isDataPresent());
// Reset to default value
panel.preLoadSymbol();
}
Aggregations