Changeset 9841 in josm for trunk/test/unit/org
- Timestamp:
- 2016-02-20T01:34:07+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanelTest.java
r9669 r9841 2 2 package org.openstreetmap.josm.gui.io; 3 3 4 import static org.junit.Assert.assert NotNull;4 import static org.junit.Assert.assertEquals; 5 5 6 6 import org.junit.BeforeClass; 7 7 import org.junit.Test; 8 8 import org.openstreetmap.josm.JOSMFixture; 9 import org.openstreetmap.josm.Main; 10 import org.openstreetmap.josm.io.OsmApi; 11 import org.openstreetmap.josm.io.OsmApiInitializationException; 12 import org.openstreetmap.josm.io.OsmTransferCanceledException; 9 13 10 14 /** … … 19 23 public static void setUpBeforeClass() { 20 24 JOSMFixture.createUnitTestFixture().init(); 25 try { 26 OsmApi.getOsmApi().initialize(null); 27 } catch (OsmTransferCanceledException | OsmApiInitializationException e) { 28 Main.error(e); 29 } 21 30 } 22 31 … … 26 35 @Test 27 36 public void testUploadStrategySelectionPanel() { 28 assertNotNull(new UploadStrategySelectionPanel()); 37 UploadStrategySelectionPanel p = new UploadStrategySelectionPanel(); 38 p.setNumUploadedObjects(Integer.MAX_VALUE); 39 p.rememberUserInput(); 40 p.initFromPreferences(); 41 p.initEditingOfChunkSize(); 42 } 43 44 /** 45 * Test of {@link UploadStrategySelectionPanel#setUploadStrategySpecification} 46 * / {@link UploadStrategySelectionPanel#getUploadStrategySpecification}. 47 */ 48 @Test 49 public void testUploadStrategySpecification() { 50 UploadStrategySelectionPanel p = new UploadStrategySelectionPanel(); 51 52 UploadStrategySpecification def = new UploadStrategySpecification(); 53 assertEquals(def, p.getUploadStrategySpecification()); 54 p.setUploadStrategySpecification(null); 55 assertEquals(def, p.getUploadStrategySpecification()); 56 57 UploadStrategySpecification strat = new UploadStrategySpecification().setStrategy(UploadStrategy.INDIVIDUAL_OBJECTS_STRATEGY); 58 p.setUploadStrategySpecification(strat); 59 assertEquals(strat, p.getUploadStrategySpecification()); 29 60 } 30 61 }
Note:
See TracChangeset
for help on using the changeset viewer.