Example #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();
        }
Example #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());
        }
Example #3
0
        private void CleanTables()
        {
            var tableNames = new[] { "Geography", "Scientist" };

            foreach (var tableName in tableNames)
            {
                using (var conn = new OleDbConnection(ConnectionStringReader.GetIntegrationServerTargetDatabase()))
                {
                    conn.Open();
                    var cmd = new OleDbCommand($"truncate table Dim{tableName};", conn);
                    cmd.ExecuteNonQuery();
                }
            }
        }