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

        Address address = mock(Address.class);
        
        //act
        m_SUT.connect(address);
        
        //verify
        verify(m_WakeLock).activate();
        verify(m_TransportLayerProxy).connect(address);
        verify(m_WakeLock).cancel();

        try
        {
            doThrow(new IllegalStateException("Already connected")).when(m_TransportLayerProxy).connect(address);

            m_SUT.connect(address);
            fail("Expected IllegalStateException not thrown.");
        }
        catch (IllegalStateException e)
        {
            //verify
        }
    }
/**
     * Verify ability to connect a transport layer.
     */
Verify ability to connect a transport layer.
Verify ability to connect a transport layer .
@Test
    public void testConnect() throws CCommException
    {
        initTransportLayer(true); 
        Address address = mock(Address.class);
        m_SUT.connect(address);
        verify(m_WakeLock).activate();
        verify(m_TransportLayerProxy).connect(address);
        verify(m_WakeLock).cancel();
        try
        {
            doThrow(new IllegalStateException("Already connected")).when(m_TransportLayerProxy).connect(address);
            m_SUT.connect(address);
            fail("Expected IllegalStateException not thrown.");
        }
        catch (IllegalStateException e)
        {
        }
    }
@ Test public void testConnect ( ) throws CCommException { initTransportLayer ( true ) ; Address address = mock ( Address . class ) ; m_SUT . connect ( address ) ; verify ( m_WakeLock ) . activate ( ) ; verify ( m_TransportLayerProxy ) . connect ( address ) ; verify ( m_WakeLock ) . cancel ( ) ; try { doThrow ( new IllegalStateException ( "Already connected" ) ) . when ( m_TransportLayerProxy ) . connect ( address ) ; m_SUT . connect ( address ) ; fail ( "Expected IllegalStateException not thrown." ) ; } catch ( IllegalStateException e ) { } }
Verify ability to connect a transport layer.
Verify ability to connect a transport layer .
// connection oriented //act //verify //verify