Last change
on this file since 18690 was 18690, checked in by taylor.smock, 14 months ago |
See #16567: Convert all assertion calls to JUnit 5 (patch by gaben, modified)
The modifications are as follows:
- Merge DomainValidatorTest.testIDN and DomainValidatorTest.testIDNJava6OrLater
- Update some tests to use @ParameterizedTest (DomainValidatorTest)
- Replace various exception blocks with
assertThrows . These typically looked like
try {
// Something that should throw an exception here
fail("An exception should have been thrown");
} catch (Exception e) {
// Verify the exception matches expectations here
}
- Replace
assertTrue(val instanceof Clazz) with assertInstanceOf
- Replace JUnit 4 @Suite with JUnit 5 @Suite
Both the original patch and the modified patch fix various lint issues.
|
File size:
1.0 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.validation.tests;
|
---|
3 |
|
---|
4 | import org.junit.jupiter.api.Test;
|
---|
5 | import org.junit.jupiter.api.extension.RegisterExtension;
|
---|
6 | import org.openstreetmap.josm.data.osm.DataSet;
|
---|
7 | import org.openstreetmap.josm.testutils.JOSMTestRules;
|
---|
8 |
|
---|
9 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
---|
10 |
|
---|
11 | /**
|
---|
12 | * JUnit Test of Multipolygon validation test.
|
---|
13 | */
|
---|
14 | class DirectionNodesTest {
|
---|
15 |
|
---|
16 |
|
---|
17 | /**
|
---|
18 | * Setup test.
|
---|
19 | */
|
---|
20 | @RegisterExtension
|
---|
21 | @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
|
---|
22 | public JOSMTestRules test = new JOSMTestRules();
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * Test all error cases manually created in direction-nodes.osm.
|
---|
26 | * @throws Exception in case of error
|
---|
27 | */
|
---|
28 | @Test
|
---|
29 | void testDirectionsNodesTestFile() throws Exception {
|
---|
30 | final DirectionNodes test = new DirectionNodes();
|
---|
31 | ValidatorTestUtils.testSampleFile("nodist/data/direction-nodes.osm", DataSet::getNodes, null, test);
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.