Changeset 13325 in josm


Ignore:
Timestamp:
2018-01-14T19:09:13+01:00 (5 months ago)
Author:
Don-vip
Message:

see #15755 - fix unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java

    r13317 r13325  
    66import static org.junit.Assert.assertNotNull;
    77import static org.junit.Assert.assertTrue;
    8 import static org.junit.Assert.fail;
    98
    109import java.lang.reflect.Field;
     
    409408    /**
    410409     * Compiles "foo type bar" and tests the parse error message
    411      */
    412     @Test
    413     public void testFooTypeBar() {
    414         try {
    415             SearchCompiler.compile("foo type bar");
    416             fail();
    417         } catch (SearchParseError parseError) {
    418             assertEquals("<html>Expecting <code>:</code> after <i>type</i>", parseError.getMessage());
    419         }
     410     * @throws SearchParseError always
     411     */
     412    @Test
     413    public void testFooTypeBar() throws SearchParseError {
     414        expectedEx.expect(SearchParseError.class);
     415        expectedEx.expectMessage("<html>Expecting <code>:</code> after <i>type</i></html>");
     416        SearchCompiler.compile("foo type bar");
    420417    }
    421418
     
    693690        }
    694691    }
    695 
    696     /**
    697      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/15755">Bug #15755</a>.
    698      * @throws SearchParseError always
    699      */
    700     @Test
    701     public void testTicket15755() throws SearchParseError {
    702         expectedEx.expect(SearchParseError.class);
    703         expectedEx.expectMessage("<html>Expecting <code>:</code> after <i>type</i></html>");
    704         SearchCompiler.compile("public_transport=stop_area -type");
    705     }
    706692}
Note: See TracChangeset for help on using the changeset viewer.