Ignore:
Timestamp:
2016-08-18T03:39:22+02:00 (5 years ago)
Author:
Don-vip
Message:

see #11924 - extract MapCSS conditions to new class ConditionFactory (on the same model than ExpressionFactory) - should workaround Groovy bug with Java 9 (https://issues.apache.org/jira/browse/GROOVY-7879 ?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/KeyValueConditionTest.groovy

    r9247 r10837  
    1212import org.openstreetmap.josm.gui.mappaint.Environment
    1313import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Context
    14 import org.openstreetmap.josm.gui.mappaint.mapcss.Condition.Op
     14import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.Op
    1515import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.MapCSSParser
    1616
     
    4747    @Test
    4848    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)
    5050
    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)
    5353
    5454        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)
    5656        }
    5757    }
     
    6565        Environment e = new Environment(n).withParent(r).withLinkContext().withIndex(0, r.membersCount)
    6666
    67         Condition cond = new Condition.RoleCondition("my_role", Op.EQ)
     67        Condition cond = new ConditionFactory.RoleCondition("my_role", Op.EQ)
    6868        assert cond.applies(e)
    6969
    70         cond = new Condition.RoleCondition("another_role", Op.EQ)
     70        cond = new ConditionFactory.RoleCondition("another_role", Op.EQ)
    7171        assert !cond.applies(e)
    7272    }
     
    8080        Environment e = new Environment(n).withParent(r).withIndex(0, r.membersCount).withLinkContext()
    8181
    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)
    8383        assert !cond.applies(e)
    8484
    85         cond = Condition.createKeyValueCondition("role", "another_role", Op.NEQ, Context.LINK, false)
     85        cond = ConditionFactory.createKeyValueCondition("role", "another_role", Op.NEQ, Context.LINK, false)
    8686        assert cond.applies(e)
    8787    }
Note: See TracChangeset for help on using the changeset viewer.