mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_Physical.java
@Test
    public void testRequestPhysicalLinkUuidInUse() throws FactoryException, IllegalArgumentException, 
        FactoryObjectInformationException, CCommException
    {
        //mocking
        when(m_PhysRegistry.getObjectByUuid(m_PhysUuidUno)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(true);
        
        //request
        try
        {
            m_SUT.requestPhysicalLink(m_PhysUuidUno);
            fail("Expected exception due to mocking.");
        }
        catch (IllegalStateException e)
        {
            //expected exception
        }
    }
/**
     * Verify exception if a physical link is requested using a uuid and the layer is in use.
     */
Verify exception if a physical link is requested using a uuid and the layer is in use.
Verify exception if a physical link is requested using a uuid and the layer is in use .
@Test
    public void testRequestPhysicalLinkUuidInUse() throws FactoryException, IllegalArgumentException, 
        FactoryObjectInformationException, CCommException
    {
        when(m_PhysRegistry.getObjectByUuid(m_PhysUuidUno)).thenReturn(m_PhysInternal);
        when(m_PhysInternal.isInUse()).thenReturn(true);
        try
        {
            m_SUT.requestPhysicalLink(m_PhysUuidUno);
            fail("Expected exception due to mocking.");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testRequestPhysicalLinkUuidInUse ( ) throws FactoryException , IllegalArgumentException , FactoryObjectInformationException , CCommException { when ( m_PhysRegistry . getObjectByUuid ( m_PhysUuidUno ) ) . thenReturn ( m_PhysInternal ) ; when ( m_PhysInternal . isInUse ( ) ) . thenReturn ( true ) ; try { m_SUT . requestPhysicalLink ( m_PhysUuidUno ) ; fail ( "Expected exception due to mocking." ) ; } catch ( IllegalStateException e ) { } }
Verify exception if a physical link is requested using a uuid and the layer is in use.
Verify exception if a physical link is requested using a uuid and the layer is in use .
//mocking //request //expected exception