Changeset 12564 in josm for trunk/test
- Timestamp:
- 2017-08-03T23:24:56+02:00 (7 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r12563 r12564 186 186 Main.mainPanel.reAddListeners(); 187 187 } 188 if (Main.main != null) { 189 Main.main.panel = Main.mainPanel; 190 } 188 191 } 189 192 -
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r12562 r12564 46 46 @Rule 47 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 48 public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main ();48 public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().mainMenu().projection(); 49 49 50 50 /** -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r10758 r12564 6 6 import static org.junit.Assert.assertTrue; 7 7 8 import org.junit.AfterClass; 9 import org.junit.BeforeClass; 8 import org.junit.After; 9 import org.junit.Before; 10 import org.junit.Rule; 10 11 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.data.conflict.Conflict; … … 17 17 import org.openstreetmap.josm.data.osm.Way; 18 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 20 21 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 20 22 import nl.jqno.equalsverifier.EqualsVerifier; 21 23 import nl.jqno.equalsverifier.Warning; … … 26 28 public class ConflictAddCommandTest { 27 29 28 private staticOsmDataLayer layer;30 private OsmDataLayer layer; 29 31 30 32 /** 31 33 * Setup test. 32 34 */ 33 @BeforeClass 34 public static void setUpBeforeClass() { 35 JOSMFixture.createUnitTestFixture().init(true); 35 @Rule 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 public JOSMTestRules test = new JOSMTestRules().platform(); 38 39 /** 40 * Setup test. 41 */ 42 @Before 43 public void setUp() { 36 44 layer = new OsmDataLayer(new DataSet(), null, null); 37 45 Main.getLayerManager().addLayer(layer); … … 41 49 * Cleanup test resources. 42 50 */ 43 @After Class44 public static void tearDownAfterClass() {51 @After 52 public void tearDown() { 45 53 Main.getLayerManager().removeLayer(layer); 46 54 } -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r10758 r12564 6 6 import static org.junit.Assert.assertTrue; 7 7 8 import org.junit.AfterClass; 9 import org.junit.BeforeClass; 8 import org.junit.After; 9 import org.junit.Before; 10 import org.junit.Rule; 10 11 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.data.conflict.Conflict; … … 19 19 import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType; 20 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 22 23 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 22 24 import nl.jqno.equalsverifier.EqualsVerifier; 23 25 import nl.jqno.equalsverifier.Warning; … … 28 30 public class CoordinateConflictResolveCommandTest { 29 31 30 private staticOsmDataLayer layer;32 private OsmDataLayer layer; 31 33 32 34 /** 33 35 * Setup test. 34 36 */ 35 @BeforeClass 36 public static void setUpBeforeClass() { 37 JOSMFixture.createUnitTestFixture().init(true); 37 @Rule 38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 39 public JOSMTestRules test = new JOSMTestRules().platform(); 40 41 /** 42 * Setup test. 43 */ 44 @Before 45 public void setUp() { 38 46 layer = new OsmDataLayer(new DataSet(), null, null); 39 47 Main.getLayerManager().addLayer(layer); … … 43 51 * Cleanup test resources. 44 52 */ 45 @After Class46 public static void tearDownAfterClass() {53 @After 54 public void tearDown() { 47 55 Main.getLayerManager().removeLayer(layer); 48 56 } -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CoastlinesTest.java
r10991 r12564 23 23 @Rule 24 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 public JOSMTestRules test = new JOSMTestRules() .commands();25 public JOSMTestRules test = new JOSMTestRules(); 26 26 27 27 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
r11241 r12564 35 35 @Rule 36 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 public JOSMTestRules test = new JOSMTestRules(). commands();37 public JOSMTestRules test = new JOSMTestRules().projection().preferences(); 38 38 39 39 private static Way createUnclosedWay(String tags) { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java
r11441 r12564 25 25 @BeforeClass 26 26 public static void setUp() throws Exception { 27 JOSMFixture.createUnitTestFixture().init( false);27 JOSMFixture.createUnitTestFixture().init(); 28 28 } 29 29 -
trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
r11324 r12564 13 13 import java.util.Collection; 14 14 15 import org.junit. BeforeClass;15 import org.junit.Rule; 16 16 import org.junit.Test; 17 import org.openstreetmap.josm.JOSMFixture;18 17 import org.openstreetmap.josm.data.Version; 19 18 import org.openstreetmap.josm.gui.SplashScreen.SplashProgressMonitor; … … 23 22 import org.openstreetmap.josm.plugins.PluginListParseException; 24 23 import org.openstreetmap.josm.plugins.PluginListParser; 24 import org.openstreetmap.josm.testutils.JOSMTestRules; 25 25 26 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 34 34 * Setup test. 35 35 */ 36 @BeforeClass 37 public static void setUp() { 38 JOSMFixture.createUnitTestFixture().init(true); 39 } 36 @Rule 37 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 38 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu(); 40 39 41 40 @SuppressFBWarnings(value = "DM_DEFAULT_ENCODING") -
trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
r9954 r12564 8 8 import java.awt.Color; 9 9 10 import org.junit. BeforeClass;10 import org.junit.Rule; 11 11 import org.junit.Test; 12 import org.openstreetmap.josm.JOSMFixture;13 12 import org.openstreetmap.josm.Main; 14 13 import org.openstreetmap.josm.TestUtils; 14 import org.openstreetmap.josm.data.osm.DataSet; 15 15 import org.openstreetmap.josm.gui.MapScaler.AccessibleMapScaler; 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 16 20 17 21 /** … … 23 27 * Setup tests 24 28 */ 25 @BeforeClass 26 public static void setUpBeforeClass() { 27 JOSMFixture.createUnitTestFixture().init(true); 28 } 29 @Rule 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 29 32 30 33 /** … … 33 36 @Test 34 37 public void testMapScaler() { 38 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 35 39 assertEquals(Color.WHITE, MapScaler.getColor()); 36 40 MapScaler ms = new MapScaler(Main.map.mapView); -
trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
r10937 r12564 14 14 15 15 import org.junit.Assert; 16 import org.junit. BeforeClass;16 import org.junit.Rule; 17 17 import org.junit.Test; 18 import org.openstreetmap.josm. JOSMFixture;18 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 19 import org.openstreetmap.josm.tools.Utils; 20 20 import org.reflections.Reflections; 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 21 23 22 24 /** … … 47 49 * Setup test. 48 50 */ 49 @BeforeClass 50 public static void setUp() { 51 JOSMFixture.createFunctionalTestFixture().init(true); 52 } 51 @Rule 52 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 53 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu(); 53 54 54 55 /** -
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
r10944 r12564 28 28 @Rule 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().preferences().projection(). commands();30 public JOSMTestRules test = new JOSMTestRules().preferences().projection().main().platform(); 31 31 32 32 private final OsmTransferHandler transferHandler = new OsmTransferHandler(); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
r11110 r12564 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). commands();28 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java
r10962 r12564 12 12 import org.openstreetmap.josm.Main; 13 13 import org.openstreetmap.josm.data.coor.LatLon; 14 import org.openstreetmap.josm.data.osm.DataSet; 14 15 import org.openstreetmap.josm.data.osm.Node; 15 16 import org.openstreetmap.josm.data.osm.Relation; … … 17 18 import org.openstreetmap.josm.data.osm.Way; 18 19 import org.openstreetmap.josm.gui.dialogs.ConflictDialog.ConflictPainter; 20 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 19 21 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 22 … … 31 33 @Rule 32 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 33 public JOSMTestRules test = new JOSMTestRules(). platform().commands();35 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 34 36 35 37 /** … … 54 56 @Test 55 57 public void testConflictPainter() { 58 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 56 59 ConflictPainter cp = new ConflictPainter(Main.map.mapView, new BufferedImage(800, 600, BufferedImage.TYPE_3BYTE_BGR).createGraphics()); 57 60 Node n1 = new Node(1, 1); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r11803 r12564 31 31 @Rule 32 32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 33 public JOSMTestRules test = new JOSMTestRules(). commands();33 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 34 34 35 35 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
r10962 r12564 5 5 import org.junit.Test; 6 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.data.osm.DataSet; 8 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 7 9 import org.openstreetmap.josm.testutils.JOSMTestRules; 8 10 … … 19 21 @Rule 20 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules(). commands();23 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 22 24 23 25 /** … … 26 28 @Test 27 29 public void testInfoAction() { 30 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 28 31 Main.map.mapPaintDialog.new InfoAction().actionPerformed(null); 29 32 } -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
r11020 r12564 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules(). commands();23 public JOSMTestRules test = new JOSMTestRules().platform(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
r12394 r12564 6 6 import static org.junit.Assert.assertTrue; 7 7 8 import org.junit.BeforeClass;9 8 import org.junit.Rule; 10 9 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 10 import org.openstreetmap.josm.Main; 13 11 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 28 26 @Rule 29 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().preferences().projection().platform(); 31 32 /** 33 * Somewhere deep down the dependencies we need shortcuts 34 */ 35 @BeforeClass 36 public static void setUp() { 37 JOSMFixture.createUnitTestFixture().init(true); 38 } 28 public JOSMTestRules test = new JOSMTestRules().preferences().projection().platform().mainMenu(); 39 29 40 30 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
r10962 r12564 41 41 @Rule 42 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules().preferences().platform(). commands();43 public JOSMTestRules test = new JOSMTestRules().preferences().platform().main(); 44 44 45 45 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java
r10604 r12564 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules().preferences().platform(). commands();29 public JOSMTestRules test = new JOSMTestRules().preferences().platform().main(); 30 30 31 31 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
r11957 r12564 27 27 import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTMSTileSource; 28 28 import org.openstreetmap.gui.jmapviewer.tilesources.TileSourceInfo; 29 import org.openstreetmap.josm.Main; 29 30 import org.openstreetmap.josm.data.imagery.ImageryInfo; 30 31 import org.openstreetmap.josm.data.imagery.TileLoaderFactory; 32 import org.openstreetmap.josm.data.osm.DataSet; 31 33 import org.openstreetmap.josm.gui.layer.imagery.ImageryFilterSettings; 32 34 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 44 46 @Rule 45 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 46 public JOSMTestRules test = new JOSMTestRules().platform().projection(). commands();48 public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu(); 47 49 48 50 private static final class TMSTileStubSource extends AbstractTMSTileSource { … … 147 149 @Before 148 150 public void setUp() { 151 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 149 152 testLayer = new TileSourceStubLayer(); 150 153 testLayer.addInvalidationListener(l -> invalidated.set(true)); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r11383 r12564 15 15 import javax.swing.JScrollPane; 16 16 17 import org.junit. BeforeClass;17 import org.junit.Rule; 18 18 import org.junit.Test; 19 import org.openstreetmap.josm.JOSMFixture;20 19 import org.openstreetmap.josm.Main; 21 20 import org.openstreetmap.josm.TestUtils; … … 27 26 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 28 27 import org.openstreetmap.josm.io.GpxReaderTest; 28 import org.openstreetmap.josm.testutils.JOSMTestRules; 29 29 import org.xml.sax.SAXException; 30 31 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 30 32 31 33 /** … … 37 39 * Setup tests 38 40 */ 39 @BeforeClass 40 public static void setUpBeforeClass() { 41 JOSMFixture.createUnitTestFixture().init(true); 42 } 41 @Rule 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection(); 43 44 44 45 private static String getHtml(GpxLayer layer) { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/MarkerLayerTest.java
r11931 r12564 9 9 import org.openstreetmap.josm.Main; 10 10 import org.openstreetmap.josm.data.gpx.GpxData; 11 import org.openstreetmap.josm.data.osm.DataSet; 11 12 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 12 13 import org.openstreetmap.josm.testutils.JOSMTestRules; … … 24 25 @Rule 25 26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 public JOSMTestRules test = new JOSMTestRules(). commands();27 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 27 28 28 29 /** … … 32 33 public void testPlayHeadMarker() { 33 34 try { 35 Main.getLayerManager().addLayer(new OsmDataLayer(new DataSet(), "", null)); 34 36 MarkerLayer layer = new MarkerLayer(new GpxData(), null, null, null); 35 37 assertNull(Main.map.mapView.playHeadMarker); -
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r10436 r12564 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import org.junit. BeforeClass;6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 8 import org.openstreetmap.josm.Main; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo; 11 10 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 14 13 15 /** … … 19 21 * Setup tests 20 22 */ 21 @BeforeClass 22 public static void setUpBeforeClass() { 23 JOSMFixture.createUnitTestFixture().init(true); 24 } 23 @Rule 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 25 26 26 27 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r11168 r12564 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import org.junit. BeforeClass;6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 8 import org.openstreetmap.josm.Main; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo; 11 10 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 11 import org.openstreetmap.josm.testutils.JOSMTestRules; 12 13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 12 14 13 15 /** … … 19 21 * Setup tests 20 22 */ 21 @BeforeClass 22 public static void setUpBeforeClass() { 23 JOSMFixture.createUnitTestFixture().init(true); 24 } 23 @Rule 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().projection(); 25 26 26 27 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMTSLayerTest.java
r9669 r12564 4 4 import static org.junit.Assert.assertEquals; 5 5 6 import org.junit. BeforeClass;6 import org.junit.Rule; 7 7 import org.junit.Test; 8 import org.openstreetmap.josm.JOSMFixture;9 8 import org.openstreetmap.josm.data.imagery.ImageryInfo; 10 9 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType; 10 import org.openstreetmap.josm.testutils.JOSMTestRules; 11 12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 11 13 12 14 /** … … 18 20 * Setup tests 19 21 */ 20 @BeforeClass 21 public static void setUpBeforeClass() { 22 JOSMFixture.createUnitTestFixture().init(); 23 } 22 @Rule 23 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 24 public JOSMTestRules test = new JOSMTestRules(); 24 25 25 26 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
r9949 r12564 2 2 package org.openstreetmap.josm.gui.layer.gpx; 3 3 4 import org.junit. BeforeClass;4 import org.junit.Rule; 5 5 import org.junit.Test; 6 import org.openstreetmap.josm.JOSMFixture;7 6 import org.openstreetmap.josm.gui.layer.GpxLayerTest; 7 import org.openstreetmap.josm.testutils.JOSMTestRules; 8 9 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 8 10 9 11 /** … … 15 17 * Setup test. 16 18 */ 17 @BeforeClass 18 public static void setUpBeforeClass() { 19 JOSMFixture.createUnitTestFixture().init(); 20 } 19 @Rule 20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules().platform(); 21 22 22 23 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ConvertToDataLayerActionTest.java
r11486 r12564 7 7 import java.io.IOException; 8 8 9 import org.junit. BeforeClass;9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 11 import org.openstreetmap.josm.TestUtils; 13 12 import org.openstreetmap.josm.data.gpx.GpxData; … … 16 15 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 17 16 import org.openstreetmap.josm.io.GpxReaderTest; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 18 import org.xml.sax.SAXException; 19 20 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 19 21 20 22 /** … … 26 28 * Setup test. 27 29 */ 28 @BeforeClass 29 public static void setUpBeforeClass() { 30 JOSMFixture.createUnitTestFixture().init(false); 31 } 30 @Rule 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules test = new JOSMTestRules(); 32 33 33 34 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r10436 r12564 7 7 import static org.junit.Assert.assertTrue; 8 8 9 import org.junit. BeforeClass;9 import org.junit.Rule; 10 10 import org.junit.Test; 11 import org.openstreetmap.josm.JOSMFixture;12 11 import org.openstreetmap.josm.Main; 13 12 import org.openstreetmap.josm.data.gpx.GpxData; … … 16 15 import org.openstreetmap.josm.gui.layer.TMSLayer; 17 16 import org.openstreetmap.josm.gui.layer.gpx.DownloadWmsAlongTrackAction.PrecacheWmsTask; 17 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 19 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 18 20 19 21 /** … … 25 27 * Setup test. 26 28 */ 27 @BeforeClass 28 public static void setUpBeforeClass() { 29 JOSMFixture.createUnitTestFixture().init(true); 30 } 29 @Rule 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules test = new JOSMTestRules().platform().mainMenu().projection(); 31 32 32 33 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java
r12157 r12564 9 9 import java.util.stream.Collectors; 10 10 11 import org.junit. BeforeClass;11 import org.junit.Rule; 12 12 import org.junit.Test; 13 import org.openstreetmap.josm.JOSMFixture;14 13 import org.openstreetmap.josm.Main; 15 14 import org.openstreetmap.josm.TestUtils; … … 17 16 import org.openstreetmap.josm.gui.layer.GpxLayer; 18 17 import org.openstreetmap.josm.io.GpxReaderTest; 18 import org.openstreetmap.josm.testutils.JOSMTestRules; 19 19 import org.openstreetmap.josm.tools.ColorHelper; 20 20 import org.xml.sax.SAXException; 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 21 23 22 24 /** … … 28 30 * Setup test. 29 31 */ 30 @BeforeClass 31 public static void setUpBeforeClass() { 32 JOSMFixture.createUnitTestFixture().init(false); 33 } 32 @Rule 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 public JOSMTestRules test = new JOSMTestRules(); 34 35 35 36 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
r10824 r12564 9 9 import java.util.Arrays; 10 10 11 import org.junit.BeforeClass; 11 import org.junit.Before; 12 import org.junit.Rule; 12 13 import org.junit.Test; 13 import org.openstreetmap.josm.JOSMFixture;14 14 import org.openstreetmap.josm.Main; 15 15 import org.openstreetmap.josm.data.coor.LatLon; … … 18 18 import org.openstreetmap.josm.data.gpx.GpxLink; 19 19 import org.openstreetmap.josm.data.gpx.WayPoint; 20 import org.openstreetmap.josm.testutils.JOSMTestRules; 21 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 20 23 21 24 /** … … 27 30 * Setup tests 28 31 */ 29 @BeforeClass 30 public static void setUpBeforeClass() { 31 JOSMFixture.createUnitTestFixture().init(true); 32 @Rule 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 public JOSMTestRules test = new JOSMTestRules().mainMenu().platform().preferences().projection(); 35 36 /** 37 * Setup tests 38 */ 39 @Before 40 public void setUp() { 32 41 Main.pref.put("marker.traceaudio", true); 33 42 } … … 40 49 assertEquals(Color.magenta, MarkerLayer.getGenericColor()); 41 50 MarkerLayer layer = new MarkerLayer(new GpxData(), "foo", null, null); 51 Main.getLayerManager().addLayer(layer); 42 52 43 53 assertEquals("foo", layer.getName()); -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r12140 r12564 10 10 import java.util.List; 11 11 12 import org.junit. BeforeClass;12 import org.junit.Rule; 13 13 import org.junit.Test; 14 import org.openstreetmap.josm.JOSMFixture;15 14 import org.openstreetmap.josm.Main; 16 15 import org.openstreetmap.josm.TestUtils; … … 23 22 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 24 23 import org.openstreetmap.josm.io.IllegalDataException; 24 import org.openstreetmap.josm.testutils.JOSMTestRules; 25 26 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 25 27 26 28 /** … … 32 34 * Setup tests. 33 35 */ 34 @BeforeClass 35 public static void setUpBeforeClass() { 36 JOSMFixture.createUnitTestFixture().init(); 37 } 36 @Rule 37 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 38 public JOSMTestRules test = new JOSMTestRules().platform().projection(); 38 39 39 40 private static String getSessionDataDir() { -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r12118 r12564 10 10 import java.util.Map; 11 11 12 import org.junit.BeforeClass; 12 import org.junit.Before; 13 import org.junit.Rule; 13 14 import org.junit.Test; 14 import org.openstreetmap.josm.JOSMFixture;15 15 import org.openstreetmap.josm.Main; 16 16 import org.openstreetmap.josm.data.coor.LatLon; … … 28 28 import org.openstreetmap.josm.gui.layer.TMSLayer; 29 29 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 30 import org.openstreetmap.josm. gui.preferences.projection.ProjectionPreference;30 import org.openstreetmap.josm.testutils.JOSMTestRules; 31 31 import org.openstreetmap.josm.tools.MultiMap; 32 32 import org.openstreetmap.josm.tools.Utils; 33 34 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 33 35 34 36 /** … … 84 86 * Setup tests. 85 87 */ 86 @BeforeClass 87 public static void setUpBeforeClass() { 88 JOSMFixture.createUnitTestFixture().init(true); 89 ProjectionPreference.setProjection(); 88 @Rule 89 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 90 public JOSMTestRules test = new JOSMTestRules().platform().projection().mainMenu(); 91 92 /** 93 * Setup tests. 94 */ 95 @Before 96 public void setUp() { 97 Main.getLayerManager().addLayer(createOsmLayer()); 90 98 } 91 99
Note:
See TracChangeset
for help on using the changeset viewer.