Changeset 8880 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
r8871 r8880 118 118 @Override 119 119 public String toString() { 120 return originalPrimitive.getPrimitiveId() + " at index " + pos + " with role " + role + " in " + relation.getUniqueId() + " => " + decision; 120 return originalPrimitive.getPrimitiveId() + " at index " + pos + " with role " + role + " in " + relation.getUniqueId() 121 + " => " + decision; 121 122 } 122 123 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r8874 r8880 320 320 @Override 321 321 protected boolean matches(Environment env) { 322 for (Map.Entry<String, String> kv: env.osm.getKeys().entrySet()) {322 for (Map.Entry<String, String> kv: env.osm.getKeys().entrySet()) { 323 323 if (keyPattern.matcher(kv.getKey()).find() && pattern.matcher(kv.getValue()).find()) { 324 324 return true; -
trunk/test/unit/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModelTest.java
r8871 r8880 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.gui.conflict.tags; 2 3 3 import static org. hamcrest.CoreMatchers.is;4 import static org.junit.Assert.assertEquals; 4 5 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertThat;6 6 import static org.junit.Assert.assertTrue; 7 7 … … 16 16 import org.openstreetmap.josm.data.osm.DataSet; 17 17 import org.openstreetmap.josm.data.osm.Node; 18 import org.openstreetmap.josm.data.osm.OsmPrimitive;19 18 import org.openstreetmap.josm.data.osm.Relation; 20 19 import org.openstreetmap.josm.data.osm.RelationMember; … … 23 22 public class RelationMemberConflictResolverModelTest { 24 23 24 /** 25 * Setup test. 26 */ 25 27 @BeforeClass 26 28 public static void init() { … … 62 64 model.prepareDefaultRelationDecisions(); 63 65 assertTrue(model.isResolvedCompletely()); 64 assert That(model.getDecision(0).getDecision(), is(RelationMemberConflictDecisionType.KEEP));65 assert That(model.getDecision(0).getOriginalPrimitive(), is((OsmPrimitive) ways.get(0)));66 assert That(model.getDecision(0).getRole(), is("foo"));67 assert That(model.getDecision(1).getDecision(), is(RelationMemberConflictDecisionType.REMOVE));68 assert That(model.getDecision(1).getOriginalPrimitive(), is((OsmPrimitive) ways.get(1)));66 assertEquals(RelationMemberConflictDecisionType.KEEP, model.getDecision(0).getDecision()); 67 assertEquals(ways.get(0), model.getDecision(0).getOriginalPrimitive()); 68 assertEquals("foo", model.getDecision(0).getRole()); 69 assertEquals(RelationMemberConflictDecisionType.REMOVE, model.getDecision(1).getDecision()); 70 assertEquals(ways.get(1), model.getDecision(1).getOriginalPrimitive()); 69 71 } 70 72 … … 109 111 model.prepareDefaultRelationDecisions(); 110 112 assertTrue(model.isResolvedCompletely()); 111 assert That(model.getDecision(0).getDecision(), is(RelationMemberConflictDecisionType.KEEP));112 assert That(model.getDecision(0).getOriginalPrimitive(), is((OsmPrimitive) ways.get(0)));113 assert That(model.getDecision(0).getRole(), is("foo"));114 assert That(model.getDecision(1).getDecision(), is(RelationMemberConflictDecisionType.KEEP));115 assert That(model.getDecision(1).getOriginalPrimitive(), is((OsmPrimitive) ways.get(0)));116 assert That(model.getDecision(1).getRole(), is("bar"));117 assert That(model.getDecision(2).getDecision(), is(RelationMemberConflictDecisionType.REMOVE));118 assert That(model.getDecision(3).getDecision(), is(RelationMemberConflictDecisionType.REMOVE));113 assertEquals(RelationMemberConflictDecisionType.KEEP, model.getDecision(0).getDecision()); 114 assertEquals(ways.get(0), model.getDecision(0).getOriginalPrimitive()); 115 assertEquals("foo", model.getDecision(0).getRole()); 116 assertEquals(RelationMemberConflictDecisionType.KEEP, model.getDecision(1).getDecision()); 117 assertEquals(ways.get(0), model.getDecision(1).getOriginalPrimitive()); 118 assertEquals("bar", model.getDecision(1).getRole()); 119 assertEquals(RelationMemberConflictDecisionType.REMOVE, model.getDecision(2).getDecision()); 120 assertEquals(RelationMemberConflictDecisionType.REMOVE, model.getDecision(3).getDecision()); 119 121 } 120 122 }
Note:
See TracChangeset
for help on using the changeset viewer.