edu.udayton.udri.asset.canon.ipcamera/test/edu/udayton/udri/asset/canon/ipcamera/TestIpCameraAsset.java
@Test(expected = CommandExecutionException.class)
    public void testGetCameraSettingsIOException1() throws IOException, InterruptedException, AssetException
    {
        m_SUT.onActivate();
        GetCameraSettingsCommand fakeGetCameraSettings = new GetCameraSettingsCommand();
        when(m_Context.getActiveStatus()).thenReturn(AssetActiveStatus.ACTIVATED);
        when(m_UrlUtil.getConnection(any(URL.class))).thenThrow(new IOException());
        m_SUT.onExecuteCommand(fakeGetCameraSettings);  
    }
//Catches the IO exception when getCameraSettings tries to create a URL connection to the URL
Catches the IO exception when getCameraSettings tries to create a URL connection to the URL
Catches the IO exception when getCameraSettings tries to create a URL connection to the URL
@Test(expected = CommandExecutionException.class)
    public void testGetCameraSettingsIOException1() throws IOException, InterruptedException, AssetException
    {
        m_SUT.onActivate();
        GetCameraSettingsCommand fakeGetCameraSettings = new GetCameraSettingsCommand();
        when(m_Context.getActiveStatus()).thenReturn(AssetActiveStatus.ACTIVATED);
        when(m_UrlUtil.getConnection(any(URL.class))).thenThrow(new IOException());
        m_SUT.onExecuteCommand(fakeGetCameraSettings);  
    }
@ Test ( expected = CommandExecutionException . class ) public void testGetCameraSettingsIOException1 ( ) throws IOException , InterruptedException , AssetException { m_SUT . onActivate ( ) ; GetCameraSettingsCommand fakeGetCameraSettings = new GetCameraSettingsCommand ( ) ; when ( m_Context . getActiveStatus ( ) ) . thenReturn ( AssetActiveStatus . ACTIVATED ) ; when ( m_UrlUtil . getConnection ( any ( URL . class ) ) ) . thenThrow ( new IOException ( ) ) ; m_SUT . onExecuteCommand ( fakeGetCameraSettings ) ; }
Catches the IO exception when getCameraSettings tries to create a URL connection to the URL
Catches the IO exception when getCameraSettings tries to create a URL connection to the URL