mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/transport/TestTransportLayerImpl.java
@Test
    public void testDelete_LinkLayerActivated() throws Exception
    {
        initTransportLayer(false);
        
        LinkLayer linkLayer = mock(LinkLayer.class);
        m_SUT.setLinkLayer(linkLayer);
        when(linkLayer.isActivated()).thenReturn(true);
        
        try
        {
            m_SUT.delete();
            fail("Should fail to delete as link layer is activated");
        }
        catch (IllegalStateException e)
        {
            
        }
        verify(m_FactReg, never()).delete(Mockito.any(FactoryObjectInternal.class));
        verify(m_PowManInternal, never()).deleteWakeLock(m_WakeLock);
    }
/**
     * Verify the transport layer is not removed if link layer is active.
     */
Verify the transport layer is not removed if link layer is active.
Verify the transport layer is not removed if link layer is active .
@Test
    public void testDelete_LinkLayerActivated() throws Exception
    {
        initTransportLayer(false);
        LinkLayer linkLayer = mock(LinkLayer.class);
        m_SUT.setLinkLayer(linkLayer);
        when(linkLayer.isActivated()).thenReturn(true);
        try
        {
            m_SUT.delete();
            fail("Should fail to delete as link layer is activated");
        }
        catch (IllegalStateException e)
        {
        }
        verify(m_FactReg, never()).delete(Mockito.any(FactoryObjectInternal.class));
        verify(m_PowManInternal, never()).deleteWakeLock(m_WakeLock);
    }
@ Test public void testDelete_LinkLayerActivated ( ) throws Exception { initTransportLayer ( false ) ; LinkLayer linkLayer = mock ( LinkLayer . class ) ; m_SUT . setLinkLayer ( linkLayer ) ; when ( linkLayer . isActivated ( ) ) . thenReturn ( true ) ; try { m_SUT . delete ( ) ; fail ( "Should fail to delete as link layer is activated" ) ; } catch ( IllegalStateException e ) { } verify ( m_FactReg , never ( ) ) . delete ( Mockito . any ( FactoryObjectInternal . class ) ) ; verify ( m_PowManInternal , never ( ) ) . deleteWakeLock ( m_WakeLock ) ; }
Verify the transport layer is not removed if link layer is active.
Verify the transport layer is not removed if link layer is active .