Changeset 14190 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2018-08-28T21:29:03+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16688 - skip some unit tests if preconditions are not met

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r14158 r14190  
    533533        return new Reflections("org.openstreetmap.josm").getSubTypesOf(superClass);
    534534    }
     535
     536    /**
     537     * Determines if OSM DEV_API credential have been provided. Required for functional tests.
     538     * @return {@code true} if {@code osm.username} and {@code osm.password} have been defined on the command line
     539     */
     540    public static boolean areCredentialsProvided() {
     541        return Utils.getSystemProperty("osm.username") != null && Utils.getSystemProperty("osm.password") != null;
     542    }
    535543}
  • trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java

    r14138 r14190  
    66import static org.junit.Assert.assertNotNull;
    77import static org.junit.Assert.assertTrue;
    8 import static org.junit.Assert.fail;
    98
    109import java.io.File;
    1110import java.io.IOException;
    1211
     12import org.junit.Assume;
    1313import org.junit.BeforeClass;
    1414import org.junit.Test;
     
    6363    @Test
    6464    public void testOpenUrl() throws IOException {
    65         if (!PlatformManager.isPlatformWindows()) {
    66             hook.openUrl(Config.getUrls().getJOSMWebsite());
    67         } else {
    68             try {
    69                 hook.openUrl(Config.getUrls().getJOSMWebsite());
    70                 fail("Expected IOException");
    71             } catch (IOException e) {
    72                 Logging.info(e.getMessage());
    73             }
    74         }
     65        Assume.assumeTrue(PlatformManager.isPlatformOsx());
     66        hook.openUrl(Config.getUrls().getJOSMWebsite());
    7567    }
    7668
Note: See TracChangeset for help on using the changeset viewer.