- Timestamp:
- 2009-12-09T21:26:36+01:00 (15 years ago)
- Location:
- trunk/test/functional/org/openstreetmap/josm
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r2569 r2600 32 32 import org.openstreetmap.josm.data.osm.Way; 33 33 import org.openstreetmap.josm.data.projection.Mercator; 34 import org.openstreetmap.josm.gui.io.UploadStrategy; 34 35 import org.openstreetmap.josm.gui.io.UploadStrategySpecification; 35 36 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 125 126 OsmServerWriter writer = new OsmServerWriter(); 126 127 Changeset cs = new Changeset(); 127 writer.uploadOsm( UploadStrategySpecification.createSingleRequestUploadStrategy(), primitives,cs,NullProgressMonitor.INSTANCE);128 writer.uploadOsm(new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY), primitives,cs,NullProgressMonitor.INSTANCE); 128 129 OsmApi.getOsmApi().closeChangeset(cs, NullProgressMonitor.INSTANCE); 129 130 } -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r2578 r2600 33 33 import org.openstreetmap.josm.data.osm.Way; 34 34 import org.openstreetmap.josm.data.projection.Mercator; 35 import org.openstreetmap.josm.gui.io.UploadStrategy; 35 36 import org.openstreetmap.josm.gui.io.UploadStrategySpecification; 36 37 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 129 130 OsmServerWriter writer = new OsmServerWriter(); 130 131 Changeset cs = new Changeset(); 131 writer.uploadOsm( UploadStrategySpecification.createSingleRequestUploadStrategy(), primitives, cs, NullProgressMonitor.INSTANCE);132 writer.uploadOsm(new UploadStrategySpecification().setStrategy(UploadStrategy.SINGLE_REQUEST_STRATEGY), primitives, cs, NullProgressMonitor.INSTANCE); 132 133 OsmApi.getOsmApi().closeChangeset(cs, NullProgressMonitor.INSTANCE); 133 134 } -
trunk/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java
r2569 r2600 3 3 4 4 import java.awt.BorderLayout; 5 import java.awt.FlowLayout; 6 import java.awt.event.ActionEvent; 7 import java.awt.event.ActionListener; 5 8 6 9 import javax.swing.JFrame; 10 import javax.swing.JLabel; 11 import javax.swing.JPanel; 12 import javax.swing.JTextField; 7 13 14 import org.openstreetmap.josm.fixtures.JOSMFixture; 8 15 import org.openstreetmap.josm.gui.io.UploadStrategySelectionPanel; 16 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 9 17 10 18 public class UploadStrategySelectionPanelTest extends JFrame { 11 19 12 private UploadStrategySelectionPanel pnl;20 private UploadStrategySelectionPanel uploadStrategySelectionPanel; 13 21 14 22 protected void build() { 15 23 getContentPane().setLayout(new BorderLayout()); 16 pnl = new UploadStrategySelectionPanel(); 17 getContentPane().add(pnl, BorderLayout.CENTER); 24 uploadStrategySelectionPanel = new UploadStrategySelectionPanel(); 25 getContentPane().add(uploadStrategySelectionPanel, BorderLayout.CENTER); 26 getContentPane().add(buildControlPanel(), BorderLayout.SOUTH); 18 27 setSize(400,400); 19 28 } 20 29 30 31 protected JPanel buildControlPanel() { 32 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT)); 33 pnl.add(new JLabel("Num objects:")); 34 final JTextField tf; 35 pnl.add(tf = new JTextField(8)); 36 tf.addActionListener( 37 new ActionListener() { 38 public void actionPerformed(ActionEvent arg0) { 39 int n = 0; 40 try { 41 n = Integer.parseInt(tf.getText()); 42 } catch(NumberFormatException e) { 43 e.printStackTrace(); 44 return; 45 } 46 uploadStrategySelectionPanel.setNumUploadedObjects(n); 47 } 48 } 49 ); 50 return pnl; 51 } 21 52 public UploadStrategySelectionPanelTest() { 22 53 build(); 23 pnl.setNumUploadedObjects(1500);54 uploadStrategySelectionPanel.setNumUploadedObjects(51000); 24 55 } 25 56 26 public static void main(String args[]) { 57 public static void main(String args[]) throws OsmApiInitializationException { 58 JOSMFixture josmFixture = JOSMFixture.createFunctionalTestFixture(); 59 OsmApi.getOsmApi().initialize(NullProgressMonitor.INSTANCE); 27 60 new UploadStrategySelectionPanelTest().setVisible(true); 28 61 }
Note:
See TracChangeset
for help on using the changeset viewer.