use of com.sldeditor.tool.vector.VectorTool in project sldeditor by robward-scisys.
the class VectorToolTest method testGetToolName.
/**
* Test method for {@link com.sldeditor.tool.vector.VectorTool#getToolName()}.
*/
@Test
public void testGetToolName() {
VectorTool vectorTool = new VectorTool(null);
assertNotNull(vectorTool.getToolName());
}
use of com.sldeditor.tool.vector.VectorTool in project sldeditor by robward-scisys.
the class VectorToolTest method testSupports.
/**
* Test method for {@link com.sldeditor.tool.vector.VectorTool#supports(java.util.List,
* java.util.List, java.util.List)}.
*/
@Test
public void testSupports() {
try {
FileTreeNode vectorTreeNode = new FileTreeNode(new File("/test"), "sld_cookbook_polygon.shp");
vectorTreeNode.setFileCategory(FileTreeNodeTypeEnum.VECTOR);
FileTreeNode rasterTreeNode = new FileTreeNode(new File("/test"), "sld_cookbook_polygon.tif");
rasterTreeNode.setFileCategory(FileTreeNodeTypeEnum.RASTER);
List<Class<?>> uniqueNodeTypeList = new ArrayList<Class<?>>();
List<NodeInterface> nodeTypeList = new ArrayList<NodeInterface>();
List<SLDDataInterface> sldDataList = new ArrayList<SLDDataInterface>();
// Try vector file
nodeTypeList.add(vectorTreeNode);
VectorTool vectorTool = new VectorTool(null);
assertTrue(vectorTool.supports(uniqueNodeTypeList, nodeTypeList, sldDataList));
// Try raster file
nodeTypeList.clear();
nodeTypeList.add(rasterTreeNode);
assertFalse(vectorTool.supports(uniqueNodeTypeList, nodeTypeList, sldDataList));
// Try database feature class
nodeTypeList.clear();
DatabaseFeatureClassNode databaseFeatureClassNode = new DatabaseFeatureClassNode(null, null, "db fc");
nodeTypeList.add(databaseFeatureClassNode);
assertTrue(vectorTool.supports(uniqueNodeTypeList, nodeTypeList, sldDataList));
// Try invalid node class
nodeTypeList.clear();
nodeTypeList.add(new GeoServerStyleHeadingNode(null, null, "test"));
assertFalse(vectorTool.supports(uniqueNodeTypeList, nodeTypeList, sldDataList));
// Try with no nodes
nodeTypeList.clear();
assertFalse(vectorTool.supports(uniqueNodeTypeList, nodeTypeList, sldDataList));
// Try with null
assertFalse(vectorTool.supports(uniqueNodeTypeList, null, sldDataList));
} catch (SecurityException e) {
fail(e.getStackTrace().toString());
} catch (FileNotFoundException e) {
fail(e.getStackTrace().toString());
}
}
use of com.sldeditor.tool.vector.VectorTool in project sldeditor by robward-scisys.
the class VectorToolTest method testGetPanel.
/**
* Test method for {@link com.sldeditor.tool.vector.VectorTool#getPanel()}.
*/
@Test
public void testGetPanel() {
VectorTool vectorTool = new VectorTool(null);
assertNotNull(vectorTool.getPanel());
}
Aggregations