mil.dod.th.ose.config/test/mil/dod/th/ose/config/loading/impl/TestConfigurationMgr.java
@Test
    public void testFrameworkEventStarted_EmptyConfiguration() throws IOException, UnmarshalException
    {
        when(m_ConfigAdmin.getConfiguration(ConfigurationMgr.class.getName())).thenReturn(m_OSGiConfiguration);
        when(m_OSGiConfiguration.getProperties()).thenReturn(null);
        
        List<FactoryObjectConfig> fConfigs = new ArrayList<>();
        List<PidConfig> pConfigs = new ArrayList<>();
        List<AddressConfig> aConfigs = new ArrayList<>();
        List<EventConfig> eConfigs = new ArrayList<>();
        List<SocketChannelConfig> sConfigs = new ArrayList<>();
        List<TransportChannelConfig> tConfigs = new ArrayList<>();
        
        when(m_XmlConfiguration.getFactoryObjects()).thenReturn(fConfigs);
        when(m_XmlConfiguration.getOsgiConfigs()).thenReturn(pConfigs);
        when(m_XmlConfiguration.getAddresses()).thenReturn(aConfigs);
        when(m_XmlConfiguration.getEventRegs()).thenReturn(eConfigs);
        when(m_XmlConfiguration.getSocketChannels()).thenReturn(sConfigs);
        when(m_XmlConfiguration.getTransportChannels()).thenReturn(tConfigs);
        
        m_SUT.activate(m_BundleContext);
        
        verify(m_FactoryObjLoader).process(eq(fConfigs), Mockito.anyBoolean());
        verify(m_OsgiConfigLoader).process(eq(pConfigs), Mockito.anyBoolean());
        verify(m_AddrConfigLoader).process(eq(aConfigs), Mockito.anyBoolean());
        verify(m_EventConfigLoader).process(eq(eConfigs));
        verify(m_ChannelConfigLoader).processSocketChannels(eq(sConfigs));
        verify(m_ChannelConfigLoader).processTransportChannels(eq(tConfigs));

        EventAdminVerifier.assertEventByTopicOnly(m_EventAdmin,
            ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT);
    }
/**
     * Verify that on framework started event with an empty configuration file does not invoke any of the process
     * methods.
     */
Verify that on framework started event with an empty configuration file does not invoke any of the process
methods.
Verify that on framework started event with an empty configuration file does not invoke any of the process methods .
@Test
    public void testFrameworkEventStarted_EmptyConfiguration() throws IOException, UnmarshalException
    {
        when(m_ConfigAdmin.getConfiguration(ConfigurationMgr.class.getName())).thenReturn(m_OSGiConfiguration);
        when(m_OSGiConfiguration.getProperties()).thenReturn(null);
        List<FactoryObjectConfig> fConfigs = new ArrayList<>();
        List<PidConfig> pConfigs = new ArrayList<>();
        List<AddressConfig> aConfigs = new ArrayList<>();
        List<EventConfig> eConfigs = new ArrayList<>();
        List<SocketChannelConfig> sConfigs = new ArrayList<>();
        List<TransportChannelConfig> tConfigs = new ArrayList<>();
        when(m_XmlConfiguration.getFactoryObjects()).thenReturn(fConfigs);
        when(m_XmlConfiguration.getOsgiConfigs()).thenReturn(pConfigs);
        when(m_XmlConfiguration.getAddresses()).thenReturn(aConfigs);
        when(m_XmlConfiguration.getEventRegs()).thenReturn(eConfigs);
        when(m_XmlConfiguration.getSocketChannels()).thenReturn(sConfigs);
        when(m_XmlConfiguration.getTransportChannels()).thenReturn(tConfigs);
        m_SUT.activate(m_BundleContext);
        verify(m_FactoryObjLoader).process(eq(fConfigs), Mockito.anyBoolean());
        verify(m_OsgiConfigLoader).process(eq(pConfigs), Mockito.anyBoolean());
        verify(m_AddrConfigLoader).process(eq(aConfigs), Mockito.anyBoolean());
        verify(m_EventConfigLoader).process(eq(eConfigs));
        verify(m_ChannelConfigLoader).processSocketChannels(eq(sConfigs));
        verify(m_ChannelConfigLoader).processTransportChannels(eq(tConfigs));
        EventAdminVerifier.assertEventByTopicOnly(m_EventAdmin,
            ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT);
    }
@ Test public void testFrameworkEventStarted_EmptyConfiguration ( ) throws IOException , UnmarshalException { when ( m_ConfigAdmin . getConfiguration ( ConfigurationMgr . class . getName ( ) ) ) . thenReturn ( m_OSGiConfiguration ) ; when ( m_OSGiConfiguration . getProperties ( ) ) . thenReturn ( null ) ; List < FactoryObjectConfig > fConfigs = new ArrayList < > ( ) ; List < PidConfig > pConfigs = new ArrayList < > ( ) ; List < AddressConfig > aConfigs = new ArrayList < > ( ) ; List < EventConfig > eConfigs = new ArrayList < > ( ) ; List < SocketChannelConfig > sConfigs = new ArrayList < > ( ) ; List < TransportChannelConfig > tConfigs = new ArrayList < > ( ) ; when ( m_XmlConfiguration . getFactoryObjects ( ) ) . thenReturn ( fConfigs ) ; when ( m_XmlConfiguration . getOsgiConfigs ( ) ) . thenReturn ( pConfigs ) ; when ( m_XmlConfiguration . getAddresses ( ) ) . thenReturn ( aConfigs ) ; when ( m_XmlConfiguration . getEventRegs ( ) ) . thenReturn ( eConfigs ) ; when ( m_XmlConfiguration . getSocketChannels ( ) ) . thenReturn ( sConfigs ) ; when ( m_XmlConfiguration . getTransportChannels ( ) ) . thenReturn ( tConfigs ) ; m_SUT . activate ( m_BundleContext ) ; verify ( m_FactoryObjLoader ) . process ( eq ( fConfigs ) , Mockito . anyBoolean ( ) ) ; verify ( m_OsgiConfigLoader ) . process ( eq ( pConfigs ) , Mockito . anyBoolean ( ) ) ; verify ( m_AddrConfigLoader ) . process ( eq ( aConfigs ) , Mockito . anyBoolean ( ) ) ; verify ( m_EventConfigLoader ) . process ( eq ( eConfigs ) ) ; verify ( m_ChannelConfigLoader ) . processSocketChannels ( eq ( sConfigs ) ) ; verify ( m_ChannelConfigLoader ) . processTransportChannels ( eq ( tConfigs ) ) ; EventAdminVerifier . assertEventByTopicOnly ( m_EventAdmin , ConfigLoadingConstants . TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT ) ; }
Verify that on framework started event with an empty configuration file does not invoke any of the process
 methods.
Verify that on framework started event with an empty configuration file does not invoke any of the process methods .