Changeset 17275 in josm for trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
- Timestamp:
- 2020-10-28T20:41:00+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r14977 r17275 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.junit. Assert.assertSame;5 import static org.junit. Assert.assertTrue;4 import static org.junit.jupiter.api.Assertions.assertSame; 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 7 import java.lang.reflect.Field; … … 9 9 import java.util.Collection; 10 10 11 import org.junit. Rule;12 import org.junit. Test;11 import org.junit.jupiter.api.Test; 12 import org.junit.jupiter.api.extension.RegisterExtension; 13 13 import org.openstreetmap.josm.data.coor.EastNorth; 14 14 import org.openstreetmap.josm.data.coor.LatLon; … … 29 29 * Unit tests for class {@link CreateCircleAction}. 30 30 */ 31 publicfinal class CreateCircleActionTest {31 final class CreateCircleActionTest { 32 32 33 33 /** 34 34 * Setup test. 35 35 */ 36 @R ule36 @RegisterExtension 37 37 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 38 38 public JOSMTestRules test = new JOSMTestRules().projection(); … … 45 45 */ 46 46 @Test 47 publicvoid testTicket7421case0() throws ReflectiveOperationException {47 void testTicket7421case0() throws ReflectiveOperationException { 48 48 DataSet dataSet = new DataSet(); 49 49 … … 65 65 // Expected result: Dataset contain one closed way, clockwise 66 66 Collection<Way> resultingWays = dataSet.getWays(); 67 assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()), 68 resultingWays.size(), 1); 67 assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size())); 69 68 Way resultingWay = resultingWays.iterator().next(); 70 assertTrue("Resulting way is not closed", 71 resultingWay.isClosed()); 72 assertTrue("Found anti-clockwize circle while way was clockwize", 73 Geometry.isClockwise(resultingWay)); 69 assertTrue(resultingWay.isClosed(), "Resulting way is not closed"); 70 assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise circle while way was clockwise"); 74 71 } 75 72 … … 102 99 */ 103 100 @Test 104 publicvoid testTicket7421case1() throws ReflectiveOperationException {101 void testTicket7421case1() throws ReflectiveOperationException { 105 102 DataSet dataSet = new DataSet(); 106 103 … … 127 124 // Expected result: Dataset contain one closed way, clockwise 128 125 Collection<Way> resultingWays = dataSet.getWays(); 129 assertSame(String.format("Expect one way after perform action. %d found", resultingWays.size()), 130 resultingWays.size(), 1); 126 assertSame(1, resultingWays.size(), String.format("Expect one way after perform action. %d found", resultingWays.size())); 131 127 Way resultingWay = resultingWays.iterator().next(); 132 assertTrue("Resulting way is not closed", 133 resultingWay.isClosed()); 134 assertTrue("Found anti-clockwise way while traffic is left hand.", 135 Geometry.isClockwise(resultingWay)); 128 assertTrue(resultingWay.isClosed(), "Resulting way is not closed"); 129 assertTrue(Geometry.isClockwise(resultingWay), "Found anti-clockwise way while traffic is left hand."); 136 130 } finally { 137 131 // Restore left/right hand traffic database
Note:
See TracChangeset
for help on using the changeset viewer.