Changeset 10837 in josm for trunk/test/unit
- Timestamp:
- 2016-08-18T03:39:22+02:00 (8 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionTest.java
r10674 r10837 13 13 import org.openstreetmap.josm.gui.mappaint.Environment; 14 14 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context; 15 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Op;16 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.SimpleKeyValueCondition;17 15 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.ToTagConvertable; 16 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op; 17 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.SimpleKeyValueCondition; 18 18 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 19 … … 54 54 @Test 55 55 public void testKeyValueEq() { 56 Condition op = Condition .createKeyValueCondition("k1", "v1", Op.EQ, Context.PRIMITIVE, false);56 Condition op = ConditionFactory.createKeyValueCondition("k1", "v1", Op.EQ, Context.PRIMITIVE, false); 57 57 assertFalse(op.applies(genEnv(node0))); 58 58 assertTrue(op.applies(genEnv(node1))); … … 72 72 @Test 73 73 public void testKeyValueEqAsKey() { 74 Condition op = Condition .createKeyValueCondition("k1", "k2", Op.EQ, Context.PRIMITIVE, true);74 Condition op = ConditionFactory.createKeyValueCondition("k1", "k2", Op.EQ, Context.PRIMITIVE, true); 75 75 assertFalse(op.applies(genEnv(node0))); 76 76 assertTrue(op.applies(genEnv(node1))); … … 88 88 @Test 89 89 public void testKeyValueNeq() { 90 Condition op = Condition .createKeyValueCondition("k1", "v1", Op.NEQ, Context.PRIMITIVE, false);90 Condition op = ConditionFactory.createKeyValueCondition("k1", "v1", Op.NEQ, Context.PRIMITIVE, false); 91 91 assertTrue(op.applies(genEnv(node0))); 92 92 assertFalse(op.applies(genEnv(node1))); … … 101 101 @Test 102 102 public void testKeyValueGreatherEq() { 103 Condition op = Condition .createKeyValueCondition("f1", "0.2", Op.GREATER_OR_EQUAL, Context.PRIMITIVE, false);103 Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.GREATER_OR_EQUAL, Context.PRIMITIVE, false); 104 104 assertFalse(op.applies(genEnv(node0))); 105 105 assertTrue(op.applies(genEnv(node1))); … … 114 114 @Test 115 115 public void testKeyValueGreather() { 116 Condition op = Condition .createKeyValueCondition("f1", "0.2", Op.GREATER, Context.PRIMITIVE, false);116 Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.GREATER, Context.PRIMITIVE, false); 117 117 assertFalse(op.applies(genEnv(node0))); 118 118 assertFalse(op.applies(genEnv(node1))); … … 127 127 @Test 128 128 public void testKeyValueLessEq() { 129 Condition op = Condition .createKeyValueCondition("f1", "0.2", Op.LESS_OR_EQUAL, Context.PRIMITIVE, false);129 Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.LESS_OR_EQUAL, Context.PRIMITIVE, false); 130 130 assertFalse(op.applies(genEnv(node0))); 131 131 assertTrue(op.applies(genEnv(node1))); … … 140 140 @Test 141 141 public void testKeyValueLess() { 142 Condition op = Condition .createKeyValueCondition("f1", "0.2", Op.LESS, Context.PRIMITIVE, false);142 Condition op = ConditionFactory.createKeyValueCondition("f1", "0.2", Op.LESS, Context.PRIMITIVE, false); 143 143 assertFalse(op.applies(genEnv(node0))); 144 144 assertFalse(op.applies(genEnv(node1))); … … 153 153 @Test 154 154 public void testKeyValueRegex() { 155 Condition op = Condition .createKeyValueCondition("r1", "(ab){2}", Op.REGEX, Context.PRIMITIVE, false);155 Condition op = ConditionFactory.createKeyValueCondition("r1", "(ab){2}", Op.REGEX, Context.PRIMITIVE, false); 156 156 assertFalse(op.applies(genEnv(node0))); 157 157 assertTrue(op.applies(genEnv(node1))); … … 166 166 @Test 167 167 public void testKeyValueNregex() { 168 Condition op = Condition .createKeyValueCondition("r1", "(ab){2}", Op.NREGEX, Context.PRIMITIVE, false);168 Condition op = ConditionFactory.createKeyValueCondition("r1", "(ab){2}", Op.NREGEX, Context.PRIMITIVE, false); 169 169 assertTrue(op.applies(genEnv(node0))); 170 170 assertFalse(op.applies(genEnv(node1))); … … 179 179 @Test 180 180 public void testKeyValueOneOf() { 181 Condition op = Condition .createKeyValueCondition("one", "a", Op.ONE_OF, Context.PRIMITIVE, false);181 Condition op = ConditionFactory.createKeyValueCondition("one", "a", Op.ONE_OF, Context.PRIMITIVE, false); 182 182 assertFalse(op.applies(genEnv(node0))); 183 183 assertTrue(op.applies(genEnv(node1))); … … 192 192 @Test 193 193 public void testKeyValueBeginsWith() { 194 Condition op = Condition .createKeyValueCondition("c1", "xy", Op.BEGINS_WITH, Context.PRIMITIVE, false);194 Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.BEGINS_WITH, Context.PRIMITIVE, false); 195 195 assertFalse(op.applies(genEnv(node0))); 196 196 assertTrue(op.applies(genEnv(node1))); … … 205 205 @Test 206 206 public void testKeyValueEndsWith() { 207 Condition op = Condition .createKeyValueCondition("c1", "xy", Op.ENDS_WITH, Context.PRIMITIVE, false);207 Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.ENDS_WITH, Context.PRIMITIVE, false); 208 208 assertFalse(op.applies(genEnv(node0))); 209 209 assertFalse(op.applies(genEnv(node1))); … … 218 218 @Test 219 219 public void testKeyValueContains() { 220 Condition op = Condition .createKeyValueCondition("c1", "xy", Op.CONTAINS, Context.PRIMITIVE, false);221 assertFalse(op.applies(genEnv(node0))); 222 assertTrue(op.applies(genEnv(node1))); 223 assertTrue(op.applies(genEnv(node2))); 224 assertTrue(op.applies(genEnv(node3))); 225 assertTrue(op.applies(genEnv(node4))); 226 } 227 228 /** 229 * Test of {@link Condition #createRegexpKeyRegexpValueCondition(String, String, Op)}220 Condition op = ConditionFactory.createKeyValueCondition("c1", "xy", Op.CONTAINS, Context.PRIMITIVE, false); 221 assertFalse(op.applies(genEnv(node0))); 222 assertTrue(op.applies(genEnv(node1))); 223 assertTrue(op.applies(genEnv(node2))); 224 assertTrue(op.applies(genEnv(node3))); 225 assertTrue(op.applies(genEnv(node4))); 226 } 227 228 /** 229 * Test of {@link ConditionFactory#createRegexpKeyRegexpValueCondition(String, String, Op)} 230 230 */ 231 231 @Test 232 232 public void testRegexpKeyValueRegexpCondition() { 233 Condition op = Condition .createRegexpKeyRegexpValueCondition("^k", "\\da", Op.REGEX);234 assertFalse(op.applies(genEnv(node0))); 235 assertFalse(op.applies(genEnv(node1))); 236 assertTrue(op.applies(genEnv(node2))); 237 assertFalse(op.applies(genEnv(node3))); 238 assertTrue(op.applies(genEnv(node4))); 239 240 Condition notOp = Condition .createRegexpKeyRegexpValueCondition("^k", "\\da", Op.NREGEX);233 Condition op = ConditionFactory.createRegexpKeyRegexpValueCondition("^k", "\\da", Op.REGEX); 234 assertFalse(op.applies(genEnv(node0))); 235 assertFalse(op.applies(genEnv(node1))); 236 assertTrue(op.applies(genEnv(node2))); 237 assertFalse(op.applies(genEnv(node3))); 238 assertTrue(op.applies(genEnv(node4))); 239 240 Condition notOp = ConditionFactory.createRegexpKeyRegexpValueCondition("^k", "\\da", Op.NREGEX); 241 241 assertTrue(notOp.applies(genEnv(node0))); 242 242 assertTrue(notOp.applies(genEnv(node1))); -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy
r9214 r10837 13 13 import org.openstreetmap.josm.gui.mappaint.Environment 14 14 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context 15 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyMatchType 15 16 16 17 class KeyConditionTest { … … 47 48 48 49 // ["a label"] 49 Condition c = Condition .createKeyCondition("a key", false, Condition.KeyMatchType.FALSE, Context.PRIMITIVE)50 Condition c = ConditionFactory.createKeyCondition("a key", false, KeyMatchType.FALSE, Context.PRIMITIVE) 50 51 // ["a label"?] 51 c = Condition .createKeyCondition("a key", false, Condition.KeyMatchType.TRUE, Context.PRIMITIVE)52 c = ConditionFactory.createKeyCondition("a key", false, KeyMatchType.TRUE, Context.PRIMITIVE) 52 53 // [!"a label"] 53 c = Condition .createKeyCondition("a key", true, Condition.KeyMatchType.FALSE, Context.PRIMITIVE)54 c = ConditionFactory.createKeyCondition("a key", true, KeyMatchType.FALSE, Context.PRIMITIVE) 54 55 // [!"a label"?] 55 c = Condition .createKeyCondition("a key", true, Condition.KeyMatchType.TRUE, Context.PRIMITIVE)56 c = ConditionFactory.createKeyCondition("a key", true, KeyMatchType.TRUE, Context.PRIMITIVE) 56 57 57 58 // ["a label"] 58 c = Condition .createKeyCondition("a key", false, null, Context.LINK)59 c = ConditionFactory.createKeyCondition("a key", false, null, Context.LINK) 59 60 // [!"a label"] 60 c = Condition .createKeyCondition("a key", true, null, Context.LINK)61 c = ConditionFactory.createKeyCondition("a key", true, null, Context.LINK) 61 62 62 63 shouldFail(MapCSSException) { 63 64 // ["a label"?] 64 c = Condition .createKeyCondition("a key", false, Condition.KeyMatchType.TRUE, Context.LINK)65 c = ConditionFactory.createKeyCondition("a key", false, KeyMatchType.TRUE, Context.LINK) 65 66 } 66 67 67 68 shouldFail(MapCSSException) { 68 69 // [!"a label"?] 69 c = Condition .createKeyCondition("a key", true, Condition.KeyMatchType.TRUE, Context.LINK)70 c = ConditionFactory.createKeyCondition("a key", true, KeyMatchType.TRUE, Context.LINK) 70 71 } 71 72 } … … 79 80 Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext() 80 81 81 Condition cond = Condition .createKeyCondition("my_role", false, null, Context.LINK)82 Condition cond = ConditionFactory.createKeyCondition("my_role", false, null, Context.LINK) 82 83 assert cond.applies(e) 83 84 84 cond = Condition .createKeyCondition("my_role", true, null, Context.LINK)85 cond = ConditionFactory.createKeyCondition("my_role", true, null, Context.LINK) 85 86 assert !cond.applies(e) 86 87 } … … 94 95 Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext() 95 96 96 Condition cond = Condition .createKeyCondition("another_role", false, null, Context.LINK)97 Condition cond = ConditionFactory.createKeyCondition("another_role", false, null, Context.LINK) 97 98 assert !cond.applies(e) 98 99 99 cond = Condition .createKeyCondition("another_role", true, null, Context.LINK)100 cond = ConditionFactory.createKeyCondition("another_role", true, null, Context.LINK) 100 101 assert cond.applies(e) 101 102 } -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy
r9247 r10837 12 12 import org.openstreetmap.josm.gui.mappaint.Environment 13 13 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context 14 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition .Op14 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op 15 15 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser 16 16 … … 47 47 @Test 48 48 public void create() { 49 Condition c = Condition .createKeyValueCondition("a key", "a value", Op.EQ, Context.PRIMITIVE, false)49 Condition c = ConditionFactory.createKeyValueCondition("a key", "a value", Op.EQ, Context.PRIMITIVE, false) 50 50 51 c = Condition .createKeyValueCondition("role", "a role", Op.EQ, Context.LINK, false)52 c = Condition .createKeyValueCondition("RoLe", "a role", Op.EQ, Context.LINK, false)51 c = ConditionFactory.createKeyValueCondition("role", "a role", Op.EQ, Context.LINK, false) 52 c = ConditionFactory.createKeyValueCondition("RoLe", "a role", Op.EQ, Context.LINK, false) 53 53 54 54 shouldFail(MapCSSException) { 55 c = Condition .createKeyValueCondition("an arbitry tag", "a role", Op.EQ, Context.LINK, false)55 c = ConditionFactory.createKeyValueCondition("an arbitry tag", "a role", Op.EQ, Context.LINK, false) 56 56 } 57 57 } … … 65 65 Environment e = new Environment(n).withParent(r).withLinkContext().withIndex(0, r.membersCount) 66 66 67 Condition cond = new Condition .RoleCondition("my_role", Op.EQ)67 Condition cond = new ConditionFactory.RoleCondition("my_role", Op.EQ) 68 68 assert cond.applies(e) 69 69 70 cond = new Condition .RoleCondition("another_role", Op.EQ)70 cond = new ConditionFactory.RoleCondition("another_role", Op.EQ) 71 71 assert !cond.applies(e) 72 72 } … … 80 80 Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext() 81 81 82 Condition cond = Condition .createKeyValueCondition("role", "my_role", Op.NEQ, Context.LINK, false)82 Condition cond = ConditionFactory.createKeyValueCondition("role", "my_role", Op.NEQ, Context.LINK, false) 83 83 assert !cond.applies(e) 84 84 85 cond = Condition .createKeyValueCondition("role", "another_role", Op.NEQ, Context.LINK, false)85 cond = ConditionFactory.createKeyValueCondition("role", "another_role", Op.NEQ, Context.LINK, false) 86 86 assert cond.applies(e) 87 87 } -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r10193 r10837 14 14 import org.openstreetmap.josm.gui.mappaint.Environment 15 15 import org.openstreetmap.josm.gui.mappaint.MultiCascade 16 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.ClassCondition 17 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyCondition 18 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyMatchType 19 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.KeyValueCondition 20 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op 21 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.PseudoClassCondition 22 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.SimpleKeyValueCondition 16 23 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser 17 24 import org.openstreetmap.josm.tools.ColorHelper … … 50 57 public void testClassCondition() throws Exception { 51 58 def conditions = ((Selector.GeneralSelector) getParser("way[name=X].highway:closed").selector()).conds 52 assert conditions.get(0) instanceof Condition.SimpleKeyValueCondition59 assert conditions.get(0) instanceof SimpleKeyValueCondition 53 60 assert conditions.get(0).applies(getEnvironment("name", "X")) 54 assert conditions.get(1) instanceof C ondition.ClassCondition55 assert conditions.get(2) instanceof Condition.PseudoClassCondition61 assert conditions.get(1) instanceof ClassCondition 62 assert conditions.get(2) instanceof PseudoClassCondition 56 63 assert !conditions.get(2).applies(getEnvironment("name", "X")) 57 64 } … … 93 100 @Test 94 101 public void testEqualCondition() throws Exception { 95 def condition = ( Condition.SimpleKeyValueCondition) getParser("[surface=paved]").condition(Condition.Context.PRIMITIVE)96 assert condition instanceof Condition.SimpleKeyValueCondition102 def condition = (SimpleKeyValueCondition) getParser("[surface=paved]").condition(Condition.Context.PRIMITIVE) 103 assert condition instanceof SimpleKeyValueCondition 97 104 assert "surface".equals(condition.k) 98 105 assert "paved".equals(condition.v) … … 103 110 @Test 104 111 public void testNotEqualCondition() throws Exception { 105 def condition = ( Condition.KeyValueCondition) getParser("[surface!=paved]").condition(Condition.Context.PRIMITIVE)106 assert Condition.Op.NEQ.equals(condition.op)112 def condition = (KeyValueCondition) getParser("[surface!=paved]").condition(Condition.Context.PRIMITIVE) 113 assert Op.NEQ.equals(condition.op) 107 114 assert !condition.applies(getEnvironment("surface", "paved")) 108 115 assert condition.applies(getEnvironment("surface", "unpaved")) … … 111 118 @Test 112 119 public void testRegexCondition() throws Exception { 113 def condition = ( Condition.KeyValueCondition) getParser("[surface=~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE)114 assert Condition.Op.REGEX.equals(condition.op)120 def condition = (KeyValueCondition) getParser("[surface=~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE) 121 assert Op.REGEX.equals(condition.op) 115 122 assert condition.applies(getEnvironment("surface", "unpaved")) 116 123 assert !condition.applies(getEnvironment("surface", "grass")) … … 119 126 @Test 120 127 public void testRegexConditionParenthesis() throws Exception { 121 def condition = ( Condition.KeyValueCondition) getParser("[name =~ /^\\(foo\\)/]").condition(Condition.Context.PRIMITIVE)128 def condition = (KeyValueCondition) getParser("[name =~ /^\\(foo\\)/]").condition(Condition.Context.PRIMITIVE) 122 129 assert condition.applies(getEnvironment("name", "(foo)")) 123 130 assert !condition.applies(getEnvironment("name", "foo")) … … 127 134 @Test 128 135 public void testNegatedRegexCondition() throws Exception { 129 def condition = ( Condition.KeyValueCondition) getParser("[surface!~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE)130 assert Condition.Op.NREGEX.equals(condition.op)136 def condition = (KeyValueCondition) getParser("[surface!~/paved|unpaved/]").condition(Condition.Context.PRIMITIVE) 137 assert Op.NREGEX.equals(condition.op) 131 138 assert !condition.applies(getEnvironment("surface", "unpaved")) 132 139 assert condition.applies(getEnvironment("surface", "grass")) … … 135 142 @Test 136 143 public void testBeginsEndsWithCondition() throws Exception { 137 def condition = ( Condition.KeyValueCondition) getParser('[foo ^= bar]').condition(Condition.Context.PRIMITIVE)138 assert Condition.Op.BEGINS_WITH.equals(condition.op)144 def condition = (KeyValueCondition) getParser('[foo ^= bar]').condition(Condition.Context.PRIMITIVE) 145 assert Op.BEGINS_WITH.equals(condition.op) 139 146 assert condition.applies(getEnvironment("foo", "bar123")) 140 147 assert !condition.applies(getEnvironment("foo", "123bar")) 141 148 assert !condition.applies(getEnvironment("foo", "123bar123")) 142 condition = ( Condition.KeyValueCondition) getParser('[foo $= bar]').condition(Condition.Context.PRIMITIVE)143 assert Condition.Op.ENDS_WITH.equals(condition.op)149 condition = (KeyValueCondition) getParser('[foo $= bar]').condition(Condition.Context.PRIMITIVE) 150 assert Op.ENDS_WITH.equals(condition.op) 144 151 assert !condition.applies(getEnvironment("foo", "bar123")) 145 152 assert condition.applies(getEnvironment("foo", "123bar")) … … 158 165 @Test 159 166 public void testStandardKeyCondition() throws Exception { 160 def c1 = ( Condition.KeyCondition) getParser("[ highway ]").condition(Condition.Context.PRIMITIVE)161 assert Condition.KeyMatchType.EQ.equals(c1.matchType)167 def c1 = (KeyCondition) getParser("[ highway ]").condition(Condition.Context.PRIMITIVE) 168 assert KeyMatchType.EQ.equals(c1.matchType) 162 169 assert c1.applies(getEnvironment("highway", "unclassified")) 163 170 assert !c1.applies(getEnvironment("railway", "rail")) 164 def c2 = ( Condition.KeyCondition) getParser("[\"/slash/\"]").condition(Condition.Context.PRIMITIVE)165 assert Condition.KeyMatchType.EQ.equals(c2.matchType)171 def c2 = (KeyCondition) getParser("[\"/slash/\"]").condition(Condition.Context.PRIMITIVE) 172 assert KeyMatchType.EQ.equals(c2.matchType) 166 173 assert c2.applies(getEnvironment("/slash/", "yes")) 167 174 assert !c2.applies(getEnvironment("\"slash\"", "no")) … … 170 177 @Test 171 178 public void testYesNoKeyCondition() throws Exception { 172 def c1 = ( Condition.KeyCondition) getParser("[oneway?]").condition(Condition.Context.PRIMITIVE)173 def c2 = ( Condition.KeyCondition) getParser("[oneway?!]").condition(Condition.Context.PRIMITIVE)174 def c3 = ( Condition.KeyCondition) getParser("[!oneway?]").condition(Condition.Context.PRIMITIVE)175 def c4 = ( Condition.KeyCondition) getParser("[!oneway?!]").condition(Condition.Context.PRIMITIVE)179 def c1 = (KeyCondition) getParser("[oneway?]").condition(Condition.Context.PRIMITIVE) 180 def c2 = (KeyCondition) getParser("[oneway?!]").condition(Condition.Context.PRIMITIVE) 181 def c3 = (KeyCondition) getParser("[!oneway?]").condition(Condition.Context.PRIMITIVE) 182 def c4 = (KeyCondition) getParser("[!oneway?!]").condition(Condition.Context.PRIMITIVE) 176 183 def yes = getEnvironment("oneway", "yes") 177 184 def no = getEnvironment("oneway", "no") … … 193 200 @Test 194 201 public void testRegexKeyCondition() throws Exception { 195 def c1 = ( Condition.KeyCondition) getParser("[/.*:(backward|forward)\$/]").condition(Condition.Context.PRIMITIVE)196 assert Condition.KeyMatchType.REGEX.equals(c1.matchType)202 def c1 = (KeyCondition) getParser("[/.*:(backward|forward)\$/]").condition(Condition.Context.PRIMITIVE) 203 assert KeyMatchType.REGEX.equals(c1.matchType) 197 204 assert !c1.applies(getEnvironment("lanes", "3")) 198 205 assert c1.applies(getEnvironment("lanes:forward", "3")) … … 214 221 @Test 215 222 public void testKeyKeyCondition() throws Exception { 216 def c1 = ( Condition.KeyValueCondition) getParser("[foo = *bar]").condition(Condition.Context.PRIMITIVE)223 def c1 = (KeyValueCondition) getParser("[foo = *bar]").condition(Condition.Context.PRIMITIVE) 217 224 def w1 = new Way() 218 225 w1.put("foo", "123") … … 221 228 w1.put("bar", "123") 222 229 assert c1.applies(new Environment(w1)) 223 def c2 = ( Condition.KeyValueCondition) getParser("[foo =~ */bar/]").condition(Condition.Context.PRIMITIVE)230 def c2 = (KeyValueCondition) getParser("[foo =~ */bar/]").condition(Condition.Context.PRIMITIVE) 224 231 def w2 = new Way(w1) 225 232 w2.put("bar", "[0-9]{3}")
Note:
See TracChangeset
for help on using the changeset viewer.