Changeset 7005 in josm for trunk/test
- Timestamp:
- 2014-04-26T17:39:23+02:00 (11 years ago)
- Location:
- trunk/test
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r6995 r7005 55 55 int numRelations = 1000; 56 56 57 ArrayList<Node> nodes = new ArrayList< Node>();58 ArrayList<Way> ways = new ArrayList< Way>();57 ArrayList<Node> nodes = new ArrayList<>(); 58 ArrayList<Way> ways = new ArrayList<>(); 59 59 60 60 // create a set of nodes … … 122 122 static public void createDataSetOnServer(DataSet ds) throws OsmTransferException { 123 123 logger.info("creating data set on the server ..."); 124 ArrayList<OsmPrimitive> primitives = new ArrayList< OsmPrimitive>();124 ArrayList<OsmPrimitive> primitives = new ArrayList<>(); 125 125 primitives.addAll(testDataSet.getNodes()); 126 126 primitives.addAll(testDataSet.getWays()); … … 246 246 public void testMultiGet10Nodes() throws OsmTransferException { 247 247 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 248 ArrayList<Node> nodes = new ArrayList< Node>(ds.getNodes());248 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); 249 249 for (int i =0; i< 10; i++) { 250 250 reader.append(nodes.get(i)); … … 263 263 public void testMultiGet10Ways() throws OsmTransferException { 264 264 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 265 ArrayList<Way> ways= new ArrayList< Way>(ds.getWays());265 ArrayList<Way> ways= new ArrayList<>(ds.getWays()); 266 266 for (int i =0; i< 10; i++) { 267 267 reader.append(ways.get(i)); … … 281 281 public void testMultiGet10Relations() throws OsmTransferException { 282 282 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 283 ArrayList<Relation> relations= new ArrayList< Relation>(ds.getRelations());283 ArrayList<Relation> relations= new ArrayList<>(ds.getRelations()); 284 284 for (int i =0; i< 10; i++) { 285 285 reader.append(relations.get(i)); … … 299 299 public void testMultiGet800Nodes() throws OsmTransferException { 300 300 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 301 ArrayList<Node> nodes = new ArrayList< Node>(ds.getNodes());301 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); 302 302 for (int i =0; i< 812; i++) { 303 303 reader.append(nodes.get(i)); … … 316 316 public void multiGetWithNonExistingNode() throws OsmTransferException { 317 317 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 318 ArrayList<Node> nodes = new ArrayList< Node>(ds.getNodes());318 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); 319 319 for (int i =0; i< 10; i++) { 320 320 reader.append(nodes.get(i)); -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r6995 r7005 127 127 static public void createDataSetOnServer(DataSet ds) throws OsmTransferException { 128 128 logger.info("creating data set on the server ..."); 129 ArrayList<OsmPrimitive> primitives = new ArrayList< OsmPrimitive>();129 ArrayList<OsmPrimitive> primitives = new ArrayList<>(); 130 130 primitives.addAll(ds.getNodes()); 131 131 primitives.addAll(ds.getWays()); … … 328 328 } 329 329 assertEquals(2, referers.getRelations().size()); // two relations referring to 330 Set<Long> expectedNodeIds = new HashSet< Long>();330 Set<Long> expectedNodeIds = new HashSet<>(); 331 331 for (Way way : referers.getWays()) { 332 332 Way orig = (Way) ds.getPrimitiveById(way); … … 359 359 DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE); 360 360 361 Set<Long> referringRelationsIds = new HashSet< Long>();361 Set<Long> referringRelationsIds = new HashSet<>(); 362 362 r = lookupRelation(referers, 6); 363 363 assertNotNull(r); … … 386 386 // ways are incomplete after reading. 387 387 // 388 Set<Long> expectedWayIds = new HashSet< Long>();388 Set<Long> expectedWayIds = new HashSet<>(); 389 389 for (RelationMember m : lookupRelation(ds, 6).getMembers()) { 390 390 if (m.isWay()) { … … 420 420 421 421 protected Set<Long> getNodeIdsInWay(Way way) { 422 HashSet<Long> ret = new HashSet< Long>();422 HashSet<Long> ret = new HashSet<>(); 423 423 if (way == null)return ret; 424 424 for (Node n: way.getNodes()) { … … 429 429 430 430 protected Set<Long> getNodeIdsInRelation(Relation r) { 431 HashSet<Long> ret = new HashSet< Long>();431 HashSet<Long> ret = new HashSet<>(); 432 432 if (r == null) return ret; 433 433 for (RelationMember m: r.getMembers()) { … … 455 455 DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE); 456 456 457 Set<Long> referringRelationsIds = new HashSet< Long>();457 Set<Long> referringRelationsIds = new HashSet<>(); 458 458 r = lookupRelation(referers, 6); 459 459 assertNotNull(r); … … 482 482 // ways are completely read after reading the relations 483 483 // 484 Set<Long> expectedWayIds = new HashSet< Long>();484 Set<Long> expectedWayIds = new HashSet<>(); 485 485 for (RelationMember m : lookupRelation(ds, 6).getMembers()) { 486 486 if (m.isWay()) { … … 509 509 } 510 510 511 Set<Long> expectedNodeIds = new HashSet< Long>();511 Set<Long> expectedNodeIds = new HashSet<>(); 512 512 for (int i = 6; i < 10; i++) { 513 513 Relation r1 = lookupRelation(ds, i); -
trunk/test/unit/org/openstreetmap/josm/data/osm/FilterTest.java
r6881 r7005 44 44 ds.addPrimitive(n2); 45 45 46 Collection<OsmPrimitive> all = new HashSet< OsmPrimitive>();46 Collection<OsmPrimitive> all = new HashSet<>(); 47 47 all.addAll(Arrays.asList(new OsmPrimitive[] {n1, n2})); 48 48 49 List<Filter> filters = new LinkedList< Filter>();49 List<Filter> filters = new LinkedList<>(); 50 50 Filter f1 = new Filter(); 51 51 f1.text = "fixme"; … … 67 67 DataSet ds = OsmReader.parseDataSet(new FileInputStream("data_nodist/filterTests.osm"), NullProgressMonitor.INSTANCE); 68 68 69 List<Filter> filters = new LinkedList< Filter>();69 List<Filter> filters = new LinkedList<>(); 70 70 switch (i) { 71 71 case 1: { -
trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
r6881 r7005 20 20 21 21 private void compareReferrers(OsmPrimitive actual, OsmPrimitive... expected) { 22 Assert.assertEquals(new HashSet< OsmPrimitive>(Arrays.asList(expected)),23 new HashSet< OsmPrimitive>(actual.getReferrers()));22 Assert.assertEquals(new HashSet<>(Arrays.asList(expected)), 23 new HashSet<>(actual.getReferrers())); 24 24 } 25 25 -
trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
r6881 r7005 27 27 28 28 private void removeAllTest(DataSet ds) { 29 List<Node> allNodes = new ArrayList< Node>(ds.getNodes());30 List<Way> allWays = new ArrayList< Way>(ds.getWays());31 List<Relation> allRelations = new ArrayList< Relation>(ds.getRelations());29 List<Node> allNodes = new ArrayList<>(ds.getNodes()); 30 List<Way> allWays = new ArrayList<>(ds.getWays()); 31 List<Relation> allRelations = new ArrayList<>(ds.getRelations()); 32 32 33 33 QuadBuckets<Node> nodes = Reflection.field("nodes").ofType(new TypeRef<QuadBuckets<Node>>() {}).in(ds).get(); -
trunk/test/unit/org/openstreetmap/josm/data/osm/history/HistoryWayTest.java
r4603 r7005 93 93 way.addNode(1); 94 94 way.addNode(2); 95 ArrayList<Long> ids = new ArrayList< Long>();95 ArrayList<Long> ids = new ArrayList<>(); 96 96 for (long id : way.getNodes()) { 97 97 ids.add(id); … … 102 102 assertEquals(2, (long) ids.get(1)); 103 103 } 104 105 104 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r6995 r7005 33 33 */ 34 34 public static void main(String[] args) { 35 Map<String, Projection> allCodes = new HashMap< String, Projection>();35 Map<String, Projection> allCodes = new HashMap<>(); 36 36 for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) { 37 37 for (String code : pc.allCodes()) { -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
r6995 r7005 58 58 setUp(); 59 59 60 Map<String, Projection> supportedCodesMap = new HashMap< String, Projection>();60 Map<String, Projection> supportedCodesMap = new HashMap<>(); 61 61 for (ProjectionChoice pc : ProjectionPreference.getProjectionChoices()) { 62 62 for (String code : pc.allCodes()) { … … 68 68 } 69 69 70 List<TestData> prevData = new ArrayList< TestData>();70 List<TestData> prevData = new ArrayList<>(); 71 71 if (new File(PROJECTION_DATA_FILE).exists()) { 72 72 prevData = readData(); 73 73 } 74 Map<String,TestData> prevCodesMap = new HashMap< String,TestData>();74 Map<String,TestData> prevCodesMap = new HashMap<>(); 75 75 for (TestData data : prevData) { 76 76 prevCodesMap.put(data.code, data); 77 77 } 78 78 79 Set<String> codesToWrite = new LinkedHashSet< String>();79 Set<String> codesToWrite = new LinkedHashSet<>(); 80 80 for (TestData data : prevData) { 81 81 if (supportedCodesMap.containsKey(data.code)) { … … 116 116 private static List<TestData> readData() throws IOException, FileNotFoundException { 117 117 BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(PROJECTION_DATA_FILE), Utils.UTF_8)); 118 List<TestData> result = new ArrayList< TestData>();118 List<TestData> result = new ArrayList<>(); 119 119 String line; 120 120 while ((line = in.readLine()) != null) { … … 159 159 public void regressionTest() throws IOException, FileNotFoundException { 160 160 List<TestData> allData = readData(); 161 Set<String> dataCodes = new HashSet< String>();161 Set<String> dataCodes = new HashSet<>(); 162 162 for (TestData data : allData) { 163 163 dataCodes.add(data.code); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r6949 r7005 73 73 c.initialize(); 74 74 75 LinkedHashSet<String> assertionErrors = new LinkedHashSet< String>();75 LinkedHashSet<String> assertionErrors = new LinkedHashSet<>(); 76 76 for (final MapCSSTagChecker.TagCheck check : c.checks) { 77 77 System.out.println("Check: "+check); -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
r6920 r7005 144 144 public void testPresetValues() throws Exception { 145 145 final Collection<TaggingPreset> presets = TaggingPresetReader.readFromPreferences(false, false); 146 final Set<Tag> values = new LinkedHashSet< Tag>();146 final Set<Tag> values = new LinkedHashSet<>(); 147 147 for (final TaggingPreset p : presets) { 148 148 for (final TaggingPresetItem i : p.data) { -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/nodes/NodeListMergeModelTest.java
r6471 r7005 19 19 import org.junit.Test; 20 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.data.Preferences;22 21 import org.openstreetmap.josm.data.osm.DatasetFactory; 23 22 import org.openstreetmap.josm.data.osm.Node; … … 705 704 706 705 class MyListener implements PropertyChangeListener { 707 public ArrayList<PropertyChangeEvent> events = new ArrayList< PropertyChangeEvent>();706 public ArrayList<PropertyChangeEvent> events = new ArrayList<>(); 708 707 709 708 public void propertyChange(PropertyChangeEvent evt) { -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/properties/PropertiesMergeModelTest.java
r6881 r7005 59 59 60 60 private void populate(OsmPrimitive my, OsmPrimitive their) { 61 model.populate(new Conflict< OsmPrimitive>(my, their));61 model.populate(new Conflict<>(my, their)); 62 62 } 63 63 -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeItemTest.java
r6471 r7005 9 9 import org.junit.Test; 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.Preferences;12 11 import org.openstreetmap.josm.data.osm.Node; 13 12 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/TagMergeModelTest.java
r6471 r7005 13 13 import org.junit.Test; 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.Preferences;16 15 import org.openstreetmap.josm.data.osm.Node; 17 16 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSorterTest.java
r6471 r7005 10 10 import org.junit.Test; 11 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.data.Preferences;13 12 import org.openstreetmap.josm.data.osm.DataSet; 14 13 import org.openstreetmap.josm.data.osm.Relation; -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculatorTest.java
r6471 r7005 11 11 import org.junit.Test; 12 12 import org.openstreetmap.josm.Main; 13 import org.openstreetmap.josm.data.Preferences;14 13 import org.openstreetmap.josm.data.osm.DataSet; 15 14 import org.openstreetmap.josm.data.osm.Relation; -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/ToolbarPreferencesTest.java
r3175 r7005 31 31 32 32 public List<ActionParameter<?>> getActionParameters() { 33 List<ActionParameter<?>> result = new ArrayList< ActionParameter<?>>();33 List<ActionParameter<?>> result = new ArrayList<>(); 34 34 result.add(new StringActionParameter("param1")); 35 35 result.add(new StringActionParameter("param2")); … … 44 44 45 45 private void checkAction(ActionDefinition a, Object... params) { 46 Map<String, Object> expected = new HashMap< String, Object>();46 Map<String, Object> expected = new HashMap<>(); 47 47 for (int i=0; i<params.length; i+=2) { 48 48 expected.put((String)params[i], params[i+1]); … … 53 53 @Test 54 54 public void test1() { 55 Map<String, Action> actions = new HashMap< String, Action>();55 Map<String, Action> actions = new HashMap<>(); 56 56 actions.put("action", new TestAction()); 57 57 ActionParser parser = new ActionParser(actions);
Note:
See TracChangeset
for help on using the changeset viewer.