Changeset 16618 in josm for trunk/test/unit/org/openstreetmap/josm/data/osm
- Timestamp:
- 2020-06-14T11:54:13+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
r16582 r16618 6 6 import static org.junit.Assert.assertNotNull; 7 7 import static org.junit.Assert.assertTrue; 8 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 9 import static org.junit.jupiter.api.Assertions.assertThrows; 8 10 9 11 import java.lang.reflect.Field; … … 19 21 import org.junit.Rule; 20 22 import org.junit.Test; 21 import org.junit.rules.ExpectedException;22 23 import org.openstreetmap.josm.TestUtils; 23 24 import org.openstreetmap.josm.data.coor.LatLon; … … 61 62 public JOSMTestRules test = new JOSMTestRules().preferences().timeout(30000); 62 63 63 /**64 * Rule to assert exception message.65 */66 @Rule67 public ExpectedException expectedEx = ExpectedException.none();68 69 64 private static final class SearchContext { 70 65 final DataSet ds = new DataSet(); … … 427 422 @Test 428 423 public void testFooTypeBar() throws SearchParseError { 429 expectedEx.expect(SearchParseError.class); 430 expectedEx.expectMessage("<html>Expecting <code>:</code> after <i>type</i></html>"); 431 SearchCompiler.compile("foo type bar"); 424 Exception e = assertThrows(SearchParseError.class, () -> SearchCompiler.compile("foo type bar")); 425 assertEquals("<html>Expecting <code>:</code> after <i>type</i></html>", e.getMessage()); 432 426 } 433 427 … … 553 547 @Test 554 548 public void testEnumExactKeyValueMode() { 555 TestUtils.superficialEnumCodeCoverage(ExactKeyValue.Mode.class);549 assertDoesNotThrow(() -> TestUtils.superficialEnumCodeCoverage(ExactKeyValue.Mode.class)); 556 550 } 557 551
Note:
See TracChangeset
for help on using the changeset viewer.