mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/transport/TestTransportLayerImpl.java
@Test
    public void testDisconnect() throws IllegalStateException, CCommException
    {
        initTransportLayer(true); // connection oriented

        //act
        m_SUT.disconnect();
        
        //verify
        verify(m_WakeLock).activate();
        verify(m_TransportLayerProxy).disconnect();
        verify(m_WakeLock).cancel();

        try
        {
            doThrow(new IllegalStateException("Not connected")).when(m_TransportLayerProxy).disconnect();

            m_SUT.disconnect();
            fail("Expected IllegalStateException not thrown.");
        }
        catch (IllegalStateException e)
        {
            //verify
            verify(m_WakeLock, times(2)).activate();
            verify(m_WakeLock, times(2)).cancel();
        }
    }
/**
     * Verify ability to disconnect a transport layer.
     */
Verify ability to disconnect a transport layer.
Verify ability to disconnect a transport layer .
@Test
    public void testDisconnect() throws IllegalStateException, CCommException
    {
        initTransportLayer(true); 
        m_SUT.disconnect();
        verify(m_WakeLock).activate();
        verify(m_TransportLayerProxy).disconnect();
        verify(m_WakeLock).cancel();
        try
        {
            doThrow(new IllegalStateException("Not connected")).when(m_TransportLayerProxy).disconnect();
            m_SUT.disconnect();
            fail("Expected IllegalStateException not thrown.");
        }
        catch (IllegalStateException e)
        {
            verify(m_WakeLock, times(2)).activate();
            verify(m_WakeLock, times(2)).cancel();
        }
    }
@ Test public void testDisconnect ( ) throws IllegalStateException , CCommException { initTransportLayer ( true ) ; m_SUT . disconnect ( ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_TransportLayerProxy ) . disconnect ( ) ; verify ( m_WakeLock ) . cancel ( ) ; try { doThrow ( new IllegalStateException ( "Not connected" ) ) . when ( m_TransportLayerProxy ) . disconnect ( ) ; m_SUT . disconnect ( ) ; fail ( "Expected IllegalStateException not thrown." ) ; } catch ( IllegalStateException e ) { verify ( m_WakeLock , times ( 2 ) ) . activate ( ) ; verify ( m_WakeLock , times ( 2 ) ) . cancel ( ) ; } }
Verify ability to disconnect a transport layer.
Verify ability to disconnect a transport layer .
// connection oriented //act //verify //verify