Changeset 10547 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-07-17T13:07:14+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #13159 - Move image processors out of imagery layer (patch by michael2402) - gsoc-core + fix checkstyle violations

Location:
trunk/test/unit/org/openstreetmap/josm/gui/layer
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/ImageryLayerTest.java

    r10300 r10547  
    22package org.openstreetmap.josm.gui.layer;
    33
    4 import static org.junit.Assert.assertEquals;
     4import static org.junit.Assert.assertNotNull;
     5import static org.junit.Assert.assertSame;
    56
    6 import org.junit.BeforeClass;
     7import org.junit.Rule;
    78import org.junit.Test;
    8 import org.openstreetmap.josm.JOSMFixture;
     9import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings;
     10import org.openstreetmap.josm.testutils.JOSMTestRules;
     11
     12import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    913
    1014/**
     
    1418
    1519    /**
    16      * Setup tests
     20     * For creating layers
    1721     */
    18     @BeforeClass
    19     public static void setUpBeforeClass() {
    20         JOSMFixture.createUnitTestFixture().init(true);
    21     }
     22    @Rule
     23    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
     24    public JOSMTestRules test = new JOSMTestRules().preferences();
    2225
    2326    /**
    24      * Unit test of {@link ImageryLayer.ColorfulImageProcessor#toString}
    25      *          and {@link ImageryLayer.GammaImageProcessor#toString()}.
    26      *          and {@link ImageryLayer.SharpenImageProcessor#toString()}.
     27     * Unit test of {@link ImageryLayer#getFilterSettings()}
    2728     */
    2829    @Test
    29     public void testToString() {
     30    public void testHasSettings() {
    3031        ImageryLayer layer = TMSLayerTest.createTmsLayer();
    31         assertEquals("ColorfulImageProcessor [colorfulness=1.0]", layer.collorfulnessImageProcessor.toString());
    32         assertEquals("GammaImageProcessor [gamma=1.0]", layer.gammaImageProcessor.toString());
    33         assertEquals("SharpenImageProcessor [sharpenLevel=1.0]", layer.sharpenImageProcessor.toString());
     32        ImageryFilterSettings settings = layer.getFilterSettings();
     33        assertNotNull(settings);
     34        assertSame(settings, layer.getFilterSettings());
    3435    }
    3536}
Note: See TracChangeset for help on using the changeset viewer.