mil.dod.th.junit4.test.runner/src/mil/dod/th/ose/junit4xmltestrunner/IntegrationTestLauncher.java
@Activate
    public void activate(final BundleContext context)
    {
        m_SystemBundle = context.getBundle(0);
        
        m_LogService.log(LogService.LOG_INFO, "Starting Test Launcher");
        
        final boolean autoStartShutdown = Boolean.parseBoolean(
                System.getProperty("mil.dod.th.ose.junit4xmltestrunner.autoStartShutdown"));
        if (!autoStartShutdown)
        {
            m_LogService.log(LogService.LOG_WARNING, "Will not start running tests, use test command to execute tests");
            return;
        }

        String reportDir = System.getProperty("mil.dod.th.ose.junit4xmltestrunner.reportDir");
        if (reportDir == null)
        {
            reportDir = ".";
        }
        
        m_ReportDirFile = new File(reportDir);
        if (!m_ReportDirFile.isDirectory() && !m_ReportDirFile.mkdirs())
        {
            m_LogService.log(LogService.LOG_ERROR, 
                    "Unable to use given directory: " + m_ReportDirFile.getAbsolutePath());
            return;
        }
        
        m_LogService.log(LogService.LOG_INFO, "Will put JUnit reports here: " + m_ReportDirFile.getAbsolutePath());
        
        m_TestRunnerTracker = new ServiceTracker<IntegrationTestRunner, IntegrationTestRunner>(context, 
              IntegrationTestRunner.class.getName(), null);
        m_TestRunnerTracker.open();

        m_SystemBundleTracker = createSystemBundleTracker(context);
        m_SystemBundleTracker.open();
    
        final EventHandler eventHandler = createConfigEventHandler();

        final Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(EventConstants.EVENT_TOPIC,
            new String[] {ConfigLoadingConstants.TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_OSGI_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT});
        m_EventHandlerReg = context.registerService(EventHandler.class, eventHandler, props);

        runTestRunner();
    }
/**
     * Activate this component by checking if auto start is enabled.  If so, wait for test runner to be activated then
     * run it.
     * 
     * @param context
     *      bundle context used to acquire system bundle
     */
Activate this component by checking if auto start is enabled.  If so, wait for test runner to be activated then
run it.

@param context
bundle context used to acquire system bundle
Activate this component by checking if auto start is enabled . If so wait for test runner to be activated then run it . @param context bundle context used to acquire system bundle
@Activate
    public void activate(final BundleContext context)
    {
        m_SystemBundle = context.getBundle(0);
        m_LogService.log(LogService.LOG_INFO, "Starting Test Launcher");
        final boolean autoStartShutdown = Boolean.parseBoolean(
                System.getProperty("mil.dod.th.ose.junit4xmltestrunner.autoStartShutdown"));
        if (!autoStartShutdown)
        {
            m_LogService.log(LogService.LOG_WARNING, "Will not start running tests, use test command to execute tests");
            return;
        }
        String reportDir = System.getProperty("mil.dod.th.ose.junit4xmltestrunner.reportDir");
        if (reportDir == null)
        {
            reportDir = ".";
        }
        m_ReportDirFile = new File(reportDir);
        if (!m_ReportDirFile.isDirectory() && !m_ReportDirFile.mkdirs())
        {
            m_LogService.log(LogService.LOG_ERROR, 
                    "Unable to use given directory: " + m_ReportDirFile.getAbsolutePath());
            return;
        }
        m_LogService.log(LogService.LOG_INFO, "Will put JUnit reports here: " + m_ReportDirFile.getAbsolutePath());
        m_TestRunnerTracker = new ServiceTracker<IntegrationTestRunner, IntegrationTestRunner>(context, 
              IntegrationTestRunner.class.getName(), null);
        m_TestRunnerTracker.open();
        m_SystemBundleTracker = createSystemBundleTracker(context);
        m_SystemBundleTracker.open();
        final EventHandler eventHandler = createConfigEventHandler();
        final Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(EventConstants.EVENT_TOPIC,
            new String[] {ConfigLoadingConstants.TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_OSGI_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT,
                          ConfigLoadingConstants.TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT});
        m_EventHandlerReg = context.registerService(EventHandler.class, eventHandler, props);
        runTestRunner();
    }
@ Activate public void activate ( final BundleContext context ) { m_SystemBundle = context . getBundle ( 0 ) ; m_LogService . log ( LogService . LOG_INFO , "Starting Test Launcher" ) ; final boolean autoStartShutdown = Boolean . parseBoolean ( System . getProperty ( "mil.dod.th.ose.junit4xmltestrunner.autoStartShutdown" ) ) ; if ( ! autoStartShutdown ) { m_LogService . log ( LogService . LOG_WARNING , "Will not start running tests, use test command to execute tests" ) ; return ; } String reportDir = System . getProperty ( "mil.dod.th.ose.junit4xmltestrunner.reportDir" ) ; if ( reportDir == null ) { reportDir = "." ; } m_ReportDirFile = new File ( reportDir ) ; if ( ! m_ReportDirFile . isDirectory ( ) && ! m_ReportDirFile . mkdirs ( ) ) { m_LogService . log ( LogService . LOG_ERROR , "Unable to use given directory: " + m_ReportDirFile . getAbsolutePath ( ) ) ; return ; } m_LogService . log ( LogService . LOG_INFO , "Will put JUnit reports here: " + m_ReportDirFile . getAbsolutePath ( ) ) ; m_TestRunnerTracker = new ServiceTracker < IntegrationTestRunner , IntegrationTestRunner > ( context , IntegrationTestRunner . class . getName ( ) , null ) ; m_TestRunnerTracker . open ( ) ; m_SystemBundleTracker = createSystemBundleTracker ( context ) ; m_SystemBundleTracker . open ( ) ; final EventHandler eventHandler = createConfigEventHandler ( ) ; final Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( EventConstants . EVENT_TOPIC , new String [ ] { ConfigLoadingConstants . TOPIC_CONFIG_FACTORY_OBJS_COMPLETE_EVENT , ConfigLoadingConstants . TOPIC_CONFIG_OSGI_COMPLETE_EVENT , ConfigLoadingConstants . TOPIC_CONFIG_ADDRESS_OBJS_COMPLETE_EVENT , ConfigLoadingConstants . TOPIC_CONFIG_PROCESSING_COMPLETE_EVENT } ) ; m_EventHandlerReg = context . registerService ( EventHandler . class , eventHandler , props ) ; runTestRunner ( ) ; }
Activate this component by checking if auto start is enabled.
Activate this component by checking if auto start is enabled .