use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testGetVendorOption.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#getVendorOption()}.
*/
@Test
public void testGetVendorOption() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(VendorOptionManager.getInstance().getDefaultVendorOptionVersion(), field.getVendorOption());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testSetEnabled.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#internal_setEnabled(boolean)}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#isEnabled()}.
*/
@Test
public void testSetEnabled() {
// Value only, no attribute/expression dropdown
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
// Text field will not have been created
boolean expectedValue = true;
field.internal_setEnabled(expectedValue);
assertTrue(field.isEnabled());
// Create text field
field.createUI();
assertTrue(field.isEnabled());
expectedValue = false;
field.internal_setEnabled(expectedValue);
assertTrue(field.isEnabled());
// Has attribute/expression dropdown
valueOnly = false;
FieldConfigWindBarbs field2 = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
// Text field will not have been created
expectedValue = true;
field2.internal_setEnabled(expectedValue);
assertTrue(field2.isEnabled());
// Create text field
field2.createUI();
assertEquals(expectedValue, field2.isEnabled());
expectedValue = false;
field2.internal_setEnabled(expectedValue);
assertTrue(field2.isEnabled());
}
use of com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs in project sldeditor by robward-scisys.
the class FieldConfigWindBarbsTest method testAccept.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.windbarb.FieldConfigWindBarbs#accept(org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testAccept() {
boolean valueOnly = true;
FieldConfigWindBarbs field = new FieldConfigWindBarbs(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertFalse(field.accept(null));
StyleBuilder styleBuilder = new StyleBuilder();
ExternalGraphicImpl externalGraphic = (ExternalGraphicImpl) styleBuilder.createExternalGraphic("test.tmp", "png");
assertFalse(field.accept(externalGraphic));
Mark marker1 = styleBuilder.createMark("triangle");
assertFalse(field.accept(marker1));
Mark marker2 = styleBuilder.createMark("windbarbs://default(15)[kts]");
assertTrue(field.accept(marker2));
}
Aggregations