mil.dod.th.ose.core/test/mil/dod/th/ose/core/impl/ccomm/TestTransportLayerRegistryCallback.java
@Test
    public void testPreObject_WithoutLink() throws FactoryException, ConfigurationException
    {
        TransportLayerInternal trans = mock(TransportLayerInternal.class);
        TransportLayerAttributes attrs = mock(TransportLayerAttributes.class);
        when(trans.getConfig()).thenReturn(attrs);
        when(attrs.linkLayerName()).thenReturn("");
        
        //act
        m_SUT.preObjectInitialize(trans);
        m_SUT.preObjectUpdated(trans);
        
        // allow null too
        when(attrs.linkLayerName()).thenReturn(null);
        
        //act
        m_SUT.preObjectInitialize(trans);
        m_SUT.preObjectUpdated(trans);
    }
/**
     * Verify nothing happens if the link name property is empty or null.
     */
Verify nothing happens if the link name property is empty or null.
Verify nothing happens if the link name property is empty or null .
@Test
    public void testPreObject_WithoutLink() throws FactoryException, ConfigurationException
    {
        TransportLayerInternal trans = mock(TransportLayerInternal.class);
        TransportLayerAttributes attrs = mock(TransportLayerAttributes.class);
        when(trans.getConfig()).thenReturn(attrs);
        when(attrs.linkLayerName()).thenReturn("");
        m_SUT.preObjectInitialize(trans);
        m_SUT.preObjectUpdated(trans);
        when(attrs.linkLayerName()).thenReturn(null);
        m_SUT.preObjectInitialize(trans);
        m_SUT.preObjectUpdated(trans);
    }
@ Test public void testPreObject_WithoutLink ( ) throws FactoryException , ConfigurationException { TransportLayerInternal trans = mock ( TransportLayerInternal . class ) ; TransportLayerAttributes attrs = mock ( TransportLayerAttributes . class ) ; when ( trans . getConfig ( ) ) . thenReturn ( attrs ) ; when ( attrs . linkLayerName ( ) ) . thenReturn ( "" ) ; m_SUT . preObjectInitialize ( trans ) ; m_SUT . preObjectUpdated ( trans ) ; when ( attrs . linkLayerName ( ) ) . thenReturn ( null ) ; m_SUT . preObjectInitialize ( trans ) ; m_SUT . preObjectUpdated ( trans ) ; }
Verify nothing happens if the link name property is empty or null.
Verify nothing happens if the link name property is empty or null .
//act // allow null too //act