Changeset 11115 in josm for trunk/test/unit/org
- Timestamp:
- 2016-10-11T19:05:20+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/osm
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/ChangesetCacheTest.java
r11105 r11115 7 7 import static org.junit.Assert.assertTrue; 8 8 9 import java.util.ArrayList; 10 import java.util.Collections; 9 11 import java.util.List; 10 12 13 import org.junit.Assert; 11 14 import org.junit.Test; 12 15 import org.openstreetmap.josm.TestUtils; … … 180 183 cache.removeChangesetCacheListener(listener); 181 184 } 185 186 /** 187 * Unit test of method {@link ChangesetCache#getOpenChangesets}. 188 */ 189 @Test 190 public void testGetOpenChangesets() { 191 final ChangesetCache cache = ChangesetCache.getInstance(); 192 // empty cache => empty list 193 Assert.assertTrue( 194 "Empty cache should produce an empty list.", 195 cache.getOpenChangesets().isEmpty() 196 ); 197 198 // cache with only closed changesets => empty list 199 Changeset closedCs = new Changeset(1); 200 closedCs.setOpen(false); 201 cache.update(closedCs); 202 Assert.assertTrue( 203 "Cache with only closed changesets should produce an empty list.", 204 cache.getOpenChangesets().isEmpty() 205 ); 206 207 // cache with open and closed changesets => list with only the open ones 208 Changeset openCs = new Changeset(2); 209 openCs.setOpen(true); 210 cache.update(openCs); 211 Assert.assertEquals( 212 Collections.singletonList(openCs), 213 cache.getOpenChangesets() 214 ); 215 } 182 216 }
Note:
See TracChangeset
for help on using the changeset viewer.