示例#1
0
        public int Run(Options opts)
        {
            try
            {
                _logger_helper.LogHeader("STARTING HARVESTER");
                _logger_helper.LogCommandLineParameters(opts);
                foreach (int source_id in opts.source_ids)
                {
                    HarvestData(source_id, opts);
                }
                _logger_helper.LogHeader("Closing Log");
                return(0);
            }

            catch (Exception e)
            {
                _logger.Error(e.Message);
                _logger.Error(e.StackTrace);
                _logger_helper.LogHeader("Closing Log");
                return(-1);
            }
        }
示例#2
0
        public int Run(Options opts)

        {
            try
            {
                _logger_helper.Logheader("STARTING IMPORTER");
                _logger_helper.LogCommandLineParameters(opts);

                if (!opts.using_test_data)
                {
                    // Simply import the data for each listed source.

                    foreach (int source_id in opts.source_ids)
                    {
                        ImportData(source_id, opts.rebuild_ad_tables, false);
                    }
                }
                else
                {
                    // first recreate the ADcomposite tables.

                    _test_repo.SetUpADCompositeTables();

                    // Go through and import each test source.

                    foreach (int source_id in opts.source_ids)
                    {
                        _logger_helper.Logheader("BEGINNING " + source_id.ToString() + " first test pass");
                        ImportData(source_id, true, true);
                        _logger_helper.Logheader("ENDING " + source_id.ToString() + " first test pass");
                    }

                    // make scripted changes to the ad tables to
                    // create diffs between them
                    _test_repo.ApplyScriptedADChanges();


                    // Go through each test source again,
                    // this time keeping the ad tables.

                    foreach (int source_id in opts.source_ids)
                    {
                        _logger_helper.Logheader("BEGINNING " + source_id.ToString() + " second test pass");
                        ImportData(source_id, false, true);
                        _logger_helper.Logheader("ENDING " + source_id.ToString() + " second test pass");
                    }

                    // construct a log detailing differences between the
                    // expacted and actual (composite ad) values.

                    _test_repo.ConstructDiffReport();
                }


                _logger_helper.Logheader("Closing Log");
                return(0);
            }

            catch (Exception e)
            {
                _logger.Error(e.Message);
                _logger.Error(e.StackTrace);
                _logger_helper.Logheader("Closing Log");
                return(-1);
            }
        }