use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testRevertToDefaultValue.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#revertToDefaultValue()}.
*/
@Test
public void testRevertToDefaultValue() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
field.revertToDefaultValue();
assertTrue(field.getFeatureTypeConstraint().isEmpty());
field.createUI();
field.revertToDefaultValue();
assertTrue(field.getFeatureTypeConstraint().isEmpty());
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
class TestFieldConfigFeatureTypeConstraint extends FieldConfigFeatureTypeConstraint {
public TestFieldConfigFeatureTypeConstraint(FieldConfigCommonData commonData) {
super(commonData);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigFeatureTypeConstraint field = new TestFieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", false));
FieldConfigFeatureTypeConstraint copy = (FieldConfigFeatureTypeConstraint) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigFeatureTypeConstraint) field.callCreateCopy(field);
assertEquals(field.getFieldId(), copy.getFieldId());
assertTrue(field.getLabel().compareTo(copy.getLabel()) == 0);
assertEquals(field.isValueOnly(), copy.isValueOnly());
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testGenerateExpression.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#generateExpression()}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#populateExpression(java.lang.Object)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.util.List)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#populateField(java.util.List)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#getFeatureTypeConstraint()}.
*/
@Test
public void testGenerateExpression() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
List<FeatureTypeConstraint> testValue = null;
field.populate(null);
field.setTestValue(FieldIdEnum.UNKNOWN, testValue);
field.populateField(testValue);
field.createUI();
assertNull(field.getStringValue());
StyleFactoryImpl styleFactory = (StyleFactoryImpl) CommonFactoryFinder.getStyleFactory();
FeatureTypeConstraint expectedValue1 = styleFactory.createFeatureTypeConstraint("Feature", Filter.INCLUDE, new Extent[0]);
testValue = new ArrayList<FeatureTypeConstraint>();
testValue.add(expectedValue1);
field.populateField(testValue);
assertEquals(expectedValue1, field.getFeatureTypeConstraint().get(0));
field.setTestValue(FieldIdEnum.UNKNOWN, testValue);
assertEquals(expectedValue1, field.getFeatureTypeConstraint().get(0));
field.populateExpression((String) null);
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testAttributeSelection.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#attributeSelection(java.lang.String)}.
*/
@Test
public void testAttributeSelection() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
field.attributeSelection(null);
// Does nothing
}
use of com.sldeditor.ui.detail.config.FieldConfigCommonData in project sldeditor by robward-scisys.
the class FieldConfigFontPreviewTest method testAttributeSelection.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.font.FieldConfigFontPreview#attributeSelection(java.lang.String)}.
*/
@Test
public void testAttributeSelection() {
boolean valueOnly = true;
FieldConfigFontPreview field = new FieldConfigFontPreview(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly));
field.attributeSelection("field");
// Does nothing
}
Aggregations