Changeset 10837 in josm for trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyConditionTest.groovy
- Timestamp:
- 2016-08-18T03:39:22+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.