Ticket #16010: v2-0009-AsynchronousUploadPrimitivesTaskTest-convert-to-u.patch

File v2-0009-AsynchronousUploadPrimitivesTaskTest-convert-to-u.patch, 2.1 KB (added by ris, 3 years ago)
  • test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java

    From 30fb1cc62d9fe421f47e449f756173bbd0129268 Mon Sep 17 00:00:00 2001
    From: Robert Scott <code@humanleg.org.uk>
    Date: Sun, 18 Mar 2018 12:15:59 +0000
    Subject: [PATCH v2 09/28] AsynchronousUploadPrimitivesTaskTest: convert to use
     of JOptionPaneSimpleMocker
    
    won't yet have an effect until internal isHeadless() checks are removed
    ---
     .../josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java      | 10 +++++++++-
     1 file changed, 9 insertions(+), 1 deletion(-)
    
    diff --git a/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java b/test/unit/org/openstreetmap/josm/gui/io/AsynchronousUploadPrimitivesTaskTest.java
    index b4f71654e..aae0700d7 100644
    a b  
    22package org.openstreetmap.josm.gui.io;
    33
    44import java.util.Optional;
     5import javax.swing.JOptionPane;
    56
    67import org.junit.After;
    78import org.junit.Assert;
    import org.openstreetmap.josm.data.osm.Way; 
    1718import org.openstreetmap.josm.gui.layer.OsmDataLayer;
    1819import org.openstreetmap.josm.io.UploadStrategySpecification;
    1920import org.openstreetmap.josm.testutils.JOSMTestRules;
     21import org.openstreetmap.josm.testutils.JOptionPaneSimpleMocker;
     22
     23import com.google.common.collect.ImmutableMap;
    2024
    2125import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    2226
    public class AsynchronousUploadPrimitivesTaskTest { 
    3640     */
    3741    @Rule
    3842    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
    39     public JOSMTestRules test = new JOSMTestRules();
     43    public JOSMTestRules test = new JOSMTestRules().assertionsInEDT();
    4044
    4145    @Before
    4246    public void bootStrap() {
     47        new JOptionPaneSimpleMocker(ImmutableMap.of(
     48            "A background upload is already in progress. Kindly wait for it to finish before uploading new changes", JOptionPane.OK_OPTION
     49        ));
     50
    4351        DataSet dataSet = new DataSet();
    4452        Node node1 = new Node();
    4553        Node node2 = new Node();