use of com.sldeditor.ui.detail.config.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigFilename extends FieldConfigFilename {
public TestFieldConfigFilename(FieldConfigCommonData commonData) {
super(commonData, null, null, null);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigFilename field = new TestFieldConfigFilename(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly));
FieldConfigFilename copy = (FieldConfigFilename) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigFilename) 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.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigTTFTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigTTF extends FieldConfigTTF {
public TestFieldConfigTTF(FieldConfigCommonData commonData) {
super(commonData, null, null, null);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigTTF field = new TestFieldConfigTTF(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly));
FieldConfigTTF copy = (FieldConfigTTF) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigTTF) 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.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigTransformationTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.transform.FieldConfigTransformation#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigTransformation extends FieldConfigTransformation {
public TestFieldConfigTransformation(FieldConfigCommonData commonData, String editButtonText, String clearButtonText) {
super(commonData, editButtonText, clearButtonText);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigTransformation field = new TestFieldConfigTransformation(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), "edit", "clear");
FieldConfigTransformation copy = (FieldConfigTransformation) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigTransformation) 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.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigArrowTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.vendor.geoserver.marker.arrow.FieldConfigArrow#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigArrow extends FieldConfigArrow {
public TestFieldConfigArrow(FieldConfigCommonData commonData) {
super(commonData, null, null, null);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigArrow field = new TestFieldConfigArrow(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly));
FieldConfigArrow copy = (FieldConfigArrow) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigArrow) 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.FieldConfigBase in project sldeditor by robward-scisys.
the class FieldConfigDoubleTest method testCreateCopy.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.FieldConfigDouble#createCopy(com.sldeditor.ui.detail.config.FieldConfigBase)}.
*/
@Test
public void testCreateCopy() {
boolean valueOnly = true;
class TestFieldConfigDouble extends FieldConfigDouble {
public TestFieldConfigDouble(FieldConfigCommonData commonData) {
super(commonData);
}
public FieldConfigPopulate callCreateCopy(FieldConfigBase fieldConfigBase) {
return createCopy(fieldConfigBase);
}
}
TestFieldConfigDouble field = new TestFieldConfigDouble(new FieldConfigCommonData(Double.class, FieldIdEnum.NAME, "label", valueOnly));
FieldConfigDouble copy = (FieldConfigDouble) field.callCreateCopy(null);
assertNull(copy);
copy = (FieldConfigDouble) field.callCreateCopy(field);
assertEquals(field.getFieldId(), copy.getFieldId());
assertTrue(field.getLabel().compareTo(copy.getLabel()) == 0);
assertEquals(field.isValueOnly(), copy.isValueOnly());
}
Aggregations