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