mil.dod.th.junit4.test.runner/src/mil/dod/th/ose/junit4xmltestrunner/IntegrationTestLauncher.java
private EventHandler createConfigEventHandler()
    {
        return new EventHandler()
        {
            private boolean m_OsgiComplete;
            private boolean m_FactObjsComplete;
            private boolean m_AddressComplete;
            private boolean m_ConfigProcessingComplete;

            @Override
            public void handleEvent(final Event event)
            {
                if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_OSGI_COMPLETE_EVENT) 
                        && !m_OsgiComplete)
                {
                    m_OsgiComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("OSGi configs loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT)
                    && !m_FactObjsComplete)
                {
                    m_FactObjsComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Factory objects loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT)
                        && !m_AddressComplete)
                {
                    m_AddressComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Addresses loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT)
                        && !m_ConfigProcessingComplete)
                {
                    m_ConfigProcessingComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Processing complete, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else
                {
                    m_LogService.log(LogService.LOG_ERROR, 
                        String.format("Unexpected event %s, trying to trigger test runner thread", event.getTopic()));
                }
            }
        };
    }
/**
     * Creates an event handler to be used for configuration loading events.
     * 
     * @return
     *      configuration loading event handler
     */
Creates an event handler to be used for configuration loading events.

@return
configuration loading event handler
Creates an event handler to be used for configuration loading events . @return configuration loading event handler
private EventHandler createConfigEventHandler()
    {
        return new EventHandler()
        {
            private boolean m_OsgiComplete;
            private boolean m_FactObjsComplete;
            private boolean m_AddressComplete;
            private boolean m_ConfigProcessingComplete;
            @Override
            public void handleEvent(final Event event)
            {
                if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_OSGI_COMPLETE_EVENT) 
                        && !m_OsgiComplete)
                {
                    m_OsgiComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("OSGi configs loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT)
                    && !m_FactObjsComplete)
                {
                    m_FactObjsComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Factory objects loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT)
                        && !m_AddressComplete)
                {
                    m_AddressComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Addresses loaded, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else if (event.getTopic().equals(ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT)
                        && !m_ConfigProcessingComplete)
                {
                    m_ConfigProcessingComplete = true;
                    m_SystemInitWaitSem.release();
                    m_LogService.log(LogService.LOG_INFO, 
                        String.format("Processing complete, released semaphore [%s] to trigger test runner thread",
                                      m_SystemInitWaitSem));
                }
                else
                {
                    m_LogService.log(LogService.LOG_ERROR, 
                        String.format("Unexpected event %s, trying to trigger test runner thread", event.getTopic()));
                }
            }
        };
    }
private EventHandler createConfigEventHandler ( ) { return new EventHandler ( ) { private boolean m_OsgiComplete ; private boolean m_FactObjsComplete ; private boolean m_AddressComplete ; private boolean m_ConfigProcessingComplete ; @ Override public void handleEvent ( final Event event ) { if ( event . getTopic ( ) . equals ( ConfigLoadingConstants . TOPIC_CONFIG_OSGI_COMPLETE_EVENT ) && ! m_OsgiComplete ) { m_OsgiComplete = true ; m_SystemInitWaitSem . release ( ) ; m_LogService . log ( LogService . LOG_INFO , String . format ( "OSGi configs loaded, released semaphore [%s] to trigger test runner thread" , m_SystemInitWaitSem ) ) ; } else if ( event . getTopic ( ) . equals ( ConfigLoadingConstants . TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT ) && ! m_FactObjsComplete ) { m_FactObjsComplete = true ; m_SystemInitWaitSem . release ( ) ; m_LogService . log ( LogService . LOG_INFO , String . format ( "Factory objects loaded, released semaphore [%s] to trigger test runner thread" , m_SystemInitWaitSem ) ) ; } else if ( event . getTopic ( ) . equals ( ConfigLoadingConstants . TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT ) && ! m_AddressComplete ) { m_AddressComplete = true ; m_SystemInitWaitSem . release ( ) ; m_LogService . log ( LogService . LOG_INFO , String . format ( "Addresses loaded, released semaphore [%s] to trigger test runner thread" , m_SystemInitWaitSem ) ) ; } else if ( event . getTopic ( ) . equals ( ConfigLoadingConstants . TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT ) && ! m_ConfigProcessingComplete ) { m_ConfigProcessingComplete = true ; m_SystemInitWaitSem . release ( ) ; m_LogService . log ( LogService . LOG_INFO , String . format ( "Processing complete, released semaphore [%s] to trigger test runner thread" , m_SystemInitWaitSem ) ) ; } else { m_LogService . log ( LogService . LOG_ERROR , String . format ( "Unexpected event %s, trying to trigger test runner thread" , event . getTopic ( ) ) ) ; } } } ; }
Creates an event handler to be used for configuration loading events.
Creates an event handler to be used for configuration loading events .