mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestLinkLayerRegistryCallback.java
@Test
    public void testOnRemovedObject_InactiveLayer()
    {
        LinkLayerInternal linkInternal = mock(LinkLayerInternal.class);
        when(linkInternal.isActivated()).thenReturn(false);
        PhysicalLink phys = mock(PhysicalLink.class);
        when(phys.getName()).thenReturn("bob");
        when(linkInternal.getPhysicalLink()).thenReturn(phys);
        
        m_SUT.onRemovedObject(linkInternal);
        
        verify(phys).release();
        verify(linkInternal, never()).deactivateLayer();
    }
/**
     * Verify release of physical link when the object is removed.
     */
Verify release of physical link when the object is removed.
Verify release of physical link when the object is removed .
@Test
    public void testOnRemovedObject_InactiveLayer()
    {
        LinkLayerInternal linkInternal = mock(LinkLayerInternal.class);
        when(linkInternal.isActivated()).thenReturn(false);
        PhysicalLink phys = mock(PhysicalLink.class);
        when(phys.getName()).thenReturn("bob");
        when(linkInternal.getPhysicalLink()).thenReturn(phys);
        m_SUT.onRemovedObject(linkInternal);
        verify(phys).release();
        verify(linkInternal, never()).deactivateLayer();
    }
@ Test public void testOnRemovedObject_InactiveLayer ( ) { LinkLayerInternal linkInternal = mock ( LinkLayerInternal . class ) ; when ( linkInternal . isActivated ( ) ) . thenReturn ( false ) ; PhysicalLink phys = mock ( PhysicalLink . class ) ; when ( phys . getName ( ) ) . thenReturn ( "bob" ) ; when ( linkInternal . getPhysicalLink ( ) ) . thenReturn ( phys ) ; m_SUT . onRemovedObject ( linkInternal ) ; verify ( phys ) . release ( ) ; verify ( linkInternal , never ( ) ) . deactivateLayer ( ) ; }
Verify release of physical link when the object is removed.
Verify release of physical link when the object is removed .