edu.udayton.udri.asset.canon.ipcamera/test/edu/udayton/udri/asset/canon/ipcamera/TestIpCameraAsset.java
@Test
    public void testUpdatedIoException2() throws AssetException, IOException
    {
        m_SUT.onActivate();
        Map<String, Object> props = new HashMap<>();
        props.put(IpCameraAssetAttributes.IP, "https://192.186.1.55/-wvhttp-01-/");
        URLConnection urlCon = mock(URLConnection.class);
        when(m_UrlUtil.getConnection(any(URL.class))).thenReturn(urlCon);
        when(m_UrlUtil.getInputStream(any(URLConnection.class))).thenThrow(new IOException());
        m_SUT.updated(props);
        
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
//Catches the IO exception when the Update method creates an Input Stream to the URL.
Catches the IO exception when the Update method creates an Input Stream to the URL.
Catches the IO exception when the Update method creates an Input Stream to the URL .
@Test
    public void testUpdatedIoException2() throws AssetException, IOException
    {
        m_SUT.onActivate();
        Map<String, Object> props = new HashMap<>();
        props.put(IpCameraAssetAttributes.IP, "https://192.186.1.55/-wvhttp-01-/");
        URLConnection urlCon = mock(URLConnection.class);
        when(m_UrlUtil.getConnection(any(URL.class))).thenReturn(urlCon);
        when(m_UrlUtil.getInputStream(any(URLConnection.class))).thenThrow(new IOException());
        m_SUT.updated(props);
        verify(m_WakeLock).activate();
        verify(m_WakeLock).cancel();
    }
@ Test public void testUpdatedIoException2 ( ) throws AssetException , IOException { m_SUT . onActivate ( ) ; Map < String , Object > props = new HashMap < > ( ) ; props . put ( IpCameraAssetAttributes . IP , "https://192.186.1.55/-wvhttp-01-/" ) ; URLConnection urlCon = mock ( URLConnection . class ) ; when ( m_UrlUtil . getConnection ( any ( URL . class ) ) ) . thenReturn ( urlCon ) ; when ( m_UrlUtil . getInputStream ( any ( URLConnection . class ) ) ) . thenThrow ( new IOException ( ) ) ; m_SUT . updated ( props ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_WakeLock ) . cancel ( ) ; }
Catches the IO exception when the Update method creates an Input Stream to the URL.
Catches the IO exception when the Update method creates an Input Stream to the URL .