use of com.sldeditor.ui.tree.item.StrokeTreeItem in project sldeditor by robward-scisys.
the class StrokeTreeItemTest method testGetTreeString.
/**
* Test method for {@link com.sldeditor.ui.tree.item.StrokeTreeItem#getTreeString(java.lang.Object)}.
*/
@Test
public void testGetTreeString() {
StrokeTreeItem item = new StrokeTreeItem();
String actualValue = item.getTreeString(null, null);
String expectedValue = Localisation.getString(SLDTreeTools.class, "TreeItem.stroke");
assertTrue(actualValue.compareTo(expectedValue) == 0);
Stroke stroke = DefaultSymbols.createDefaultStroke();
actualValue = item.getTreeString(null, stroke);
assertTrue(actualValue.compareTo(expectedValue) == 0);
actualValue = item.getTreeString(null, stroke);
assertTrue(actualValue.compareTo(expectedValue) == 0);
}
use of com.sldeditor.ui.tree.item.StrokeTreeItem in project sldeditor by robward-scisys.
the class StrokeTreeItemTest method testItemSelected.
/**
* Test method for {@link com.sldeditor.ui.tree.item.StrokeTreeItem#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)}.
*/
@Test
public void testItemSelected() {
StrokeTreeItem item = new StrokeTreeItem();
item.itemSelected(null, null);
Symbolizer symbolizer = DefaultSymbols.createDefaultLineSymbolizer();
DefaultMutableTreeNode parentNode = new DefaultMutableTreeNode();
parentNode.setUserObject(symbolizer);
DefaultMutableTreeNode node = new DefaultMutableTreeNode();
parentNode.add(node);
item.itemSelected(node, symbolizer);
// Get the code coverage stats up
item.itemSelected(parentNode, symbolizer);
parentNode.setUserObject(item);
item.itemSelected(node, null);
}
Aggregations