Last change
on this file since 225 was 225, checked in by framm, 18 years ago |
bumped default for API version to 0.4. old 0.3 can still be set using osm-server.version preference.
|
File size:
1.2 KB
|
Line | |
---|
1 | package org.openstreetmap.josm.io;
|
---|
2 |
|
---|
3 | import java.io.ByteArrayInputStream;
|
---|
4 | import java.io.InputStream;
|
---|
5 | import java.util.LinkedList;
|
---|
6 |
|
---|
7 | import org.openstreetmap.josm.Main;
|
---|
8 | import org.openstreetmap.josm.data.osm.Segment;
|
---|
9 | import org.openstreetmap.josm.data.osm.Way;
|
---|
10 | import org.openstreetmap.josm.gui.PleaseWaitDialog;
|
---|
11 | import org.openstreetmap.josm.testframework.Bug;
|
---|
12 | import org.openstreetmap.josm.testframework.MotherObject;
|
---|
13 |
|
---|
14 | public class IncompleteDownloaderTest extends MotherObject {
|
---|
15 |
|
---|
16 |
|
---|
17 | @Bug(174)
|
---|
18 | public void testDownloadDoesNotWriteToMainDataDirectly() throws Exception {
|
---|
19 | LinkedList<Way> l = new LinkedList<Way>();
|
---|
20 | Way w = new Way();
|
---|
21 | w.segments.add(new Segment(23)); // incomplete segment
|
---|
22 | Main.ds.nodes.add(createNode(1));
|
---|
23 | Main.ds.nodes.add(createNode(2));
|
---|
24 | l.add(w);
|
---|
25 | IncompleteDownloader downloader = new IncompleteDownloader(l) {
|
---|
26 | @Override protected InputStream getInputStream(String urlStr, PleaseWaitDialog pleaseWaitDlg) {
|
---|
27 | String xml = "<osm version='0.4'><segment id='23' from='1' to='2'/></osm>";
|
---|
28 | return new ByteArrayInputStream(xml.getBytes());
|
---|
29 | }
|
---|
30 | };
|
---|
31 |
|
---|
32 | Main.pleaseWaitDlg = new PleaseWaitDialog(null);
|
---|
33 |
|
---|
34 | downloader.parse();
|
---|
35 |
|
---|
36 | assertEquals("Does not directly write to main data", 0, Main.ds.segments.size());
|
---|
37 | }
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.