mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestCustomCommsServiceImpl_LinkLayer.java
@Test
    public void testCreateLinkLayer_WithAndWithoutPhysicalLink() throws CCommException
    {
        Set<LinkLayerInternal> existingLayers = new HashSet<>();
        LinkLayerInternal existingLayer = mock(LinkLayerInternal.class);
        when(existingLayer.getFactory()).thenReturn(m_LinkFactory);
        existingLayers.add(existingLayer);
        when(m_LinkRegistry.getObjects()).thenReturn(existingLayers);
        
        when(m_PhysInternal.getName()).thenReturn("name");
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT);
        m_SUT.createLinkLayer(LL_PRODUCT_TYPE, physicalLink.getName());
    }
/**
     * Make sure create method deals with a physical link that is null for existing link layer.
     */
Make sure create method deals with a physical link that is null for existing link layer.
Make sure create method deals with a physical link that is null for existing link layer .
@Test
    public void testCreateLinkLayer_WithAndWithoutPhysicalLink() throws CCommException
    {
        Set<LinkLayerInternal> existingLayers = new HashSet<>();
        LinkLayerInternal existingLayer = mock(LinkLayerInternal.class);
        when(existingLayer.getFactory()).thenReturn(m_LinkFactory);
        existingLayers.add(existingLayer);
        when(m_LinkRegistry.getObjects()).thenReturn(existingLayers);
        when(m_PhysInternal.getName()).thenReturn("name");
        PhysicalLink physicalLink = m_SUT.createPhysicalLink(PhysicalLinkTypeEnum.SERIAL_PORT);
        m_SUT.createLinkLayer(LL_PRODUCT_TYPE, physicalLink.getName());
    }
@ Test public void testCreateLinkLayer_WithAndWithoutPhysicalLink ( ) throws CCommException { Set < LinkLayerInternal > existingLayers = new HashSet < > ( ) ; LinkLayerInternal existingLayer = mock ( LinkLayerInternal . class ) ; when ( existingLayer . getFactory ( ) ) . thenReturn ( m_LinkFactory ) ; existingLayers . add ( existingLayer ) ; when ( m_LinkRegistry . getObjects ( ) ) . thenReturn ( existingLayers ) ; when ( m_PhysInternal . getName ( ) ) . thenReturn ( "name" ) ; PhysicalLink physicalLink = m_SUT . createPhysicalLink ( PhysicalLinkTypeEnum . SERIAL_PORT ) ; m_SUT . createLinkLayer ( LL_PRODUCT_TYPE , physicalLink . getName ( ) ) ; }
Make sure create method deals with a physical link that is null for existing link layer.
Make sure create method deals with a physical link that is null for existing link layer .