use of com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT in project sldeditor by robward-scisys.
the class FieldConfigWKTTest method testGenerateExpression.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#generateExpression()}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#populateExpression(java.lang.Object, org.opengis.filter.expression.Expression)}.
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.wkt.FieldConfigWKT#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
*/
@Test
public void testGenerateExpression() {
boolean valueOnly = true;
FieldConfigWKT field = new FieldConfigWKT(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
field.populateExpression((Double) null);
field.populateField((String) null);
assertNull(field.getStringValue());
// Create ui
field.createUI();
field.populateExpression((Double) null);
String expectedValue = "string value";
field.populateExpression(expectedValue);
assertTrue(expectedValue.compareTo(field.getStringValue()) == 0);
expectedValue = "wkt://POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))";
field.setTestValue(null, expectedValue);
field.populateExpression(expectedValue);
assertTrue(expectedValue.compareTo(field.getStringValue()) == 0);
}
Aggregations