use of com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testGetBasePanel.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#getBasePanel()}.
*/
@Test
public void testGetBasePanel() {
boolean valueOnly = true;
FieldConfigFilename field = new FieldConfigFilename(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertNull(field.getBasePanel());
}
use of com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testGetVendorOption.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#getVendorOption()}.
*/
@Test
public void testGetVendorOption() {
boolean valueOnly = true;
FieldConfigFilename field = new FieldConfigFilename(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(VendorOptionManager.getInstance().getDefaultVendorOptionVersion(), field.getVendorOption());
}
use of com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testGenerateExpression.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#generateExpression()}.
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#populateExpression(java.lang.Object, org.opengis.filter.expression.Expression)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#populateField(java.lang.String)}.
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#setTestValue(com.sldeditor.ui.detail.config.FieldId, java.lang.String)}.
*/
@Test
public void testGenerateExpression() {
boolean valueOnly = true;
FieldConfigFilename field = new FieldConfigFilename(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);
assertEquals(expectedValue, field.getStringValue());
File f = null;
try {
f = File.createTempFile(getClass().getSimpleName(), ".tmp");
} catch (IOException e) {
e.printStackTrace();
}
try {
if ((f != null) && (f.toURI() != null)) {
if (f.toURI().toURL() != null) {
expectedValue = f.toURI().toURL().toString();
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
}
field.setTestValue(null, expectedValue);
field.populateExpression(expectedValue);
assertTrue(expectedValue.compareTo(field.getStringValue()) == 0);
f.delete();
}
use of com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testAccept.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#accept(org.opengis.style.GraphicalSymbol)}.
*/
@Test
public void testAccept() {
boolean valueOnly = true;
FieldConfigFilename field = new FieldConfigFilename(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");
assertTrue(field.accept(externalGraphic));
Mark marker = styleBuilder.createMark("triangle");
assertFalse(field.accept(marker));
}
use of com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename in project sldeditor by robward-scisys.
the class FieldConfigFilenameTest method testGetSymbolClass.
/**
* Test method for
* {@link com.sldeditor.ui.detail.config.symboltype.externalgraphic.FieldConfigFilename#getSymbolClass()}.
*/
@Test
public void testGetSymbolClass() {
boolean valueOnly = true;
FieldConfigFilename field = new FieldConfigFilename(new FieldConfigCommonData(String.class, FieldIdEnum.NAME, "test label", valueOnly), null, null, null);
assertEquals(ExternalGraphicImpl.class, field.getSymbolClass());
}
Aggregations