Changeset 12750 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2017-09-06T02:14:12+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15229 - see #15182 - fix unit tests

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

Legend:

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

    r11035 r12750  
    4545    @Before
    4646    public void setUp() {
    47         User.clearUserMap();
    4847        my = new DataSet();
    4948        my.setVersion("0.6");
  • trunk/test/unit/org/openstreetmap/josm/data/osm/UserTest.java

    r11911 r12750  
    2929    @Test
    3030    public void testCreateOsmUser() {
    31         try {
    32             User user1 = User.createOsmUser(1, "name1");
    33             assertEquals(1, user1.getId());
    34             assertEquals("name1", user1.getName());
    35             User user2 = User.createOsmUser(1, "name2");
    36             assertSame(user1, user2);
    37             assertEquals(1, user2.getId());
    38             assertEquals("name2", user2.getName());
    39             assertEquals(2, user2.getNames().size());
    40             assertTrue(user2.getNames().contains("name1"));
    41             assertTrue(user2.getNames().contains("name2"));
    42         } finally {
    43             User.clearUserMap();
    44         }
     31        User user1 = User.createOsmUser(1, "name1");
     32        assertEquals(1, user1.getId());
     33        assertEquals("name1", user1.getName());
     34        User user2 = User.createOsmUser(1, "name2");
     35        assertSame(user1, user2);
     36        assertEquals(1, user2.getId());
     37        assertEquals("name2", user2.getName());
     38        assertEquals(2, user2.getNames().size());
     39        assertTrue(user2.getNames().contains("name1"));
     40        assertTrue(user2.getNames().contains("name2"));
    4541    }
    4642}
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r12747 r12750  
    1616import org.openstreetmap.josm.Main;
    1717import org.openstreetmap.josm.data.UserIdentityManager;
     18import org.openstreetmap.josm.data.osm.User;
    1819import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    1920import org.openstreetmap.josm.data.projection.Projections;
     
    267268        // Assume anonymous user
    268269        UserIdentityManager.getInstance().setAnonymous();
     270        User.clearUserMap();
    269271
    270272        // Set up i18n
Note: See TracChangeset for help on using the changeset viewer.