Changeset 7033 in josm for trunk/test/unit/org/openstreetmap/josm/data/osm
- Timestamp:
- 2014-05-01T02:34:43+02:00 (12 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data/osm
- Files:
-
- 2 edited
-
FilterTest.java (modified) (2 diffs)
-
QuadBucketsTest.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r7005 r7033 5 5 6 6 import java.io.FileInputStream; 7 import java.io.FileNotFoundException; 7 import java.io.IOException; 8 import java.io.InputStream; 8 9 import java.util.Arrays; 9 10 import java.util.Collection; … … 63 64 64 65 @Test 65 public void filter_test() throws ParseError, IllegalDataException, FileNotFoundException {66 public void filter_test() throws ParseError, IllegalDataException, IOException { 66 67 for (int i : new int [] {1,2,3, 11,12,13,14, 15}) { 67 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/filterTests.osm"), NullProgressMonitor.INSTANCE); 68 DataSet ds; 69 try (InputStream is = new FileInputStream("data_nodist/filterTests.osm")) { 70 ds = OsmReader.parseDataSet(is, NullProgressMonitor.INSTANCE); 71 } 68 72 69 73 List<Filter> filters = new LinkedList<>(); -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r7005 r7033 3 3 4 4 import java.io.FileInputStream; 5 import java.io.InputStream; 5 6 import java.util.ArrayList; 6 7 import java.util.Collection; … … 66 67 public void testRemove() throws Exception { 67 68 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 68 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE); 69 removeAllTest(ds); 69 try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) { 70 DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 71 removeAllTest(ds); 72 } 70 73 } 71 74 … … 73 76 public void testMove() throws Exception { 74 77 Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator 75 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/restriction.osm"), NullProgressMonitor.INSTANCE); 76 77 for (Node n: ds.getNodes()) { 78 n.setCoor(new LatLon(10, 10)); 78 try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) { 79 DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE); 80 81 for (Node n: ds.getNodes()) { 82 n.setCoor(new LatLon(10, 10)); 83 } 84 85 removeAllTest(ds); 79 86 } 80 81 removeAllTest(ds);82 87 } 83 88 }
Note:
See TracChangeset
for help on using the changeset viewer.
