use of com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testUndoAction.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#undoAction(com.sldeditor.common.undo.UndoInterface)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#redoAction(com.sldeditor.common.undo.UndoInterface)}.
*/
@Test
public void testUndoAction() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
field.undoAction(null);
field.redoAction(null);
field.createUI();
StyleFactoryImpl styleFactory = (StyleFactoryImpl) CommonFactoryFinder.getStyleFactory();
FeatureTypeConstraint expectedValue1 = styleFactory.createFeatureTypeConstraint("Feature", Filter.INCLUDE, new Extent[0]);
List<FeatureTypeConstraint> testValue = new ArrayList<FeatureTypeConstraint>();
testValue.add(expectedValue1);
field.populateField(testValue);
assertEquals(expectedValue1, field.getFeatureTypeConstraint().get(0));
FeatureTypeConstraint expectedValue2 = styleFactory.createFeatureTypeConstraint("Feature2", Filter.INCLUDE, new Extent[0]);
List<FeatureTypeConstraint> testValue2 = new ArrayList<FeatureTypeConstraint>();
testValue2.add(expectedValue1);
testValue2.add(expectedValue2);
field.populateField(testValue2);
UndoManager.getInstance().undo();
assertEquals(1, field.getFeatureTypeConstraint().size());
assertEquals(expectedValue1, field.getFeatureTypeConstraint().get(0));
UndoManager.getInstance().redo();
assertEquals(2, field.getFeatureTypeConstraint().size());
assertEquals(expectedValue2, field.getFeatureTypeConstraint().get(1));
// Increase the code coverage
field.undoAction(null);
field.undoAction(new UndoEvent(null, FieldIdEnum.NAME, "", "new"));
field.redoAction(null);
field.redoAction(new UndoEvent(null, FieldIdEnum.NAME, "", "new"));
}
use of com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testSetEnabled.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#internal_setEnabled(boolean)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#isEnabled()}.
*/
@Test
public void testSetEnabled() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
// Field will not have been created
boolean expectedValue = true;
field.internal_setEnabled(expectedValue);
assertFalse(field.isEnabled());
// Create text field
field.createUI();
field.createUI();
assertEquals(expectedValue, field.isEnabled());
expectedValue = false;
field.internal_setEnabled(expectedValue);
assertEquals(expectedValue, field.isEnabled());
}
use of com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testSetVisible.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#setVisible(boolean)}.
*/
@Test
public void testSetVisible() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
boolean expectedValue = true;
field.setVisible(expectedValue);
field.createUI();
field.setVisible(expectedValue);
expectedValue = false;
field.setVisible(expectedValue);
}
use of com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testFeatureTypeConstraintUpdated.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#featureTypeConstraintUpdated()}.
*/
@Test
public void testFeatureTypeConstraintUpdated() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
field.featureTypeConstraintUpdated();
// No testing
}
use of com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint in project sldeditor by robward-scisys.
the class FieldConfigFeatureTypeConstraintTest method testExtentUpdated.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.featuretypeconstraint.FieldConfigFeatureTypeConstraint#extentUpdated()}.
*/
@Test
public void testExtentUpdated() {
FieldConfigFeatureTypeConstraint field = new FieldConfigFeatureTypeConstraint(new FieldConfigCommonData(Geometry.class, FieldIdEnum.NAME, "label", true));
field.extentUpdated();
field.createUI();
field.extentUpdated();
// No testing
}
Aggregations