Changeset 16618 in josm for trunk/test/unit/org/openstreetmap/josm/data
- Timestamp:
- 2020-06-14T11:54:13+02:00 (6 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/data
- Files:
-
- 4 edited
-
osm/search/SearchCompilerTest.java (modified) (5 diffs)
-
validation/tests/OpeningHourTestTest.java (modified) (1 diff)
-
validation/tests/UnconnectedWaysTest.java (modified) (1 diff)
-
validation/tests/UntaggedNodeTest.java (modified) (1 diff)
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 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
r16178 r16618 5 5 import static org.CustomMatchers.isEmpty; 6 6 import static org.hamcrest.CoreMatchers.not; 7 import static org.hamcrest.MatcherAssert.assertThat; 7 8 import static org.junit.Assert.assertEquals; 8 9 import static org.junit.Assert.assertNotNull; 9 import static org.junit.Assert.assertThat;10 10 import static org.junit.Assert.assertTrue; 11 11 -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UnconnectedWaysTest.java
r16006 r16618 4 4 import static org.CustomMatchers.hasSize; 5 5 import static org.CustomMatchers.isEmpty; 6 import static org. junit.Assert.assertThat;6 import static org.hamcrest.MatcherAssert.assertThat; 7 7 8 8 import java.io.FileNotFoundException; -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/UntaggedNodeTest.java
r10945 r16618 4 4 import static org.CustomMatchers.hasSize; 5 5 import static org.CustomMatchers.isEmpty; 6 import static org. junit.Assert.assertThat;6 import static org.hamcrest.MatcherAssert.assertThat; 7 7 8 8 import java.io.InputStream;
Note:
See TracChangeset
for help on using the changeset viewer.
