Exemplo n.º 1
0
        private void setUp()
        {
            _serviceStart = DateTime.Now;
            if (!String.IsNullOrEmpty(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.MaxRunTime]))
            {
                TimeSpan.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.MaxRunTime], out _maxRunTime);
            }
            _serviceState = new VistaServiceState();
            _vistaDao     = new VistaDaoImpl(); // impl sets DAO type based off config -> new VistaDaoFactory().getVistaDao(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.VistaDaoType]);
            //_lastSqlIEN =
            _currentExtractorIEN = "0";
            _config = null;

            if (ConfigurationManager.AppSettings.AllKeys != null && ConfigurationManager.AppSettings.AllKeys.Contains("Email"))
            {
                _report.addInfo("Extractor contact: " + ConfigurationManager.AppSettings["Email"]);
            }

            // try to get this from config - if it's not present, no worries - defaults to false which is ok!
            Boolean.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.IncrementalFileUploads], out _incrementalUploads);
            Boolean.TryParse(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.IncludeSubfileLogs], out _logSubqueryMessages);

            _report.addDebug("Setup complete for Vista service!");
        }
Exemplo n.º 2
0
        /// <summary>
        /// This method should only be called from a test! It is used to bypass all the server startup, get last IEN, etc. code
        /// </summary>
        /// <param name="report"></param>
        /// <param name="query"></param>
        /// <param name="config"></param>
        /// <param name="fileDao"></param>
        internal void testExecute(ExtractorReport report, VistaQuery query, ExtractorConfiguration config, FileDao fileDao)
        {
            _report     = report;
            _vistaQuery = query;
            _config     = config;
            _fileDao    = fileDao;
            _report.setConfiguration(_config);
            _vistaDao = new VistaDaoImpl();

            // call this to make sure setup is the same
            if (!checkSiteForWork())
            {
                throw new ConfigurationErrorsException("Test execute checkSiteForWork returned false");
            }

            // do this for loop in execute
            _server = new Server(true);
            _server.startListener();

            _serviceState        = new VistaServiceState();
            _serviceState.Status = ServiceStatus.RUNNING;

            this.extract();
        }