Search in sources :

Example 1 with UserLayerTreeItem

use of com.sldeditor.ui.tree.item.UserLayerTreeItem in project sldeditor by robward-scisys.

the class UserLayerTreeItemTest method testItemSelected.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.item.UserLayerTreeItem#itemSelected(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)}.
 */
@Test
public void testItemSelected() {
    UserLayerTreeItem item = new UserLayerTreeItem();
    item.itemSelected(null, null);
}
Also used : UserLayerTreeItem(com.sldeditor.ui.tree.item.UserLayerTreeItem) Test(org.junit.Test)

Example 2 with UserLayerTreeItem

use of com.sldeditor.ui.tree.item.UserLayerTreeItem in project sldeditor by robward-scisys.

the class UserLayerTreeItemTest method testGetTreeString.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.item.UserLayerTreeItem#getTreeString(java.lang.Object)}.
 */
@Test
public void testGetTreeString() {
    UserLayerTreeItem item = new UserLayerTreeItem();
    String actualValue = item.getTreeString(null, null);
    String expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.userlayer"), "");
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    UserLayer userLayer = DefaultSymbols.createNewUserLayer();
    actualValue = item.getTreeString(null, userLayer);
    assertTrue(actualValue.compareTo(expectedValue) == 0);
    String expectedName = "test name";
    userLayer.setName(expectedName);
    actualValue = item.getTreeString(null, userLayer);
    expectedValue = String.format("%s : %s", Localisation.getString(SLDTreeTools.class, "TreeItem.userlayer"), expectedName);
    assertTrue(actualValue.compareTo(expectedValue) == 0);
}
Also used : UserLayer(org.geotools.styling.UserLayer) SLDTreeTools(com.sldeditor.ui.tree.SLDTreeTools) UserLayerTreeItem(com.sldeditor.ui.tree.item.UserLayerTreeItem) Test(org.junit.Test)

Aggregations

UserLayerTreeItem (com.sldeditor.ui.tree.item.UserLayerTreeItem)2 Test (org.junit.Test)2 SLDTreeTools (com.sldeditor.ui.tree.SLDTreeTools)1 UserLayer (org.geotools.styling.UserLayer)1