コード例 #1
0
        public void TestGetProjectParams()
        {
            var dtsProcessor = new DtsProcessor(ReadTestConfig());
            var paramList    = dtsProcessor.LoadProjectParams();

            Assert.IsTrue(paramList != null && paramList.Count > 0);
            Assert.IsTrue(paramList.FirstOrDefault(p => p.Name == "Uni") != null);
        }
コード例 #2
0
        public void TestInjectVariables()
        {
            var config = ReadTestConfig();

            config.Commands.ChangeAppName = false;
            config.Commands.ConvertToUTF8 = false;
            config.Commands.FormatSQL     = false;
            config.Commands.SetFileConnectionToVariable = false;

            config.Commands.CreateVariables = true;
            config.Commands.DeleteVariables = true;
            config.Commands.InjectVariables = true;

            var dtsProcessor = new DtsProcessor(config);

            dtsProcessor.LoadPackages();
            dtsProcessor.DeleteVariables();
            dtsProcessor.CreateVariables();
            dtsProcessor.InjectVariables();
            dtsProcessor.SavePackages();

            Assert.IsTrue(true);
        }
コード例 #3
0
ファイル: Bootstrapper.cs プロジェクト: uniba-ceus/DtsHelper
        /// <summary>
        ///     Runs the commands.
        /// </summary>
        private void RunCommands()
        {
            _log.Debug("Validiere die Konfiguration.");

            ValidateConfig();
            ValidateCommands();
            ValidateSqlFormatterOptions();

            _log.Info("Beginne mit der Verarbeitung der Kommandos.");

            // load all packages
            var dtsProcessor = new DtsProcessor(_config);

            dtsProcessor.LoadPackages();

            // execute all commands
            if (_config.Commands.SetFileConnectionToVariable)
            {
                _log.Info("CMD: Konvertiere Dateiverbindungen zu Variablen...");
                dtsProcessor.SetFileConToVariable();
            }

            if (_config.Commands.ConvertToUTF8)
            {
                Console.WriteLine("CMD: Skripte werden in UTF-8 konvertiert...");
                dtsProcessor.ConvertToUTF8(_config);
            }

            if (_config.Commands.FormatSQL)
            {
                Console.WriteLine("CMD: SQL-Code wird formatiert...");
                dtsProcessor.FormatSqlFiles(_config);
            }

            if (_config.Commands.DeleteVariables)
            {
                Console.WriteLine("CMD: Variablen in Tasks werden gelöscht...");
                dtsProcessor.DeleteVariables();
            }

            if (_config.Commands.CreateVariables)
            {
                Console.WriteLine("CMD: Variablen in Tasks werden erstellt...");
                dtsProcessor.CreateVariables();
            }

            if (_config.Commands.InjectVariables)
            {
                Console.WriteLine("CMD: Variablen in Tasks werden mit Code befüllt...");
                dtsProcessor.InjectVariables();
            }

            if (_config.Commands.InjectDirect)
            {
                Console.WriteLine("CMD: Tasks werden direkt mit Code befüllt...");
                dtsProcessor.InjectDirect();
            }

            if (_config.Commands.ChangeAppName)
            {
                Console.WriteLine("CMD: App-Name wird geschrieben...");
                dtsProcessor.ChangeAppName();
            }

            // store all changes
            dtsProcessor.SavePackages();

            _log.Info("Alle Kommandos erfolgreich abgearbeitet.");
        }