mil.dod.th.ose.config/test/mil/dod/th/ose/config/loading/impl/TestCustomCommsTrackerCustomizer.java
@Test
    public void testAddingTransportLayer() throws IllegalArgumentException, IllegalStateException,
            FactoryException, CCommException, IOException
    {
        FactoryObjectConfig objectConfig = new FactoryObjectConfig()
            .withFactoryType(FactoryTypeEnum.TRANSPORT_LAYER)
            .withProperties(m_StringMapList)
            .withProductType(TL_TEST_PID)
            .withCreatePolicy(CreatePolicyEnum.FIRST_RUN)
            .withName(TL_TEST_NAME);

        when(m_CustomCommsService.getLinkLayer(LL_TEST_NAME)).thenReturn(m_Link);

        CustomCommsTrackerCustomizer sut = new CustomCommsTrackerCustomizer(objectConfig, m_CustomCommsService, m_Log,
            m_EventAdmin);

        sut.addingService(m_ServiceReference);

        verify(m_CustomCommsService, times(1)).createTransportLayer(
                eq(TL_TEST_PID), eq(TL_TEST_NAME), eq(m_Properties));
    }
/**
     * Test adding a TransportLayer that isn't created yet.
     */
Test adding a TransportLayer that isn't created yet.
Test adding a TransportLayer that isn ' t created yet .
@Test
    public void testAddingTransportLayer() throws IllegalArgumentException, IllegalStateException,
            FactoryException, CCommException, IOException
    {
        FactoryObjectConfig objectConfig = new FactoryObjectConfig()
            .withFactoryType(FactoryTypeEnum.TRANSPORT_LAYER)
            .withProperties(m_StringMapList)
            .withProductType(TL_TEST_PID)
            .withCreatePolicy(CreatePolicyEnum.FIRST_RUN)
            .withName(TL_TEST_NAME);
        when(m_CustomCommsService.getLinkLayer(LL_TEST_NAME)).thenReturn(m_Link);
        CustomCommsTrackerCustomizer sut = new CustomCommsTrackerCustomizer(objectConfig, m_CustomCommsService, m_Log,
            m_EventAdmin);
        sut.addingService(m_ServiceReference);
        verify(m_CustomCommsService, times(1)).createTransportLayer(
                eq(TL_TEST_PID), eq(TL_TEST_NAME), eq(m_Properties));
    }
@ Test public void testAddingTransportLayer ( ) throws IllegalArgumentException , IllegalStateException , FactoryException , CCommException , IOException { FactoryObjectConfig objectConfig = new FactoryObjectConfig ( ) . withFactoryType ( FactoryTypeEnum . TRANSPORT_LAYER ) . withProperties ( m_StringMapList ) . withProductType ( TL_TEST_PID ) . withCreatePolicy ( CreatePolicyEnum . FIRST_RUN ) . withName ( TL_TEST_NAME ) ; when ( m_CustomCommsService . getLinkLayer ( LL_TEST_NAME ) ) . thenReturn ( m_Link ) ; CustomCommsTrackerCustomizer sut = new CustomCommsTrackerCustomizer ( objectConfig , m_CustomCommsService , m_Log , m_EventAdmin ) ; sut . addingService ( m_ServiceReference ) ; verify ( m_CustomCommsService , times ( 1 ) ) . createTransportLayer ( eq ( TL_TEST_PID ) , eq ( TL_TEST_NAME ) , eq ( m_Properties ) ) ; }
Test adding a TransportLayer that isn't created yet.
Test adding a TransportLayer that isn ' t created yet .