Beispiel #1
0
        public void Execute_WithoutTimeout_CorrectlyHandled()
        {
            var etl = new EtlXml()
            {
                Server  = ConnectionStringReader.GetIntegrationServer(),
                Catalog = "SSISDB",
                Folder  = "Demo.NBi.Ssis",
                Project = "Demo.NBi.Ssis.Integration",
                Name    = "Dimensions.dtsx",
            };

            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "FlatFileScientist", StringValue = $@"{AssemblyDirectory}\data\DimScientist.csv"
            });
            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "FlatFileGeography", StringValue = $@"{AssemblyDirectory}\data\DimGeography.csv"
            });
            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "ConnectionString", StringValue = ConnectionStringReader.GetIntegrationServerTargetDatabase()
            });

            var runner = new EtlCatalogRunner(etl);

            runner.Execute();
        }
Beispiel #2
0
        public void Execute_ShortWithTimeout_SqlException()
        {
            var etl = new EtlXml()
            {
                Server  = ConnectionStringReader.GetIntegrationServer(),
                Catalog = "SSISDB",
                Folder  = "Demo.NBi.Ssis",
                Project = "Demo.NBi.Ssis.Integration",
                Name    = "Dimensions.dtsx",
                Timeout = 1
            };

            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "FlatFileScientist", StringValue = $@"{AssemblyDirectory}\data\DimScientist.csv"
            });
            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "FlatFileGeography", StringValue = $@"{AssemblyDirectory}\data\DimGeography.csv"
            });
            etl.InternalParameters.Add(new EtlParameterXml()
            {
                Name = "ConnectionString", StringValue = ConnectionStringReader.GetIntegrationServerTargetDatabase()
            });

            var runner = new EtlCatalogRunner(etl);

            Assert.Throws <SqlException>(() => runner.Execute());
        }
Beispiel #3
0
        public void SetupMethods()
        {
            isIntegrationServiceStarted = CheckIfIntegrationServiceStarted();

            if (!isIntegrationServiceStarted)
            {
                return;
            }

            //Build the fullpath for the file to read
            Directory.CreateDirectory("ETL");
            var pkg = DiskOnFile.CreatePhysicalFile(@"Etl\Sample.dtsx", "NBi.Testing.Integration.SqlServer.IntegrationService.Resources.Sample.dtsx");

            try
            {
                //Move the Etl to SQL Server Integration Services
                Application app = new Application();
                Package     p   = app.LoadPackage(pkg, null);

                // Save the package to the SQL Server msdb folder, which is
                // also the MSDB folder in the Integration Services service, or as a row in the
                //sysssispackages table.
                app.SaveToSqlServerAs(p, null, "nbi\\nbi-sample", ConnectionStringReader.GetIntegrationServer(), null, null);
            }
            catch (Exception ex)
            {
                isIntegrationServiceStarted = false;
                IgnoreMessage = string.Format("Test fixture 'EtlDtsWindowsRunnerTest' is skipped: {0}", ex.Message);
            }
        }