edu.udayton.udri.asset.novatel/test/edu/udayton/udri/asset/novatel/impl/connection/TestNovatelConnectionMgrImpl.java
@Test
    public void testStartProcessingFailCreateLink() throws IllegalArgumentException, CCommException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        
        doThrow(IllegalStateException.class).when(m_CustomCommService).requestPhysicalLink(m_UUID);
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("CustomCommsService request physical link method should throw an illegal state exception that will be "
                    + "caught and wrapped in an asset exception.");
        }
        catch (final AssetException exception)
        {
            //expected exception
        }
        
        doThrow(CCommException.class).when(m_CustomCommService).tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, 
                m_PhysPort);
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("CustomCommsService try create physical link method should throw an ccomm exception that will be "
                    + "caught and wrapped in an asset exception.");
        }
        catch (final AssetException exception)
        {
            //expected exception
        }
    }
/**
     * Verify the start processing method throws an asset exception if the serial port cannot be created or retrieved
     * from the custom comms service.
     */
Verify the start processing method throws an asset exception if the serial port cannot be created or retrieved
from the custom comms service.
Verify the start processing method throws an asset exception if the serial port cannot be created or retrieved from the custom comms service .
@Test
    public void testStartProcessingFailCreateLink() throws IllegalArgumentException, CCommException
    {
        when(m_CustomCommService.tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, m_PhysPort)).
            thenReturn(m_UUID);
        doThrow(IllegalStateException.class).when(m_CustomCommService).requestPhysicalLink(m_UUID);
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("CustomCommsService request physical link method should throw an illegal state exception that will be "
                    + "caught and wrapped in an asset exception.");
        }
        catch (final AssetException exception)
        {
        }
        doThrow(CCommException.class).when(m_CustomCommService).tryCreatePhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT, 
                m_PhysPort);
        try
        {
            m_SUT.startProcessing(m_PhysPort, m_BaudRate);
            fail("CustomCommsService try create physical link method should throw an ccomm exception that will be "
                    + "caught and wrapped in an asset exception.");
        }
        catch (final AssetException exception)
        {
        }
    }
@ Test public void testStartProcessingFailCreateLink ( ) throws IllegalArgumentException , CCommException { when ( m_CustomCommService . tryCreatePhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , m_PhysPort ) ) . thenReturn ( m_UUID ) ; doThrow ( IllegalStateException . class ) . when ( m_CustomCommService ) . requestPhysicalLink ( m_UUID ) ; try { m_SUT . startProcessing ( m_PhysPort , m_BaudRate ) ; fail ( "CustomCommsService request physical link method should throw an illegal state exception that will be " + "caught and wrapped in an asset exception." ) ; } catch ( final AssetException exception ) { } doThrow ( CCommException . class ) . when ( m_CustomCommService ) . tryCreatePhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT , m_PhysPort ) ; try { m_SUT . startProcessing ( m_PhysPort , m_BaudRate ) ; fail ( "CustomCommsService try create physical link method should throw an ccomm exception that will be " + "caught and wrapped in an asset exception." ) ; } catch ( final AssetException exception ) { } }
Verify the start processing method throws an asset exception if the serial port cannot be created or retrieved
 from the custom comms service.
Verify the start processing method throws an asset exception if the serial port cannot be created or retrieved from the custom comms service .
//expected exception //expected exception