Changeset 13004 in josm


Ignore:
Timestamp:
2017-10-16T15:21:44+02:00 (7 years ago)
Author:
bastiK
Message:

fix deprecations in tests

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Variable.java

    r13003 r13004  
    2525     * Constructs a new {@code Variable}.
    2626     * @param variableName the variable name (i.e. the key in the data provider key-value mapping);
    27      * will be considered "special" if the variable name starts with {@link SPECIAL_VARIABLE_PREFIX}
     27     * will be considered "special" if the variable name starts with {@link #SPECIAL_VARIABLE_PREFIX}
    2828     */
    2929    public Variable(String variableName) {
  • trunk/test/unit/org/openstreetmap/josm/tools/template_engine/TemplateParserTest.java

    r12656 r13004  
    5959    public void testConditionWhitespace() throws ParseError {
    6060        TemplateParser parser = new TemplateParser("?{ '{name} {desc}' | '{name}' | '{desc}'    }");
    61         Condition condition = new Condition();
    62         condition.getEntries().add(CompoundTemplateEntry.fromArray(new Variable("name"), new StaticText(" "), new Variable("desc")));
    63         condition.getEntries().add(new Variable("name"));
    64         condition.getEntries().add(new Variable("desc"));
     61        Condition condition = new Condition(Arrays.asList(
     62            CompoundTemplateEntry.fromArray(new Variable("name"), new StaticText(" "), new Variable("desc")),
     63            new Variable("name"),
     64            new Variable("desc")));
    6565        ReflectionAssert.assertReflectionEquals(condition, parser.parse());
    6666    }
     
    7373    public void testConditionNoWhitespace() throws ParseError {
    7474        TemplateParser parser = new TemplateParser("?{'{name} {desc}'|'{name}'|'{desc}'}");
    75         Condition condition = new Condition();
    76         condition.getEntries().add(CompoundTemplateEntry.fromArray(new Variable("name"), new StaticText(" "), new Variable("desc")));
    77         condition.getEntries().add(new Variable("name"));
    78         condition.getEntries().add(new Variable("desc"));
     75        Condition condition = new Condition(Arrays.asList(
     76                CompoundTemplateEntry.fromArray(new Variable("name"), new StaticText(" "), new Variable("desc")),
     77                new Variable("name"),
     78                new Variable("desc")));
    7979        ReflectionAssert.assertReflectionEquals(condition, parser.parse());
    8080    }
     
    9292    public void testConditionSearchExpression() throws ParseError, SearchParseError {
    9393        TemplateParser parser = new TemplateParser("?{ admin_level = 2 'NUTS 1' | admin_level = 4 'NUTS 2' |  '{admin_level}'}");
    94         Condition condition = new Condition();
    95         condition.getEntries().add(new SearchExpressionCondition(compile("admin_level = 2"), new StaticText("NUTS 1")));
    96         condition.getEntries().add(new SearchExpressionCondition(compile("admin_level = 4"), new StaticText("NUTS 2")));
    97         condition.getEntries().add(new Variable("admin_level"));
     94        Condition condition = new Condition(Arrays.asList(
     95                new SearchExpressionCondition(compile("admin_level = 2"), new StaticText("NUTS 1")),
     96                new SearchExpressionCondition(compile("admin_level = 4"), new StaticText("NUTS 2")),
     97                new Variable("admin_level")));
    9898        ReflectionAssert.assertReflectionEquals(condition, parser.parse());
    9999    }
Note: See TracChangeset for help on using the changeset viewer.