Ignore:
Timestamp:
2016-11-26T23:45:05+01:00 (7 years ago)
Author:
wiktorn
Message:

Better handle of null in readBytesFromStream.

See: #14033

File:
1 edited

Legend:

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

    r11241 r11320  
    33
    44import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertNull;
    56
     7import java.io.IOException;
    68import java.util.Arrays;
    79import java.util.Collections;
     
    162164        assertEquals("<ul></ul>", Utils.joinAsHtmlUnorderedList(Collections.emptyList()));
    163165    }
     166
     167    /**
     168     * Tests if readBytesFromStream handles null streams (might happen when there is no data on error stream)
     169     * @throws IOException
     170     *
     171     */
     172    @Test
     173    public void testNullStreamForReadBytesFromStream() throws IOException {
     174        assertNull("Null on null stream", Utils.readBytesFromStream(null));
     175    }
     176
    164177}
Note: See TracChangeset for help on using the changeset viewer.