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(); }
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()); }
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(); } } }