use of com.sldeditor.ui.tree.item.NameLayerTreeItem in project sldeditor by robward-scisys.
the class NameLayerTreeItemTest method testItemSelected.
/**
* Test method for
* {@link com.sldeditor.ui.tree.item.NameLayerTreeItem#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)}.
*/
@Test
public void testItemSelected() {
NameLayerTreeItem item = new NameLayerTreeItem();
item.itemSelected(null, null);
}
use of com.sldeditor.ui.tree.item.NameLayerTreeItem in project sldeditor by robward-scisys.
the class NameLayerTreeItemTest method testGetTreeString.
/**
* Test method for
* {@link com.sldeditor.ui.tree.item.NameLayerTreeItem#getTreeString(java.lang.Object)}.
*/
@Test
public void testGetTreeString() {
NameLayerTreeItem item = new NameLayerTreeItem();
String actualValue = item.getTreeString(null, null);
String expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.namedlayer"), "");
assertTrue(actualValue.compareTo(expectedValue) == 0);
NamedLayer namedLayer = DefaultSymbols.createNewNamedLayer();
actualValue = item.getTreeString(null, namedLayer);
assertTrue(actualValue.compareTo(expectedValue) == 0);
String expectedName = "test name";
namedLayer.setName(expectedName);
actualValue = item.getTreeString(null, namedLayer);
expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.namedlayer"), expectedName);
assertTrue(actualValue.compareTo(expectedValue) == 0);
}
Aggregations