Changeset 1813 in josm for trunk/test/functional


Ignore:
Timestamp:
2009-07-19T18:31:22+02:00 (11 years ago)
Author:
jttt
Message:

Make tests compile using new ProgressMonitor API

Location:
trunk/test/functional/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/history/HistoryBrowserTest.java

    r1709 r1813  
    1919import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
    2020import org.openstreetmap.josm.data.projection.Mercator;
    21 import org.openstreetmap.josm.gui.PleaseWaitDialog;
     21import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    2222import org.openstreetmap.josm.io.OsmServerHistoryReader;
    2323import org.openstreetmap.josm.io.OsmTransferException;
     
    5454        }
    5555        System.setProperty("josm.home", josmHome);
    56         Main.pleaseWaitDlg = new PleaseWaitDialog(null);
    5756        Main.pref.init(false);
    5857
     
    7473        HistoryDataSet ds = null;
    7574        try {
    76             ds = reader.parseHistory();
     75            ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
    7776        } catch(OsmTransferException e) {
    7877            e.printStackTrace();
  • trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java

    r1806 r1813  
    33
    44import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertFalse;
    56import static org.junit.Assert.assertNotNull;
     7import static org.junit.Assert.assertTrue;
    68import static org.junit.Assert.fail;
    7 import static org.junit.Assert.*;
    89
    910import java.io.File;
     
    3132import org.openstreetmap.josm.data.osm.Way;
    3233import org.openstreetmap.josm.data.projection.Mercator;
    33 import org.openstreetmap.josm.gui.PleaseWaitDialog;
     34import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3435import org.xml.sax.SAXException;
    3536
     
    3940    /**
    4041     * builds a large data set to be used later for testing MULTI FETCH on the server
    41      * 
     42     *
    4243     * @return a large data set
    4344     */
     
    120121    /**
    121122     * creates the dataset on the server.
    122      * 
     123     *
    123124     * @param ds the data set
    124125     * @throws OsmTransferException
     
    132133
    133134        OsmServerWriter writer = new OsmServerWriter();
    134         writer.uploadOsm("0.6", primitives);
     135        writer.uploadOsm("0.6", primitives, NullProgressMonitor.INSTANCE);
    135136    }
    136137
     
    177178        //
    178179        System.setProperty("josm.home", josmHome);
    179         Main.pleaseWaitDlg = new PleaseWaitDialog(null);
    180180        Main.pref.init(false);
    181181        // don't use atomic upload, the test API server can't cope with large diff uploads
     
    237237        ds = new DataSet();
    238238        FileInputStream fis = new FileInputStream(f);
    239         ds = OsmReader.parseDataSet(fis, Main.pleaseWaitDlg);
     239        ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    240240        fis.close();
    241241    }
     
    248248            reader.append(nodes.get(i));
    249249        }
    250         DataSet out = reader.parseOsm();
     250        DataSet out = reader.parseOsm(NullProgressMonitor.INSTANCE);
    251251        assertEquals(10, out.nodes.size());
    252252        Iterator<Node> it = out.nodes.iterator();
     
    267267            reader.append(ways.get(i));
    268268        }
    269         DataSet out = reader.parseOsm();
     269        DataSet out = reader.parseOsm(NullProgressMonitor.INSTANCE);
    270270        assertEquals(10, out.ways.size());
    271271        Iterator<Way> it = out.ways.iterator();
     
    287287            reader.append(relations.get(i));
    288288        }
    289         DataSet out = reader.parseOsm();
     289        DataSet out = reader.parseOsm(NullProgressMonitor.INSTANCE);
    290290        assertEquals(10, out.relations.size());
    291291        Iterator<Relation> it = out.relations.iterator();
     
    307307            reader.append(nodes.get(i));
    308308        }
    309         DataSet out = reader.parseOsm();
     309        DataSet out = reader.parseOsm(NullProgressMonitor.INSTANCE);
    310310        assertEquals(812, out.nodes.size());
    311311        Iterator<Node> it = out.nodes.iterator();
     
    328328        Node n = new Node(9999999);
    329329        reader.append(n); // doesn't exist
    330         DataSet out = reader.parseOsm();
     330        DataSet out = reader.parseOsm(NullProgressMonitor.INSTANCE);
    331331        assertEquals(10, out.nodes.size());
    332332        Iterator<Node> it = out.nodes.iterator();
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java

    r1806 r1813  
    3131import org.openstreetmap.josm.data.osm.Way;
    3232import org.openstreetmap.josm.data.projection.Mercator;
    33 import org.openstreetmap.josm.gui.PleaseWaitDialog;
     33import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3434import org.xml.sax.SAXException;
    3535
     
    123123    /**
    124124     * creates the dataset on the server.
    125      * 
     125     *
    126126     * @param ds the data set
    127127     * @throws OsmTransferException
     
    134134        primitives.addAll(ds.relations);
    135135        OsmServerWriter writer = new OsmServerWriter();
    136         writer.uploadOsm("0.6", primitives);
     136        writer.uploadOsm("0.6", primitives, NullProgressMonitor.INSTANCE);
    137137    }
    138138
     
    182182        //
    183183        System.setProperty("josm.home", josmHome);
    184         Main.pleaseWaitDlg = new PleaseWaitDialog(null);
    185184        Main.pref.init(false);
    186185        // don't use atomic upload, the test API server can't cope with large diff uploads
     
    241240        ds = new DataSet();
    242241        FileInputStream fis = new FileInputStream(f);
    243         ds = OsmReader.parseDataSet(fis, Main.pleaseWaitDlg);
     242        ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
    244243        fis.close();
    245244    }
     
    254253        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(n);
    255254        reader.setReadFull(false);
    256         DataSet referers = reader.parseOsm();
     255        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    257256        assertEquals(10, referers.nodes.size());
    258257        assertEquals(1, referers.ways.size());
     
    273272        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(n);
    274273        reader.setReadFull(true);
    275         DataSet referers = reader.parseOsm();
     274        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    276275        assertEquals(10, referers.nodes.size());
    277276        assertEquals(1, referers.ways.size());
     
    293292        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(w);
    294293        reader.setReadFull(false);
    295         DataSet referers = reader.parseOsm();
     294        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    296295        assertEquals(0, referers.nodes.size()); // no nodes loaded
    297296        assertEquals(6, referers.ways.size());  // 6 ways referred by two relations
     
    317316        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(w);
    318317        reader.setReadFull(true);
    319         DataSet referers = reader.parseOsm();
     318        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    320319        assertEquals(6, referers.ways.size());  // 6 ways referred by two relations
    321320        for (Way w1: referers.ways) {
     
    352351        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(r);
    353352        reader.setReadFull(false);
    354         DataSet referers = reader.parseOsm();
     353        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    355354
    356355        Set<Long> referringRelationsIds = new HashSet<Long>();
     
    448447        OsmServerBackreferenceReader reader = new OsmServerBackreferenceReader(r);
    449448        reader.setReadFull(true);
    450         DataSet referers = reader.parseOsm();
     449        DataSet referers = reader.parseOsm(NullProgressMonitor.INSTANCE);
    451450
    452451        Set<Long> referringRelationsIds = new HashSet<Long>();
  • trunk/test/functional/org/openstreetmap/josm/io/OsmServerHistoryReaderTest.java

    r1703 r1813  
    88import org.openstreetmap.josm.data.osm.history.History;
    99import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
    10 import org.openstreetmap.josm.gui.PleaseWaitDialog;
     10import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1111
    1212public class OsmServerHistoryReaderTest {
     
    1515    public static void init() {
    1616        System.setProperty("josm.home", "C:\\data\\projekte\\osm\\tag-editor-plugin");
    17         Main.pleaseWaitDlg = new PleaseWaitDialog(null);
    1817        Main.pref.init(false);
    1918    }
     
    2221    public void test1()  throws OsmTransferException {
    2322        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.NODE,266187);
    24         HistoryDataSet ds = reader.parseHistory();
     23        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
    2524        History h = ds.getHistory(266187);
    2625        System.out.println("num versions: " + h.getNumVersions());
     
    3029    public void test2()  throws OsmTransferException {
    3130        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.WAY,32916);
    32         HistoryDataSet ds = reader.parseHistory();
     31        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
    3332        History h = ds.getHistory(32916);
    3433        System.out.println("num versions: " + h.getNumVersions());
     
    3837    public void test3()  throws OsmTransferException {
    3938        OsmServerHistoryReader reader = new OsmServerHistoryReader(OsmPrimitiveType.RELATION,49);
    40         HistoryDataSet ds = reader.parseHistory();
     39        HistoryDataSet ds = reader.parseHistory(NullProgressMonitor.INSTANCE);
    4140        History h = ds.getHistory(49);
    4241        System.out.println("num versions: " + h.getNumVersions());
Note: See TracChangeset for help on using the changeset viewer.