Changeset 7076 in josm for trunk/test/unit/org/openstreetmap


Ignore:
Timestamp:
2014-05-08T02:54:38+02:00 (11 years ago)
Author:
Don-vip
Message:

fix unit test on system with non-english locale + javadoc

File:
1 edited

Legend:

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

    r7030 r7076  
    66
    77import java.io.BufferedReader;
     8import java.io.IOException;
    89import java.net.URL;
    910import java.util.Arrays;
    10 import java.util.Locale;
    1111
    1212import org.junit.Assert;
     
    7676    }
    7777
     78    /**
     79     * Test of {@link Utils#openURLReaderAndDecompress} method with Gzip compression.
     80     * @throws IOException if any I/O error occurs
     81     */
    7882    @Test
    79     public void testOpenUrlGzip() throws Exception {
     83    public void testOpenUrlGzip() throws IOException {
    8084        Main.initApplicationPreferences();
    8185        try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/1613906/data"), true)) {
     
    8488    }
    8589
     90    /**
     91     * Test of {@link Utils#openURLReaderAndDecompress} method with Bzip compression.
     92     * @throws IOException if any I/O error occurs
     93     */
    8694    @Test
    87     public void testOpenUrlBzip() throws Exception {
     95    public void testOpenUrlBzip() throws IOException {
    8896        Main.initApplicationPreferences();
    8997        try (BufferedReader x = Utils.openURLReaderAndDecompress(new URL("https://www.openstreetmap.org/trace/785544/data"), true)) {
     
    92100    }
    93101
     102    /**
     103     * Test of {@link Utils#getPositionListString} method.
     104     */
    94105    @Test
    95     public void testPositionListString() throws Exception {
     106    public void testPositionListString() {
    96107        assertThat(Utils.getPositionListString(Arrays.asList(1)), is("1"));
    97108        assertThat(Utils.getPositionListString(Arrays.asList(1, 2, 3)), is("1-3"));
     
    101112    }
    102113
     114    /**
     115     * Test of {@link Utils#getDurationString} method.
     116     */
    103117    @Test
    104     public void testDurationString() throws Exception {
    105         Locale.setDefault(Locale.ENGLISH);
     118    public void testDurationString() {
     119        I18n.set("en");
    106120        assertThat(Utils.getDurationString(123), is("123 ms"));
    107121        assertThat(Utils.getDurationString(1234), is("1.2 s"));
Note: See TracChangeset for help on using the changeset viewer.