Changeset 13413 in josm for trunk


Ignore:
Timestamp:
2018-02-11T22:32:26+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15887 - add unit test

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

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r13300 r13413  
    260260
    261261    /**
     262     * Creates a new node with the given tags (see {@link OsmUtils#createPrimitive(java.lang.String)})
     263     *
     264     * @param tags  the tags to set
     265     * @return a new node
     266     */
     267    public static Node newNode(String tags) {
     268        return (Node) OsmUtils.createPrimitive("node " + tags);
     269    }
     270
     271    /**
    262272     * Creates a new way with the given tags (see {@link OsmUtils#createPrimitive(java.lang.String)}) and the nodes added
    263273     *
  • trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java

    r12663 r13413  
    153153                DefaultNameFormatter.getInstance().formatAsHtmlUnorderedList(nodes, 5));
    154154    }
     155
     156    /**
     157     * Test of {@link DefaultNameFormatter#buildDefaultToolTip(IPrimitive)}.
     158     */
     159    @Test
     160    public void testBuildDefaultToolTip() {
     161        assertEquals("<html><strong>id</strong>=0<br>"+
     162                           "<strong>name:en</strong>=foo<br>"+
     163                           "<strong>tourism</strong>=hotel<br>"+
     164                           "<strong>url</strong>=http://foo.bar<br>"+
     165                           "<strong>xml</strong>=&lt;tag/&gt;</html>",
     166                DefaultNameFormatter.getInstance().buildDefaultToolTip(
     167                        TestUtils.newNode("tourism=hotel name:en=foo url=http://foo.bar xml=<tag/>")));
     168    }
    155169}
Note: See TracChangeset for help on using the changeset viewer.