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