mil.dod.th.ose.config/test/mil/dod/th/ose/config/loading/impl/TestCustomCommsTrackerCustomizer.java
@SuppressWarnings("unchecked")
    @Test
    public void testTransportLayerCCommException() throws CCommException, IllegalArgumentException, 
        IllegalStateException, FactoryException, 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.createTransportLayer(eq(TL_TEST_PID), 
                eq(TL_TEST_NAME), Mockito.any(Map.class))).thenThrow(new CCommException(FormatProblem.OTHER));
        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));

        verify(m_Log).log(eq(LogService.LOG_WARNING), Mockito.any(FactoryException.class), Mockito.anyString(), 
                Mockito.any());
    }
/**
     * Verify error when adding a layer causes a {@link CCommException}.
     */
Verify error when adding a layer causes a  CCommException.
Verify error when adding a layer causes a CCommException .
@SuppressWarnings("unchecked")
    @Test
    public void testTransportLayerCCommException() throws CCommException, IllegalArgumentException, 
        IllegalStateException, FactoryException, 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.createTransportLayer(eq(TL_TEST_PID), 
                eq(TL_TEST_NAME), Mockito.any(Map.class))).thenThrow(new CCommException(FormatProblem.OTHER));
        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));
        verify(m_Log).log(eq(LogService.LOG_WARNING), Mockito.any(FactoryException.class), Mockito.anyString(), 
                Mockito.any());
    }
@ SuppressWarnings ( "unchecked" ) @ Test public void testTransportLayerCCommException ( ) throws CCommException , IllegalArgumentException , IllegalStateException , FactoryException , 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 . createTransportLayer ( eq ( TL_TEST_PID ) , eq ( TL_TEST_NAME ) , Mockito . any ( Map . class ) ) ) . thenThrow ( new CCommException ( FormatProblem . OTHER ) ) ; 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 ) ) ; verify ( m_Log ) . log ( eq ( LogService . LOG_WARNING ) , Mockito . any ( FactoryException . class ) , Mockito . anyString ( ) , Mockito . any ( ) ) ; }
Verify error when adding a layer causes a {@link CCommException}.
Verify error when adding a layer causes a { @link CCommException } .