Changeset 9214 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2015-12-29T19:23:48+01:00 (8 years ago)
Author:
Don-vip
Message:

use LatLon.ZERO instead of new LatLon(0, 0)

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

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java

    r8899 r9214  
    3939    private static final class SearchContext {
    4040        final DataSet ds = new DataSet();
    41         final Node n1 = new Node(new LatLon(0, 0));
     41        final Node n1 = new Node(LatLon.ZERO);
    4242        final Node n2 = new Node(new LatLon(5, 5));
    4343        final Way w1 = new Way();
  • trunk/test/unit/org/openstreetmap/josm/data/BoundsTest.java

    r8509 r9214  
    4141        assertTrue(b3.intersects(b2));
    4242
    43         b3.extend(new LatLon(0, 0));
     43        b3.extend(LatLon.ZERO);
    4444        assertEquals(b3, new Bounds(0, 0, 90, -170));
    4545    }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java

    r8857 r9214  
    8181    @Test
    8282    public void nodeSimple_IdenticalNoConflict() {
    83         Node n = new Node(new LatLon(0, 0));
     83        Node n = new Node(LatLon.ZERO);
    8484        n.setOsmId(1, 1);
    8585        n.setModified(false);
     
    8787        my.addPrimitive(n);
    8888
    89         Node n1 = new Node(new LatLon(0, 0));
     89        Node n1 = new Node(LatLon.ZERO);
    9090        n1.setOsmId(1, 1);
    9191        n1.setModified(false);
     
    116116    @Test
    117117    public void nodeSimple_locallyUnmodifiedNoConflict() {
    118         Node n = new Node(new LatLon(0, 0));
     118        Node n = new Node(LatLon.ZERO);
    119119        n.setOsmId(1, 1);
    120120        n.setModified(false);
     
    122122        my.addPrimitive(n);
    123123
    124         Node n1 = new Node(new LatLon(0, 0));
     124        Node n1 = new Node(LatLon.ZERO);
    125125        n1.setOsmId(1, 2);
    126126        n1.setModified(false);
     
    156156    @Test
    157157    public void nodeSimple_TagConflict() {
    158         Node n = new Node(new LatLon(0, 0));
     158        Node n = new Node(LatLon.ZERO);
    159159        n.setOsmId(1, 1);
    160160        n.setModified(true);
     
    163163        my.addPrimitive(n);
    164164
    165         Node n1 = new Node(new LatLon(0, 0));
     165        Node n1 = new Node(LatLon.ZERO);
    166166        n1.setOsmId(1, 2);
    167167        n1.setModified(false);
     
    191191    public void nodeSimple_DeleteConflict() {
    192192        Node n = new Node(1, 1);
    193         n.setCoor(new LatLon(0, 0));
     193        n.setCoor(LatLon.ZERO);
    194194        n.setDeleted(true);
    195195        n.put("key1", "value1");
    196196        my.addPrimitive(n);
    197197
    198         Node n1 = new Node(new LatLon(0, 0));
     198        Node n1 = new Node(LatLon.ZERO);
    199199        n1.setOsmId(1, 2);
    200200        n1.setModified(false);
     
    221221    @Test
    222222    public void nodeSimple_DeleteConflict_2() {
    223         Node n = new Node(new LatLon(0, 0));
     223        Node n = new Node(LatLon.ZERO);
    224224        n.setOsmId(1, 1);
    225225        n.setDeleted(true);
    226226        my.addPrimitive(n);
    227227
    228         Node n1 = new Node(new LatLon(0, 0));
     228        Node n1 = new Node(LatLon.ZERO);
    229229        n1.setOsmId(1, 1);
    230230        their.addPrimitive(n1);
     
    307307
    308308        Node n = new Node();
    309         n.setCoor(new LatLon(0, 0));
     309        n.setCoor(LatLon.ZERO);
    310310        n.put("key1", "value1");
    311311        n.setUser(myUser);
     
    315315
    316316        Node n1 = new Node();
    317         n1.setCoor(new LatLon(0, 0));
     317        n1.setCoor(LatLon.ZERO);
    318318        n1.put("key1", "value1");
    319319        cal.add(Calendar.HOUR, 1);
     
    349349
    350350        Node n1 = new Node();
    351         n1.setCoor(new LatLon(0, 0));
     351        n1.setCoor(LatLon.ZERO);
    352352        n1.setOsmId(1, 1);
    353353        n1.put("key1", "value1");
     
    380380
    381381        Node n1 = new Node();
    382         n1.setCoor(new LatLon(0, 0));
     382        n1.setCoor(LatLon.ZERO);
    383383        n1.setOsmId(1, 1);
    384384        my.addPrimitive(n1);
    385385
    386386        Node n2 = new Node();
    387         n2.setCoor(new LatLon(0, 0));
     387        n2.setCoor(LatLon.ZERO);
    388388        n2.setOsmId(2, 1);
    389389
     
    399399        // -- the source data set
    400400
    401         Node n3 = new Node(new LatLon(0, 0));
     401        Node n3 = new Node(LatLon.ZERO);
    402402        n3.setOsmId(1, 1);
    403403        their.addPrimitive(n3);
     
    452452        // -- my data set
    453453
    454         Node n1 = new Node(new LatLon(0, 0));
     454        Node n1 = new Node(LatLon.ZERO);
    455455        n1.setOsmId(1, 1);
    456456        my.addPrimitive(n1);
     
    468468        // --- their data set
    469469
    470         Node n3 = new Node(new LatLon(0, 0));
     470        Node n3 = new Node(LatLon.ZERO);
    471471        n3.setOsmId(1, 1);
    472472        their.addPrimitive(n3);
     
    522522        // -- the target dataset
    523523
    524         Node n1 = new Node(new LatLon(0, 0));
     524        Node n1 = new Node(LatLon.ZERO);
    525525        n1.setOsmId(1, 1);
    526526        my.addPrimitive(n1);
     
    541541        // -- the source dataset
    542542
    543         Node n3 = new Node(new LatLon(0, 0));
     543        Node n3 = new Node(LatLon.ZERO);
    544544        n3.setOsmId(1, 1);
    545545        their.addPrimitive(n3);
     
    585585    public void waySimple_TheirVersionNotVisibleMyIsModified() {
    586586
    587         Node mn1 = new Node(new LatLon(0, 0));
     587        Node mn1 = new Node(LatLon.ZERO);
    588588        mn1.setOsmId(1, 1);
    589589        my.addPrimitive(mn1);
     
    630630        // -- my data set
    631631
    632         Node n1 = new Node(new LatLon(0, 0));
     632        Node n1 = new Node(LatLon.ZERO);
    633633        n1.setOsmId(1, 1);
    634634        my.addPrimitive(n1);
     
    645645        // -- their data set
    646646
    647         Node n3 = new Node(new LatLon(0, 0));
     647        Node n3 = new Node(LatLon.ZERO);
    648648        n3.setOsmId(1, 1);
    649649        their.addPrimitive(n3);
     
    688688        // -- my data set
    689689
    690         Node n1 = new Node(new LatLon(0, 0));
     690        Node n1 = new Node(LatLon.ZERO);
    691691        my.addPrimitive(n1);
    692692
     
    701701        // -- their data set
    702702
    703         Node n3 = new Node(new LatLon(0, 0));
     703        Node n3 = new Node(LatLon.ZERO);
    704704        their.addPrimitive(n3);
    705705
     
    744744        // -- my dataset
    745745
    746         Node mn1 = new Node(new LatLon(0, 0));
     746        Node mn1 = new Node(LatLon.ZERO);
    747747        mn1.setOsmId(1, 1);
    748748        mn1.setDeleted(true);
    749749        my.addPrimitive(mn1);
    750750
    751         Node tn1 = new Node(new LatLon(0, 0));
     751        Node tn1 = new Node(LatLon.ZERO);
    752752        tn1.setOsmId(1, 1);
    753753        their.addPrimitive(tn1);
     
    797797    public void relationComplex_mergingADeletedNode() {
    798798
    799         Node mn1 = new Node(new LatLon(0, 0));
     799        Node mn1 = new Node(LatLon.ZERO);
    800800        mn1.setOsmId(1, 1);
    801801        mn1.setDeleted(true);
     
    803803
    804804
    805         Node tn1 = new Node(new LatLon(0, 0));
     805        Node tn1 = new Node(LatLon.ZERO);
    806806        tn1.setOsmId(1, 1);
    807807        their.addPrimitive(tn1);
     
    903903        their.addPrimitive(w3);
    904904
    905         Node n4 = new Node(new LatLon(0, 0));
     905        Node n4 = new Node(LatLon.ZERO);
    906906        n4.setOsmId(1, 1);
    907907        my.addPrimitive(n4);
  • trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java

    r8857 r9214  
    4040    public void basic() throws ParseError {
    4141        DataSet ds = new DataSet();
    42         Node n1 = new Node(new LatLon(0, 0));
     42        Node n1 = new Node(LatLon.ZERO);
    4343        n1.put("amenity", "parking");
    44         Node n2 = new Node(new LatLon(0, 0));
     44        Node n2 = new Node(LatLon.ZERO);
    4545        n2.put("fixme", "continue");
    4646        ds.addPrimitive(n1);
  • trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveKeyHandlingTest.java

    r8857 r9214  
    119119    public void hasEqualSemanticAttributes() {
    120120        Node n1 = new Node(1);
    121         n1.setCoor(new LatLon(0, 0));
     121        n1.setCoor(LatLon.ZERO);
    122122        n1.put("key.1", "value.1");
    123123        n1.put("key.2", "value.2");
    124124
    125125        Node n2 = new Node(1);
    126         n2.setCoor(new LatLon(0, 0));
     126        n2.setCoor(LatLon.ZERO);
    127127        n2.put("key.2", "value.2");
    128128        n2.put("key.1", "value.1");
     
    137137    public void hasEqualSemanticAttributes_2() {
    138138        Node n1 = new Node(1);
    139         n1.setCoor(new LatLon(0, 0));
     139        n1.setCoor(LatLon.ZERO);
    140140        n1.put("key.1", "value.1");
    141141        n1.put("key.2", "value.3");
    142142
    143143        Node n2 = new Node(1);
    144         n2.setCoor(new LatLon(0, 0));
     144        n2.setCoor(LatLon.ZERO);
    145145        n2.put("key.1", "value.1");
    146146        n2.put("key.2", "value.4");
  • trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java

    r8857 r9214  
    4040    @Test
    4141    public void simpleReferrersTest() {
    42         Node n1 = new Node(new LatLon(0.0, 0.0));
     42        Node n1 = new Node(LatLon.ZERO);
    4343        Way w1 = new Way();
    4444        w1.addNode(n1);
     
    5050    @Test
    5151    public void addAndRemoveReferrer() {
    52         Node n1 = new Node(new LatLon(0.0, 0.0));
    53         Node n2 = new Node(new LatLon(0.0, 0.0));
     52        Node n1 = new Node(LatLon.ZERO);
     53        Node n2 = new Node(LatLon.ZERO);
    5454        Way w1 = new Way();
    5555        w1.addNode(n1);
     
    6666    @Test
    6767    public void multipleReferrers() {
    68         Node n1 = new Node(new LatLon(0.0, 0.0));
     68        Node n1 = new Node(LatLon.ZERO);
    6969        Way w1 = new Way();
    7070        Way w2 = new Way();
     
    8282    @Test
    8383    public void removeMemberFromRelationReferrerTest() {
    84         Node n1 = new Node(new LatLon(0, 0));
     84        Node n1 = new Node(LatLon.ZERO);
    8585        Relation r1 = new Relation();
    8686        r1.addMember(new RelationMember("", n1));
     
    9494    @Test
    9595    public void setRelationMemberReferrerTest() {
    96         Node n1 = new Node(new LatLon(0, 0));
    97         Node n2 = new Node(new LatLon(0, 0));
     96        Node n1 = new Node(LatLon.ZERO);
     97        Node n2 = new Node(LatLon.ZERO);
    9898        Relation r1 = new Relation();
    9999        Relation r2 = new Relation();
     
    111111    @Test
    112112    public void removePrimitiveReferrerTest() {
    113         Node n1 = new Node(new LatLon(0.0, 0.0));
     113        Node n1 = new Node(LatLon.ZERO);
    114114        Way w1 = new Way();
    115115        w1.addNode(n1);
     
    134134    public void nodeFromMultipleDatasets() {
    135135        // n has two referrers - w1 and w2. But only w1 is returned because it is in the same dataset as n
    136         Node n = new Node(new LatLon(0.0, 0.0));
     136        Node n = new Node(LatLon.ZERO);
    137137
    138138        Way w1 = new Way();
  • trunk/test/unit/org/openstreetmap/josm/data/osm/WaySegmentTest.java

    r8997 r9214  
    2020    public void testForNodePair() throws Exception {
    2121        final DataSet ds = new DataSet();
    22         final Node n1 = new Node(new LatLon(0, 0));
     22        final Node n1 = new Node(LatLon.ZERO);
    2323        final Node n2 = new Node(new LatLon(1, 0));
    2424        final Node n3 = new Node(new LatLon(2, 0));
  • trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryNodeTest.java

    r9203 r9214  
    3939                4L,   // changesetId
    4040                d,    // timestamp
    41                 new LatLon(0, 0)
     41                LatLon.ZERO
    4242                );
    4343    }
  • trunk/test/unit/org/openstreetmap/josm/data/osm/visitor/MergeSourceBuildingVisitorTest.java

    r8857 r9214  
    165165        Relation r1 = new Relation(1, 1);
    166166        Node n20 = new Node(20, 1);
    167         n20.setCoor(new LatLon(0, 0));
     167        n20.setCoor(LatLon.ZERO);
    168168        r1.addMember(new RelationMember("node-20", n20));
    169169        Way w30 = new Way(30, 1);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/HighwaysTest.groovy

    r8941 r9214  
    1818        def ds = new DataSet()
    1919
    20         def n00 = new Node(new LatLon(0, 0))
     20        def n00 = new Node(LatLon.ZERO)
    2121        def n10 = new Node(new LatLon(1, 0))
    2222        def n20 = new Node(new LatLon(2, 0))
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SimilarNamedWaysTest.groovy

    r7938 r9214  
    2323        def ds = new DataSet()
    2424
    25         def n00 = new Node(new LatLon(0, 0))
     25        def n00 = new Node(LatLon.ZERO)
    2626        def n10 = new Node(new LatLon(1, 0))
    2727        def n20 = new Node(new LatLon(2, 0))
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ChildOrParentSelectorTest.groovy

    r8833 r9214  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.gui.mappaint.mapcss
    3 
    4 import org.openstreetmap.josm.data.osm.OsmPrimitiveType
    5 import org.openstreetmap.josm.gui.mappaint.MultiCascade
    6 import org.openstreetmap.josm.io.OsmReader
    73
    84import java.util.logging.Logger
     
    139import org.openstreetmap.josm.data.osm.DataSet
    1410import org.openstreetmap.josm.data.osm.Node
     11import org.openstreetmap.josm.data.osm.OsmPrimitiveType
    1512import org.openstreetmap.josm.data.osm.Relation
    1613import org.openstreetmap.josm.data.osm.RelationMember
    1714import org.openstreetmap.josm.data.osm.Way
    1815import org.openstreetmap.josm.gui.mappaint.Environment
     16import org.openstreetmap.josm.gui.mappaint.MultiCascade
    1917import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector
     18import org.openstreetmap.josm.io.OsmReader
    2019
    2120class ChildOrParentSelectorTest {
     
    4443    def node(id) {
    4544        def n = new Node(id,1)
    46         n.setCoor(new LatLon(0,0))
     45        n.setCoor(LatLon.ZERO)
    4746        ds.addPrimitive(n)
    4847        return n
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy

    r8415 r9214  
    3838    def node(id) {
    3939        def n = new Node(id,1)
    40         n.setCoor(new LatLon(0,0))
     40        n.setCoor(LatLon.ZERO)
    4141        ds.addPrimitive(n)
    4242        return n
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy

    r8874 r9214  
    4040    def node(id) {
    4141        def n = new Node(id,1)
    42         n.setCoor(new LatLon(0,0))
     42        n.setCoor(LatLon.ZERO)
    4343        ds.addPrimitive(n)
    4444        return n
  • trunk/test/unit/org/openstreetmap/josm/io/OsmChangeBuilderTest.groovy

    r8510 r9214  
    4343        // should be OK
    4444        builder.start()
    45         Node n = new Node(new LatLon(0,0))
     45        Node n = new Node(LatLon.ZERO)
    4646        builder.append n
    4747        builder.finish()
     
    7373        def Changeset cs = new Changeset(1)
    7474        OsmChangeBuilder builder = new OsmChangeBuilder(cs)
    75         Node n = new Node(new LatLon(0,0))
     75        Node n = new Node(LatLon.ZERO)
    7676
    7777        builder.start()
     
    105105        OsmChangeBuilder builder = new OsmChangeBuilder(cs)
    106106        Node n = new Node(1)
    107         n.coor = new LatLon(0,0)
     107        n.coor = LatLon.ZERO
    108108        n.incomplete = false
    109109        n.modified = true
     
    139139        OsmChangeBuilder builder = new OsmChangeBuilder(cs)
    140140        Node n = new Node(1)
    141         n.coor = new LatLon(0,0)
     141        n.coor = LatLon.ZERO
    142142        n.incomplete = false
    143143        n.deleted = true
     
    174174        OsmChangeBuilder builder = new OsmChangeBuilder(cs)
    175175        Node n1 = new Node(1)
    176         n1.coor = new LatLon(0,0)
     176        n1.coor = LatLon.ZERO
    177177        n1.incomplete = false
    178178        n1.deleted = true
    179179
    180         Node n2 = new Node(new LatLon(0,0))
     180        Node n2 = new Node(LatLon.ZERO)
    181181
    182182        Node n3 = new Node(2)
    183         n3.coor = new LatLon(0,0)
     183        n3.coor = LatLon.ZERO
    184184        n3.incomplete = false
    185185        n3.modified = true
Note: See TracChangeset for help on using the changeset viewer.