Ignore:
Timestamp:
2014-05-09T04:49:54+02:00 (12 years ago)
Author:
Don-vip
Message:

fixes for unit tests

File:
1 edited

Legend:

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

    r7068 r7081  
    55import org.junit.Before
    66import org.junit.Test
     7import org.openstreetmap.josm.JOSMFixture
    78import org.openstreetmap.josm.Main
    8 import org.openstreetmap.josm.TestUtils;
     9import org.openstreetmap.josm.TestUtils
    910import org.openstreetmap.josm.data.coor.LatLon
    1011import org.openstreetmap.josm.data.osm.DataSet
    1112import org.openstreetmap.josm.data.osm.OsmPrimitive
    1213import org.openstreetmap.josm.data.osm.Way
    13 import org.openstreetmap.josm.data.projection.Projections
    1414import org.openstreetmap.josm.gui.mappaint.Environment
    1515import org.openstreetmap.josm.gui.mappaint.MultiCascade
     
    3535    @Before
    3636    public void setUp() throws Exception {
    37         Main.initApplicationPreferences()
    38         Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     37        JOSMFixture.createUnitTestFixture().init();
    3938    }
    4039
     
    5756    public void testClassCondition() throws Exception {
    5857        def conditions = ((Selector.GeneralSelector) getParser("way[name=X].highway:closed").selector()).conds
    59         assert conditions.get(0) instanceof Condition.KeyValueCondition
     58        assert conditions.get(0) instanceof Condition.SimpleKeyValueCondition
    6059        assert conditions.get(0).applies(getEnvironment("name", "X"))
    6160        assert conditions.get(1) instanceof Condition.ClassCondition
     
    8988    @Test
    9089    public void testEqualCondition() throws Exception {
    91         def condition = (Condition.KeyValueCondition) getParser("[surface=paved]").condition(Condition.Context.PRIMITIVE)
    92         assert condition instanceof Condition.KeyValueCondition
    93         assert Condition.Op.EQ.equals(condition.op)
     90        def condition = (Condition.SimpleKeyValueCondition) getParser("[surface=paved]").condition(Condition.Context.PRIMITIVE)
     91        assert condition instanceof Condition.SimpleKeyValueCondition
    9492        assert "surface".equals(condition.k)
    9593        assert "paved".equals(condition.v)
     
    215213
    216214    @Test
    217     public void testTicket80711() throws Exception {
     215    public void testTicket8071() throws Exception {
    218216        def sheet = new MapCSSStyleSource("")
    219217        getParser("*[rcn_ref], *[name] {text: concat(tag(rcn_ref), \" \", tag(name)); }").sheet(sheet)
Note: See TracChangeset for help on using the changeset viewer.