void function ( ) { String loc0 = "srini_string" ; when ( mHttpConMock . getOutputStream ( ) ) . thenThrow ( new IOException ( loc0 ) ) ; mThrown . expect ( IOException . class ) ; mThrown . expectMessage ( loc0 ) ; new SwiftOutputStream ( mHttpConMock ) . close ( ) ; }
tests to ensure ioexception is thrown if httpurlconnection #getoutputstream throws anioexception . concode_field_sep OutputStream mOutputStreamMock concode_elem_sep HttpURLConnection mHttpConMock concode_elem_sep ExpectedException mThrown concode_field_sep void testCloseError concode_elem_sep void testCloseSuccess concode_elem_sep void before concode_elem_sep void testFlush concode_elem_sep void testWrite3 concode_elem_sep void testWrite1 concode_elem_sep void testWrite2