Changeset 11251 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-11-13T13:14:40+01:00 (8 years ago)
Author:
wiktorn
Message:

Do not timeout when run with Eclipse debugger

File:
1 edited

Legend:

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

    r11110 r11251  
    3535 */
    3636public class JOSMTestRules implements TestRule {
    37     private int timeout = 10 * 1000;
     37    private int timeout = isDebugMode() ? -1 : 10 * 1000;
    3838    private TemporaryFolder josmHome;
    3939    private boolean usePreferences = false;
     
    6060     */
    6161    public JOSMTestRules timeout(int millis) {
    62         timeout = millis;
     62        timeout = isDebugMode() ? -1 : millis;
    6363        return this;
    6464    }
     
    353353        }
    354354    }
     355
     356    private boolean isDebugMode() {
     357        return java.lang.management.ManagementFactory.getRuntimeMXBean().
     358                getInputArguments().toString().indexOf("-agentlib:jdwp") > 0;
     359    }
    355360}
Note: See TracChangeset for help on using the changeset viewer.