Changeset 11383 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-12-12T17:29:27+01:00 (8 years ago)
Author:
Don-vip
Message:

findbugs - BC_UNCONFIRMED_CAST

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/NodeTest.java

    r11269 r11383  
    8080        assertEquals(box1.getCenter(), new LatLon(15, 15));
    8181    }
     82
     83    /**
     84     * Test that {@link Node#cloneFrom} throws IAE for invalid arguments
     85     */
     86    @Test(expected = IllegalArgumentException.class)
     87    public void testCloneFromIAE() {
     88        new Node().cloneFrom(new Way());
     89    }
     90
     91    /**
     92     * Test that {@link Node#mergeFrom} throws IAE for invalid arguments
     93     */
     94    @Test(expected = IllegalArgumentException.class)
     95    public void testMergeFromIAE() {
     96        new Node().mergeFrom(new Way());
     97    }
     98
     99    /**
     100     * Test that {@link Node#load} throws IAE for invalid arguments
     101     */
     102    @Test(expected = IllegalArgumentException.class)
     103    public void testLoadIAE() {
     104        new Node().load(new WayData());
     105    }
    82106}
  • trunk/test/unit/org/openstreetmap/josm/data/osm/RelationTest.java

    r11269 r11383  
    139139        assertEquals(OsmPrimitiveType.RELATION, r.getDisplayType());
    140140    }
     141
     142    /**
     143     * Test that {@link Relation#cloneFrom} throws IAE for invalid arguments
     144     */
     145    @Test(expected = IllegalArgumentException.class)
     146    public void testCloneFromIAE() {
     147        new Relation().cloneFrom(new Node());
     148    }
     149
     150    /**
     151     * Test that {@link Relation#load} throws IAE for invalid arguments
     152     */
     153    @Test(expected = IllegalArgumentException.class)
     154    public void testLoadIAE() {
     155        new Relation().load(new NodeData());
     156    }
    141157}
  • trunk/test/unit/org/openstreetmap/josm/data/osm/WayTest.java

    r11271 r11383  
    5555        assertEquals(way.getBBox(), new BBox(10, 10));
    5656    }
     57
     58    /**
     59     * Test that {@link Way#cloneFrom} throws IAE for invalid arguments
     60     */
     61    @Test(expected = IllegalArgumentException.class)
     62    public void testCloneFromIAE() {
     63        new Way().cloneFrom(new Node());
     64    }
     65
     66    /**
     67     * Test that {@link Way#load} throws IAE for invalid arguments
     68     */
     69    @Test(expected = IllegalArgumentException.class)
     70    public void testLoadIAE() {
     71        new Way().load(new NodeData());
     72    }
    5773}
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java

    r11071 r11383  
    2323import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    2424import org.openstreetmap.josm.data.gpx.WayPoint;
     25import org.openstreetmap.josm.data.osm.DataSet;
    2526import org.openstreetmap.josm.data.projection.Projections;
    2627import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     
    192193
    193194    /**
     195     * Test that {@link GpxLayer#mergeFrom} throws IAE for invalid arguments
     196     */
     197    @Test(expected = IllegalArgumentException.class)
     198    public void testMergeFromIAE() {
     199        new GpxLayer(new GpxData()).mergeFrom(new OsmDataLayer(new DataSet(), "", null));
     200    }
     201
     202    /**
    194203     * Unit test of {@link GpxLayer#paint}.
    195204     * @throws Exception if any error occurs
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayerTest.java

    r10467 r11383  
    1414import org.openstreetmap.josm.Main;
    1515import org.openstreetmap.josm.TestUtils;
     16import org.openstreetmap.josm.data.osm.DataSet;
    1617import org.openstreetmap.josm.gui.layer.GpxLayer;
     18import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1719import org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer.Loader;
    1820import org.openstreetmap.josm.io.GpxReader;
     
    5759        }
    5860    }
     61
     62    /**
     63     * Test that {@link GeoImageLayer#mergeFrom} throws IAE for invalid arguments
     64     */
     65    @Test(expected = IllegalArgumentException.class)
     66    public void testMergeFromIAE() {
     67        new GeoImageLayer(null, null).mergeFrom(new OsmDataLayer(new DataSet(), "", null));
     68    }
    5969}
Note: See TracChangeset for help on using the changeset viewer.