Search in sources :

Example 1 with HaloImpl

use of org.geotools.styling.HaloImpl in project sldeditor by robward-scisys.

the class SLDTreeItemWrapperTest method testSLDTreeItemWrapper.

/**
 * Test method for
 * {@link com.sldeditor.ui.tree.SLDTreeItemWrapper#SLDTreeItemWrapper(java.lang.Object)}.
 */
@Test
public void testSLDTreeItemWrapper() {
    // Try with null objects first
    String testObj1 = SLDTreeItemWrapper.generateKey(null);
    String testObj2 = SLDTreeItemWrapper.generateKey(null);
    assertTrue(testObj1.equals(testObj1));
    assertTrue(testObj1.equals(testObj2));
    // Try with 2 different text symbolizers instances but the same contents, hash codes should
    // be different
    String testObj3 = SLDTreeItemWrapper.generateKey(DefaultSymbols.createDefaultTextSymbolizer());
    String testObj4 = SLDTreeItemWrapper.generateKey(DefaultSymbols.createDefaultTextSymbolizer());
    assertTrue(testObj3.equals(testObj3));
    assertFalse(testObj3.equals(testObj4));
    // Try with one text symbolizer instances the same contents, hash codes should be the same
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    textSymbolizer.setHalo(new HaloImpl());
    String testObj5 = SLDTreeItemWrapper.generateKey(textSymbolizer);
    String testObj6 = SLDTreeItemWrapper.generateKey(textSymbolizer);
    assertTrue(testObj5.equals(testObj5));
    assertTrue(testObj5.equals(testObj6));
}
Also used : TextSymbolizer(org.geotools.styling.TextSymbolizer) HaloImpl(org.geotools.styling.HaloImpl) Test(org.junit.Test)

Aggregations

HaloImpl (org.geotools.styling.HaloImpl)1 TextSymbolizer (org.geotools.styling.TextSymbolizer)1 Test (org.junit.Test)1