Changeset 36193 in osm for applications
- Timestamp:
- 2023-11-06T16:17:31+01:00 (14 months ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ImportImagePlugin/test/unit/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayerTest.java
r36013 r36193 9 9 10 10 import org.junit.jupiter.api.Test; 11 import org.junit.jupiter.api.extension.RegisterExtension;12 11 import org.openstreetmap.josm.TestUtils; 13 12 import org.openstreetmap.josm.gui.MainApplication; 14 13 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 15 14 import org.openstreetmap.josm.io.OsmReader; 16 import org.openstreetmap.josm.testutils.JOSMTestRules;17 15 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 16 import org.openstreetmap.josm.testutils.annotations.Projection; 18 17 19 18 /** … … 22 21 */ 23 22 @BasicPreferences 23 @Projection 24 24 class ImageLayerTest { 25 26 /**27 * Setup test.28 */29 @RegisterExtension30 static JOSMTestRules rules = new JOSMTestRules().projection();31 32 25 /** 33 26 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/14894">#14894</a> -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideDataTest.java
r36065 r36193 25 25 @Main 26 26 class StreetsideDataTest { 27 28 /*@Rule29 public JOSMTestRules rules = new StreetsideTestRules().platform();*/30 27 31 28 private StreetsideData data; -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java
r36065 r36193 3 3 4 4 import static org.junit.jupiter.api.Assertions.assertFalse; 5 import static org.junit.jupiter.api.Assertions.assertInstanceOf; 5 6 import static org.junit.jupiter.api.Assertions.assertNotNull; 6 7 import static org.junit.jupiter.api.Assertions.assertThrows; 7 8 import static org.junit.jupiter.api.Assertions.assertTrue; 8 9 import java.awt.GraphicsEnvironment;10 9 11 10 import org.junit.jupiter.api.Test; … … 69 68 void testGetInfoComponent() { 70 69 Object comp = StreetsideLayer.getInstance().getInfoComponent(); 71 assert True(comp instanceof String);70 assertInstanceOf(String.class, comp); 72 71 assertTrue(((String) comp).length() >= 9); 73 72 } -
applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/TestUtil.java
r36065 r36193 4 4 import static org.junit.jupiter.api.Assertions.assertEquals; 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 import static org.junit.jupiter.api.Assertions.fail;7 6 8 import java.awt.GraphicsEnvironment;9 7 import java.lang.reflect.Constructor; 10 8 import java.lang.reflect.Field; … … 12 10 import java.lang.reflect.Method; 13 11 import java.lang.reflect.Modifier; 14 import java.util.logging.Level;15 12 16 import org.junit.runners.model.InitializationError; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 import org.openstreetmap.josm.tools.Logging; 19 import org.openstreetmap.josm.tools.Utils; 13 import org.openstreetmap.josm.tools.JosmRuntimeException; 20 14 21 15 /** … … 37 31 return result; 38 32 } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { 39 fail(e.getLocalizedMessage());33 throw new JosmRuntimeException(e); 40 34 } 41 return null;42 35 } 43 36 … … 52 45 return getAccessibleField(object.getClass(), name).get(object); 53 46 } catch (IllegalAccessException | SecurityException e) { 54 fail(e.getLocalizedMessage());47 throw new JosmRuntimeException(e); 55 48 } 56 return null;57 49 } 58 50 … … 80 72 } 81 73 } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { 82 fail(e.getLocalizedMessage()); 83 } 84 } 85 86 public static class StreetsideTestRules extends JOSMTestRules { 87 @Override 88 protected void before() throws InitializationError, ReflectiveOperationException { 89 Logging.getLogger().setFilter(record -> record.getLevel().intValue() >= Level.WARNING.intValue() || record.getSourceClassName().startsWith("org.openstreetmap.josm.plugins.streetside")); 90 Utils.updateSystemProperty("java.util.logging.SimpleFormatter.format", "%1$tF %1$tT.%1$tL %2$s %4$s: %5$s%6$s%n"); 91 final String isHeadless = Boolean.toString(GraphicsEnvironment.isHeadless()); 92 super.before(); 93 System.setProperty("java.awt.headless", isHeadless); 74 throw new JosmRuntimeException(e); 94 75 } 95 76 } -
applications/editors/josm/plugins/comfort0/test/unit/net/simon04/comfort0/EditLevel0LActionTest.java
r35934 r36193 12 12 13 13 import org.junit.jupiter.api.Test; 14 import org.junit.jupiter.api.extension.RegisterExtension;15 14 import org.openstreetmap.josm.command.ChangePropertyCommand; 16 15 import org.openstreetmap.josm.command.MoveCommand; … … 22 21 import org.openstreetmap.josm.data.osm.PrimitiveData; 23 22 import org.openstreetmap.josm.data.osm.TagMap; 24 import org.openstreetmap.josm.testutils.JOSMTestRules; 25 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 23 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 24 import org.openstreetmap.josm.testutils.annotations.Projection; 27 25 28 26 import net.simon04.comfort0.level0l.parsergen.Level0LParser; 29 27 import net.simon04.comfort0.level0l.parsergen.ParseException; 30 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;31 28 32 29 @BasicPreferences 30 @Projection 33 31 class EditLevel0LActionTest { 34 35 /**36 * Setup rule37 */38 @RegisterExtension39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")40 JOSMTestRules test = new JOSMTestRules().projection();41 42 32 private SequenceCommand buildChangeCommands(DataSet dataSet) throws ParseException { 43 33 final String level0l = "node 1831881213: 54.0900666, 12.2539381 #Neu Broderstorf (54.0900666, 12.2539381)\n" + -
applications/editors/josm/plugins/comfort0/test/unit/net/simon04/comfort0/level0l/parsergen/Level0LParserTest.java
r35934 r36193 8 8 import java.util.List; 9 9 10 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;11 10 import org.junit.jupiter.api.Test; 12 11 import org.openstreetmap.josm.data.osm.NodeData; … … 15 14 import org.openstreetmap.josm.data.osm.RelationData; 16 15 import org.openstreetmap.josm.data.osm.WayData; 17 import org.openstreetmap.josm.testutils.JOSMTestRules;18 16 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 19 17 -
applications/editors/josm/plugins/opendata/test/unit/org/openstreetmap/josm/plugins/opendata/core/io/datasets/DataSetUpdaterTest.java
r36064 r36193 13 13 import org.junit.jupiter.api.Test; 14 14 import org.junit.jupiter.api.Timeout; 15 import org.junit.jupiter.api.extension.RegisterExtension;16 15 import org.openstreetmap.josm.TestUtils; 17 16 import org.openstreetmap.josm.data.osm.DataSet; … … 20 19 import org.openstreetmap.josm.plugins.opendata.core.datasets.DataSetUpdater; 21 20 import org.openstreetmap.josm.plugins.opendata.core.io.archive.ZipReader; 22 import org.openstreetmap.josm.testutils.JOSMTestRules;23 21 import org.openstreetmap.josm.testutils.annotations.BasicPreferences; 24 22 import org.openstreetmap.josm.testutils.annotations.Projection; … … 28 26 */ 29 27 @BasicPreferences 28 @org.openstreetmap.josm.testutils.annotations.OsmApi(org.openstreetmap.josm.testutils.annotations.OsmApi.APIType.DEV) 30 29 @Projection 31 30 @Timeout(value = 1, unit = TimeUnit.MINUTES) 32 31 class DataSetUpdaterTest { 33 34 /**35 * Setup test.36 */37 @RegisterExtension38 JOSMTestRules rules = new JOSMTestRules().devAPI();39 40 32 /** 41 33 * Non-regression test for ticket <a href="https://josm.openstreetmap.de/ticket/11166">#11166</a> -
applications/editors/josm/plugins/turnrestrictions/test/unit/org/openstreetmap/josm/plugins/turnrestrictions/editor/AllEditorTests.java
r36064 r36193 4 4 import org.junit.platform.suite.api.SelectClasses; 5 5 6 import junit.framework.TestCase;7 6 import org.junit.platform.suite.api.Suite; 8 7 … … 16 15 ExceptValueModelTest.class 17 16 }) 18 public class AllEditorTests extends TestCase{}17 public class AllEditorTests {}
Note:
See TracChangeset
for help on using the changeset viewer.