Changeset 9605 in josm for trunk/test/unit


Ignore:
Timestamp:
2016-01-24T02:40:28+01:00 (9 years ago)
Author:
Don-vip
Message:

see #11924 - use ISO date format in unit tests to avoid differences between JDK7/8 and 9

File:
1 edited

Legend:

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

    r9599 r9605  
    4646        host = new URL(serverUrl).getHost();
    4747        user = CredentialsManager.getInstance().getUsername();
     48        DateUtils.PROP_ISO_DATES.put(Boolean.TRUE);
    4849    }
    4950
     
    9596    @Test
    9697    public void testExplainChangesetClosedException() {
    97         // This test relies on the fact that CLDR is not the default local provider (see I18n.init)
    98         assertEquals("JRE,CLDR", System.getProperty("java.locale.providers"));
    99 
    10098        assertEquals("<html>Failed to upload to changeset <strong>0</strong><br>because it has already been closed on ?.",
    10199                ExceptionUtil.explainChangesetClosedException(new ChangesetClosedException("")));
    102100
    103         assertEquals("<html>Failed to upload to changeset <strong>1</strong><br>because it has already been closed on Jan 1, 2016 12:00:00 AM.",
     101        assertEquals("<html>Failed to upload to changeset <strong>1</strong><br>because it has already been closed on 2016-01-01 00:00:00.",
    104102                ExceptionUtil.explainChangesetClosedException(new ChangesetClosedException(1, DateUtils.fromString("2016-01-01"), null)));
    105103    }
     
    119117    @Test
    120118    public void testExplainConflict() {
    121         // This test relies on the fact that CLDR is not the default local provider (see I18n.init)
    122         assertEquals("JRE,CLDR", System.getProperty("java.locale.providers"));
    123 
    124119        int code = HttpURLConnection.HTTP_CONFLICT;
    125120        assertEquals("<html>The server reported that it has detected a conflict.</html>",
     
    129124        assertEquals("<html>Closing of changeset <strong>1</strong> failed <br>because it has already been closed.",
    130125                ExceptionUtil.explainConflict(new OsmApiException(code, "The changeset 1 was closed at xxx", "")));
    131         assertEquals("<html>Closing of changeset <strong>1</strong> failed<br> because it has already been closed on Jan 1, 2016 1:34:56 PM.",
     126        assertEquals("<html>Closing of changeset <strong>1</strong> failed<br> because it has already been closed on 2016-01-01 13:34:56.",
    132127                ExceptionUtil.explainConflict(new OsmApiException(code, "The changeset 1 was closed at 2016-01-01 12:34:56 UTC", "")));
    133128    }
Note: See TracChangeset for help on using the changeset viewer.