mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/link/TestLinkLayerImpl.java
@Test
    public void testPerformBITException()
    {
        //mock behavior
        when(m_LinkLayerFactoryInternal.getLinkLayerCapabilities()).thenReturn(m_Caps);
        when(m_Caps.isPerformBITSupported()).thenReturn(false);

        //perform the built in test
        try
        {
            m_SUT.performBit();
            fail("Expected exception because BIT is not supported");
        }
        catch (CCommException e)
        {
            //expected exception
        }

        //verify
        verify(m_WakeLock, never()).activate();
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
/** 
    * Test perform BIT for a link layer when BIT isn't supported.
    */
Test perform BIT for a link layer when BIT isn't supported.
Test perform BIT for a link layer when BIT isn ' t supported .
@Test
    public void testPerformBITException()
    {
        when(m_LinkLayerFactoryInternal.getLinkLayerCapabilities()).thenReturn(m_Caps);
        when(m_Caps.isPerformBITSupported()).thenReturn(false);
        try
        {
            m_SUT.performBit();
            fail("Expected exception because BIT is not supported");
        }
        catch (CCommException e)
        {
        }
        verify(m_WakeLock, never()).activate();
        verify(m_EventAdmin, never()).postEvent(Mockito.any(Event.class));
    }
@ Test public void testPerformBITException ( ) { when ( m_LinkLayerFactoryInternal . getLinkLayerCapabilities ( ) ) . thenReturn ( m_Caps ) ; when ( m_Caps . isPerformBITSupported ( ) ) . thenReturn ( false ) ; try { m_SUT . performBit ( ) ; fail ( "Expected exception because BIT is not supported" ) ; } catch ( CCommException e ) { } verify ( m_WakeLock , never ( ) ) . activate ( ) ; verify ( m_EventAdmin , never ( ) ) . postEvent ( Mockito . any ( Event . class ) ) ; }
Test perform BIT for a link layer when BIT isn't supported.
Test perform BIT for a link layer when BIT isn ' t supported .
//mock behavior //perform the built in test //expected exception //verify