Changeset 13813 in josm for trunk/test


Ignore:
Timestamp:
2018-05-21T23:28:25+02:00 (7 years ago)
Author:
Don-vip
Message:

make sure unit test is stable

File:
1 edited

Legend:

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

    r12812 r13813  
    150150    @Test
    151151    public void testHasEqualSemanticAttributes() {
     152        Date today = new Date();
    152153        Changeset cs1 = new Changeset();
    153154        Changeset cs2 = new Changeset();
     
    156157        // Closed At
    157158        cs1.setClosedAt(null);
    158         cs2.setClosedAt(new Date());
     159        cs2.setClosedAt(today);
    159160        assertFalse(cs1.hasEqualSemanticAttributes(cs2));
    160161        cs1.setClosedAt(yesterday());
    161         cs2.setClosedAt(new Date());
    162         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
    163         cs1.setClosedAt(new Date());
    164         cs2.setClosedAt(new Date());
     162        cs2.setClosedAt(today);
     163        assertFalse(cs1.hasEqualSemanticAttributes(cs2));
     164        cs1.setClosedAt(today);
     165        cs2.setClosedAt(today);
    165166        assertTrue(cs1.hasEqualSemanticAttributes(cs2));
    166167        // Created At
    167168        cs1.setCreatedAt(null);
    168         cs2.setCreatedAt(new Date());
     169        cs2.setCreatedAt(today);
    169170        assertFalse(cs1.hasEqualSemanticAttributes(cs2));
    170171        cs1.setCreatedAt(yesterday());
    171         cs2.setCreatedAt(new Date());
    172         assertFalse(cs1.hasEqualSemanticAttributes(cs2));
    173         cs1.setCreatedAt(new Date());
    174         cs2.setCreatedAt(new Date());
     172        cs2.setCreatedAt(today);
     173        assertFalse(cs1.hasEqualSemanticAttributes(cs2));
     174        cs1.setCreatedAt(today);
     175        cs2.setCreatedAt(today);
    175176        assertTrue(cs1.hasEqualSemanticAttributes(cs2));
    176177        // Id
Note: See TracChangeset for help on using the changeset viewer.