mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_LinkLayer.java
@Test
    public void testCreateLinkLayer() throws Exception
    {
        //test to see if you get a LinkLayer
        when(m_PhysInternal.getName()).thenReturn("name");
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT);
        
        LinkLayer layer = m_SUT.createLinkLayer(LL_PRODUCT_TYPE, physicalLink.getName());
        
        assertThat(layer, is((LinkLayer)m_LinkInternal));
        
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();

        //verify call to link reg
        ArgumentCaptor<Map> map = ArgumentCaptor.forClass(Map.class);
        verify(m_LinkRegistry).createNewObject(eq(m_LinkFactory), Mockito.anyString(), map.capture());
        
        assertThat((String)map.getValue().get(LinkLayerAttributes.CONFIG_PROP_PHYSICAL_LINK_NAME), is("name"));
    }
/**
     * Verify a link layer can be successfully created.
     */
Verify a link layer can be successfully created.
Verify a link layer can be successfully created .
@Test
    public void testCreateLinkLayer() throws Exception
    {
        when(m_PhysInternal.getName()).thenReturn("name");
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT);
        LinkLayer layer = m_SUT.createLinkLayer(LL_PRODUCT_TYPE, physicalLink.getName());
        assertThat(layer, is((LinkLayer)m_LinkInternal));
        verify(m_WakeLock, times(2)).activate();
        verify(m_WakeLock, times(2)).cancel();
        ArgumentCaptor<Map> map = ArgumentCaptor.forClass(Map.class);
        verify(m_LinkRegistry).createNewObject(eq(m_LinkFactory), Mockito.anyString(), map.capture());
        assertThat((String)map.getValue().get(LinkLayerAttributes.CONFIG_PROP_PHYSICAL_LINK_NAME), is("name"));
    }
@ Test public void testCreateLinkLayer ( ) throws Exception { when ( m_PhysInternal . getName ( ) ) . thenReturn ( "name" ) ; PhysicalLink physicalLink = m_SUT . createPhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT ) ; LinkLayer layer = m_SUT . createLinkLayer ( LL_PRODUCT_TYPE , physicalLink . getName ( ) ) ; assertThat ( layer , is ( ( LinkLayer ) m_LinkInternal ) ) ; verify ( m_WakeLock , times ( 2 ) ) . activate ( ) ; verify ( m_WakeLock , times ( 2 ) ) . cancel ( ) ; ArgumentCaptor < Map > map = ArgumentCaptor . forClass ( Map . class ) ; verify ( m_LinkRegistry ) . createNewObject ( eq ( m_LinkFactory ) , Mockito . anyString ( ) , map . capture ( ) ) ; assertThat ( ( String ) map . getValue ( ) . get ( LinkLayerAttributes . CONFIG_PROP_PHYSICAL_LINK_NAME ) , is ( "name" ) ) ; }
Verify a link layer can be successfully created.
Verify a link layer can be successfully created .
//test to see if you get a LinkLayer //verify call to link reg