Changeset 14190 in josm for trunk/test/functional/org
- Timestamp:
- 2018-08-28T21:29:03+02:00 (6 years ago)
- Location:
- trunk/test/functional/org/openstreetmap/josm/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/io/MultiFetchServerObjectReaderTest.java
r12850 r14190 22 22 import java.util.logging.Logger; 23 23 24 import org.junit.Assume; 24 25 import org.junit.Before; 25 26 import org.junit.BeforeClass; … … 28 29 import org.junit.rules.Timeout; 29 30 import org.openstreetmap.josm.JOSMFixture; 31 import org.openstreetmap.josm.TestUtils; 30 32 import org.openstreetmap.josm.data.coor.LatLon; 31 33 import org.openstreetmap.josm.data.osm.Changeset; … … 150 152 @BeforeClass 151 153 public static void init() throws Exception { 154 if (!TestUtils.areCredentialsProvided()) { 155 logger.severe("OSM DEV API credentials not provided. Please define them with -Dosm.username and -Dosm.password"); 156 return; 157 } 152 158 logger.info("initializing ..."); 153 159 JOSMFixture.createFunctionalTestFixture().init(); … … 200 206 @Before 201 207 public void setUp() throws IOException, IllegalDataException, FileNotFoundException { 208 if (!TestUtils.areCredentialsProvided()) { 209 return; 210 } 202 211 File f = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 203 212 logger.info(MessageFormat.format("reading cached dataset ''{0}''", f.toString())); … … 214 223 @Test 215 224 public void testMultiGet10Nodes() throws OsmTransferException { 225 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 216 226 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 217 227 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); … … 235 245 @Test 236 246 public void testMultiGet10Ways() throws OsmTransferException { 247 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 237 248 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 238 249 ArrayList<Way> ways = new ArrayList<>(ds.getWays()); … … 257 268 @Test 258 269 public void testMultiGet10Relations() throws OsmTransferException { 270 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 259 271 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 260 272 ArrayList<Relation> relations = new ArrayList<>(ds.getRelations()); … … 279 291 @Test 280 292 public void testMultiGet800Nodes() throws OsmTransferException { 293 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 281 294 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 282 295 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); … … 300 313 @Test 301 314 public void testMultiGetWithNonExistingNode() throws OsmTransferException { 315 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 302 316 MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader(); 303 317 ArrayList<Node> nodes = new ArrayList<>(ds.getNodes()); -
trunk/test/functional/org/openstreetmap/josm/io/OsmServerBackreferenceReaderTest.java
r14120 r14190 22 22 import java.util.logging.Logger; 23 23 24 import org.junit.Assume; 24 25 import org.junit.Before; 25 26 import org.junit.BeforeClass; 26 27 import org.junit.Test; 27 28 import org.openstreetmap.josm.JOSMFixture; 29 import org.openstreetmap.josm.TestUtils; 28 30 import org.openstreetmap.josm.data.APIDataSet; 29 31 import org.openstreetmap.josm.data.coor.LatLon; … … 158 160 @BeforeClass 159 161 public static void setUpBeforeClass() throws OsmTransferException, CyclicUploadDependencyException, IOException { 162 if (!TestUtils.areCredentialsProvided()) { 163 logger.severe("OSM DEV API credentials not provided. Please define them with -Dosm.username and -Dosm.password"); 164 return; 165 } 160 166 logger.info("initializing ..."); 161 167 … … 213 219 @Before 214 220 public void setUp() throws IOException, IllegalDataException, FileNotFoundException { 221 if (!TestUtils.areCredentialsProvided()) { 222 return; 223 } 215 224 File f = new File(System.getProperty("java.io.tmpdir"), MultiFetchServerObjectReaderTest.class.getName() + ".dataset"); 216 225 logger.info(MessageFormat.format("reading cached dataset ''{0}''", f.toString())); … … 227 236 @Test 228 237 public void testBackreferenceForNode() throws OsmTransferException { 238 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 229 239 Node n = lookupNode(ds, 0); 230 240 assertNotNull(n); … … 284 294 @Test 285 295 public void testBackreferenceForNodeFull() throws OsmTransferException { 296 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 286 297 Node n = lookupNode(ds, 0); 287 298 assertNotNull(n); … … 332 343 @Test 333 344 public void testBackreferenceForWay() throws OsmTransferException { 345 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 334 346 Way w = lookupWay(ds, 1); 335 347 assertNotNull(w); … … 376 388 @Test 377 389 public void testBackreferenceForWayFull() throws OsmTransferException { 390 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 378 391 Way w = lookupWay(ds, 1); 379 392 assertNotNull(w); … … 414 427 @Test 415 428 public void testBackreferenceForRelation() throws OsmTransferException { 429 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 416 430 Relation r = lookupRelation(ds, 1); 417 431 assertNotNull(r); … … 533 547 @Test 534 548 public void testBackreferenceForRelationFull() throws OsmTransferException { 549 Assume.assumeTrue(TestUtils.areCredentialsProvided()); 535 550 Relation r = lookupRelation(ds, 1); 536 551 assertNotNull(r);
Note:
See TracChangeset
for help on using the changeset viewer.