edu.udayton.udri.asset.axis/test/edu/udayton/udri/asset/axis/TestAxisAsset.java
@Test
    public void testGetPanTiltException() throws AssetException, IOException, IllegalStateException, 
        InterruptedException
    {
        when(m_UrlService.constructUrlConnection(m_UrlString)).thenThrow(new IOException("hut"));
        
        //mock behavior
        when(m_CommandProcessor.processGetPanTilt(m_Ip)).thenReturn(m_UrlString);
        
        //process the command
        try
        {
            m_SUT.onExecuteCommand(new GetPanTiltCommand());
            fail("expecting exception");
        }
        catch (CommandExecutionException e)
        {
            //expecting exception
        }
    }
/**
     * Verify get pan/tilt command exception handling.
     */
Verify get pan/tilt command exception handling.
Verify get pan / tilt command exception handling .
@Test
    public void testGetPanTiltException() throws AssetException, IOException, IllegalStateException, 
        InterruptedException
    {
        when(m_UrlService.constructUrlConnection(m_UrlString)).thenThrow(new IOException("hut"));
        when(m_CommandProcessor.processGetPanTilt(m_Ip)).thenReturn(m_UrlString);
        try
        {
            m_SUT.onExecuteCommand(new GetPanTiltCommand());
            fail("expecting exception");
        }
        catch (CommandExecutionException e)
        {
        }
    }
@ Test public void testGetPanTiltException ( ) throws AssetException , IOException , IllegalStateException , InterruptedException { when ( m_UrlService . constructUrlConnection ( m_UrlString ) ) . thenThrow ( new IOException ( "hut" ) ) ; when ( m_CommandProcessor . processGetPanTilt ( m_Ip ) ) . thenReturn ( m_UrlString ) ; try { m_SUT . onExecuteCommand ( new GetPanTiltCommand ( ) ) ; fail ( "expecting exception" ) ; } catch ( CommandExecutionException e ) { } }
Verify get pan/tilt command exception handling.
Verify get pan / tilt command exception handling .
//mock behavior //process the command //expecting exception