edu.udayton.udri.asset.canon.ipcamera/test/edu/udayton/udri/asset/canon/ipcamera/TestIpCameraAsset.java
@Test(expected = CommandExecutionException.class)
    public void testCaptureDataIoException2() throws IOException, InterruptedException, AssetException
    {
        m_SUT.onActivate();
        URLConnection connection = mock(URLConnection.class);
        when(m_Context.getActiveStatus()).thenReturn(AssetActiveStatus.ACTIVATED);
        when(m_UrlUtil.getConnection(any(URL.class))).thenReturn(connection);
        when(m_UrlUtil.getInputStream(any(URLConnection.class))).thenThrow(new IOException());
        m_SUT.onCaptureData();
    }
//Catches IO exception when Capture data tries to make an Input Stream from the connection
Catches IO exception when Capture data tries to make an Input Stream from the connection
Catches IO exception when Capture data tries to make an Input Stream from the connection
@Test(expected = CommandExecutionException.class)
    public void testCaptureDataIoException2() throws IOException, InterruptedException, AssetException
    {
        m_SUT.onActivate();
        URLConnection connection = mock(URLConnection.class);
        when(m_Context.getActiveStatus()).thenReturn(AssetActiveStatus.ACTIVATED);
        when(m_UrlUtil.getConnection(any(URL.class))).thenReturn(connection);
        when(m_UrlUtil.getInputStream(any(URLConnection.class))).thenThrow(new IOException());
        m_SUT.onCaptureData();
    }
@ Test ( expected = CommandExecutionException . class ) public void testCaptureDataIoException2 ( ) throws IOException , InterruptedException , AssetException { m_SUT . onActivate ( ) ; URLConnection connection = mock ( URLConnection . class ) ; when ( m_Context . getActiveStatus ( ) ) . thenReturn ( AssetActiveStatus . ACTIVATED ) ; when ( m_UrlUtil . getConnection ( any ( URL . class ) ) ) . thenReturn ( connection ) ; when ( m_UrlUtil . getInputStream ( any ( URLConnection . class ) ) ) . thenThrow ( new IOException ( ) ) ; m_SUT . onCaptureData ( ) ; }
Catches IO exception when Capture data tries to make an Input Stream from the connection
Catches IO exception when Capture data tries to make an Input Stream from the connection