Changeset 7005 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2014-04-26T17:39:23+02:00 (11 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
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.