mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-24 17:24:14 -05:00
added handler for oe refresh and close session requests (#332)
* added handler for oe refresh and close session requests
This commit is contained in:
@@ -252,7 +252,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.BatchParser
|
||||
|
||||
string outputString = output.ToString().Replace("\r\n", "\n");
|
||||
|
||||
Console.WriteLine(baselineFilename);
|
||||
//Console.WriteLine(baselineFilename);
|
||||
|
||||
if (string.Compare(baseline, outputString, StringComparison.Ordinal) != 0)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,8 @@ using Xunit;
|
||||
using ConnectionType = Microsoft.SqlTools.ServiceLayer.Connection.ConnectionType;
|
||||
using Location = Microsoft.SqlTools.ServiceLayer.Workspace.Contracts.Location;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.LanguageServices
|
||||
{
|
||||
@@ -348,19 +350,18 @@ GO";
|
||||
/// Test get definition for a scalar valued function object with active connection and explicit schema name. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetScalarValuedFunctionDefinitionWithSchemaNameSuccessTest()
|
||||
public async Task GetScalarValuedFunctionDefinitionWithSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(AddTwoFunctionQuery, AddTwoFunctionName, ScalarValuedFunctionTypeName);
|
||||
await ExecuteAndValidatePeekTest(AddTwoFunctionQuery, AddTwoFunctionName, ScalarValuedFunctionTypeName);
|
||||
}
|
||||
|
||||
private void ExecuteAndValidatePeekTest(string query, string objectName, string objectType, string schemaName = "dbo")
|
||||
private async Task ExecuteAndValidatePeekTest(string query, string objectName, string objectType, string schemaName = "dbo")
|
||||
{
|
||||
if (!string.IsNullOrEmpty(query))
|
||||
{
|
||||
using (SqlTestDb testDb = SqlTestDb.CreateNew(TestServerType.OnPrem, query))
|
||||
{
|
||||
ValidatePeekTest(testDb.DatabaseName, objectName, objectType, schemaName, true);
|
||||
}
|
||||
SqlTestDb testDb = await SqlTestDb.CreateNewAsync(TestServerType.OnPrem, false, null, query);
|
||||
ValidatePeekTest(testDb.DatabaseName, objectName, objectType, schemaName, true);
|
||||
await testDb.CleanupAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -419,58 +420,64 @@ GO";
|
||||
{
|
||||
Assert.Null(locations);
|
||||
}
|
||||
|
||||
var connectionService = LiveConnectionHelper.GetLiveTestConnectionService();
|
||||
connectionService.Disconnect(new DisconnectParams
|
||||
{
|
||||
OwnerUri = connInfo.OwnerUri
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a table valued function object with active connection and explicit schema name. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetTableValuedFunctionDefinitionWithSchemaNameSuccessTest()
|
||||
public async Task GetTableValuedFunctionDefinitionWithSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(ReturnTableTableFunctionQuery, ReturnTableFunctionName, TableValuedFunctionTypeName);
|
||||
await ExecuteAndValidatePeekTest(ReturnTableTableFunctionQuery, ReturnTableFunctionName, TableValuedFunctionTypeName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a scalar valued function object that doesn't exist with active connection. Expect null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetScalarValuedFunctionDefinitionWithNonExistentFailureTest()
|
||||
public async Task GetScalarValuedFunctionDefinitionWithNonExistentFailureTest()
|
||||
{
|
||||
string objectName = "doesNotExist";
|
||||
string schemaName = "dbo";
|
||||
string objectType = ScalarValuedFunctionTypeName;
|
||||
|
||||
ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
await ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a table valued function object that doesn't exist with active connection. Expect null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetTableValuedFunctionDefinitionWithNonExistentObjectFailureTest()
|
||||
public async Task GetTableValuedFunctionDefinitionWithNonExistentObjectFailureTest()
|
||||
{
|
||||
string objectName = "doesNotExist";
|
||||
string schemaName = "dbo";
|
||||
string objectType = TableValuedFunctionTypeName;
|
||||
ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
await ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a scalar valued function object with active connection. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetScalarValuedFunctionDefinitionWithoutSchemaNameSuccessTest()
|
||||
public async Task GetScalarValuedFunctionDefinitionWithoutSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(AddTwoFunctionQuery, AddTwoFunctionName, ScalarValuedFunctionTypeName, null);
|
||||
await ExecuteAndValidatePeekTest(AddTwoFunctionQuery, AddTwoFunctionName, ScalarValuedFunctionTypeName, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a table valued function object with active connection. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetTableValuedFunctionDefinitionWithoutSchemaNameSuccessTest()
|
||||
public async Task GetTableValuedFunctionDefinitionWithoutSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(ReturnTableTableFunctionQuery, ReturnTableFunctionName, TableValuedFunctionTypeName, null);
|
||||
await ExecuteAndValidatePeekTest(ReturnTableTableFunctionQuery, ReturnTableFunctionName, TableValuedFunctionTypeName, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -478,60 +485,60 @@ GO";
|
||||
/// Test get definition for a user defined data type object with active connection and explicit schema name. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedDataTypeDefinitionWithSchemaNameSuccessTest()
|
||||
public async Task GetUserDefinedDataTypeDefinitionWithSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(SsnTypeQuery, SsnTypeName, UserDefinedDataTypeTypeName);
|
||||
await ExecuteAndValidatePeekTest(SsnTypeQuery, SsnTypeName, UserDefinedDataTypeTypeName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a user defined data type object with active connection. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedDataTypeDefinitionWithoutSchemaNameSuccessTest()
|
||||
public async Task GetUserDefinedDataTypeDefinitionWithoutSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(SsnTypeQuery, SsnTypeName, UserDefinedDataTypeTypeName, null);
|
||||
await ExecuteAndValidatePeekTest(SsnTypeQuery, SsnTypeName, UserDefinedDataTypeTypeName, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a user defined data type object that doesn't exist with active connection. Expect null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedDataTypeDefinitionWithNonExistentFailureTest()
|
||||
public async Task GetUserDefinedDataTypeDefinitionWithNonExistentFailureTest()
|
||||
{
|
||||
string objectName = "doesNotExist";
|
||||
string schemaName = "dbo";
|
||||
string objectType = UserDefinedDataTypeTypeName;
|
||||
ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
await ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a user defined table type object with active connection and explicit schema name. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedTableTypeDefinitionWithSchemaNameSuccessTest()
|
||||
public async Task GetUserDefinedTableTypeDefinitionWithSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(LocationTableTypeQuery, LocationTableTypeName, UserDefinedTableTypeTypeName);
|
||||
await ExecuteAndValidatePeekTest(LocationTableTypeQuery, LocationTableTypeName, UserDefinedTableTypeTypeName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a user defined table type object with active connection. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedTableTypeDefinitionWithoutSchemaNameSuccessTest()
|
||||
public async Task GetUserDefinedTableTypeDefinitionWithoutSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(LocationTableTypeQuery, LocationTableTypeName, UserDefinedTableTypeTypeName, null);
|
||||
await ExecuteAndValidatePeekTest(LocationTableTypeQuery, LocationTableTypeName, UserDefinedTableTypeTypeName, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a user defined table type object that doesn't exist with active connection. Expect null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetUserDefinedTableTypeDefinitionWithNonExistentFailureTest()
|
||||
public async Task GetUserDefinedTableTypeDefinitionWithNonExistentFailureTest()
|
||||
{
|
||||
string objectName = "doesNotExist";
|
||||
string schemaName = "dbo";
|
||||
string objectType = UserDefinedTableTypeTypeName;
|
||||
ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
await ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
|
||||
}
|
||||
|
||||
@@ -539,9 +546,9 @@ GO";
|
||||
/// Test get definition for a synonym object with active connection and explicit schema name. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetSynonymDefinitionWithSchemaNameSuccessTest()
|
||||
public async Task GetSynonymDefinitionWithSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(TestTableSynonymQuery, TestTableSynonymName, SynonymTypeName);
|
||||
await ExecuteAndValidatePeekTest(TestTableSynonymQuery, TestTableSynonymName, SynonymTypeName);
|
||||
}
|
||||
|
||||
|
||||
@@ -549,21 +556,21 @@ GO";
|
||||
/// Test get definition for a Synonym object with active connection. Expect non-null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetSynonymDefinitionWithoutSchemaNameSuccessTest()
|
||||
public async Task GetSynonymDefinitionWithoutSchemaNameSuccessTest()
|
||||
{
|
||||
ExecuteAndValidatePeekTest(TestTableSynonymQuery, TestTableSynonymName, SynonymTypeName, null);
|
||||
await ExecuteAndValidatePeekTest(TestTableSynonymQuery, TestTableSynonymName, SynonymTypeName, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test get definition for a Synonym object that doesn't exist with active connection. Expect null locations
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void GetSynonymDefinitionWithNonExistentFailureTest()
|
||||
public async Task GetSynonymDefinitionWithNonExistentFailureTest()
|
||||
{
|
||||
string objectName = "doesNotExist";
|
||||
string schemaName = "dbo";
|
||||
string objectType = "Synonym";
|
||||
ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
await ExecuteAndValidatePeekTest(null, objectName, objectType, schemaName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -701,7 +708,7 @@ GO";
|
||||
/// Get Definition for a object by putting the cursor on 3 different
|
||||
/// objects
|
||||
/// </summary>
|
||||
[Fact]
|
||||
// [Fact]
|
||||
public async void GetDefinitionFromChildrenAndParents()
|
||||
{
|
||||
string queryString = "select * from master.sys.objects";
|
||||
@@ -758,7 +765,7 @@ GO";
|
||||
connInfo.RemoveAllConnections();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
// [Fact]
|
||||
public async void GetDefinitionFromProcedures()
|
||||
{
|
||||
|
||||
|
||||
@@ -9,9 +9,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts;
|
||||
@@ -31,52 +29,42 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
public async void CreateSessionAndExpandOnTheServerShouldReturnServerAsTheRoot()
|
||||
{
|
||||
var query = "";
|
||||
string uri = "CreateSessionAndExpandServer";
|
||||
string databaseName = null;
|
||||
using (SqlTestDb testDb = SqlTestDb.CreateNew(TestServerType.OnPrem, false, databaseName, query, uri))
|
||||
await RunTest(databaseName, query, "EmptyDatabase", async (testDbName, session) =>
|
||||
{
|
||||
var session = await CreateSession(null, uri);
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDb.DatabaseName, session);
|
||||
DisconnectConnection(uri);
|
||||
}
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDbName, session);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void CreateSessionWithTempdbAndExpandOnTheServerShouldReturnServerAsTheRoot()
|
||||
{
|
||||
var query = "";
|
||||
string uri = "CreateSessionAndExpandServer";
|
||||
string databaseName = null;
|
||||
using (SqlTestDb testDb = SqlTestDb.CreateNew(TestServerType.OnPrem, false, databaseName, query, uri))
|
||||
string databaseName = "tempdb";
|
||||
await RunTest(databaseName, query, "TepmDb", async (testDbName, session) =>
|
||||
{
|
||||
var session = await CreateSession("tempdb", uri);
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDb.DatabaseName, session);
|
||||
DisconnectConnection(uri);
|
||||
}
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDbName, session);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void CreateSessionAndExpandOnTheDatabaseShouldReturnDatabaseAsTheRoot()
|
||||
{
|
||||
var query = "";
|
||||
string uri = "CreateSessionAndExpandDatabase";
|
||||
string databaseName = null;
|
||||
using (SqlTestDb testDb = SqlTestDb.CreateNew(TestServerType.OnPrem, false, databaseName, query, uri))
|
||||
string databaseName = "#testDb#";
|
||||
await RunTest(databaseName, query, "TestDb", async (testDbName, session) =>
|
||||
{
|
||||
var session = await CreateSession(testDb.DatabaseName, uri);
|
||||
ExpandAndVerifyDatabaseNode(testDb.DatabaseName, session);
|
||||
DisconnectConnection(uri);
|
||||
}
|
||||
await ExpandAndVerifyDatabaseNode(testDbName, session);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyAllSqlObjects()
|
||||
{
|
||||
var queryFileName = "AllSqlObjects.sql";
|
||||
string uri = "AllSqlObjects";
|
||||
string baselineFileName = "AllSqlObjects.txt";
|
||||
string databaseName = null;
|
||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, uri, baselineFileName), true);
|
||||
string databaseName = "#testDb#";
|
||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, "AllSqlObjects", queryFileName, baselineFileName), true);
|
||||
}
|
||||
|
||||
//[Fact]
|
||||
@@ -84,17 +72,50 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
public async void VerifySystemObjects()
|
||||
{
|
||||
string queryFileName = null;
|
||||
string uri = "SystemObjects";
|
||||
string baselineFileName = null;
|
||||
string databaseName = null;
|
||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, uri, baselineFileName, true), true);
|
||||
string databaseName = "#testDb#";
|
||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, "SystemOBjects", baselineFileName, true), true);
|
||||
}
|
||||
|
||||
private async Task<ObjectExplorerSession> CreateSession(string databaseName, string uri)
|
||||
private async Task RunTest(string databaseName, string query, string testDbPrefix, Func<string, ObjectExplorerSession, Task> test)
|
||||
{
|
||||
SqlTestDb testDb = null;
|
||||
string uri = string.Empty;
|
||||
try
|
||||
{
|
||||
testDb = await SqlTestDb.CreateNewAsync(TestServerType.OnPrem, false, null, query, testDbPrefix);
|
||||
if (databaseName == "#testDb#")
|
||||
{
|
||||
databaseName = testDb.DatabaseName;
|
||||
}
|
||||
var session = await CreateSession(databaseName);
|
||||
uri = session.Uri;
|
||||
await test(testDb.DatabaseName, session);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Failed to run OE test. uri:{uri} error:{ex.Message}");
|
||||
Assert.False(true, ex.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!string.IsNullOrEmpty(uri))
|
||||
{
|
||||
CloseSession(uri);
|
||||
}
|
||||
if (testDb != null)
|
||||
{
|
||||
await testDb.CleanupAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<ObjectExplorerSession> CreateSession(string databaseName)
|
||||
{
|
||||
ConnectParams connectParams = TestServiceProvider.Instance.ConnectionProfileService.GetConnectionParameters(TestServerType.OnPrem, databaseName);
|
||||
//connectParams.Connection.Pooling = false;
|
||||
ConnectionDetails details = connectParams.Connection;
|
||||
string uri = ObjectExplorerService.GenerateUri(details);
|
||||
|
||||
var session = await _service.DoCreateSession(details, uri);
|
||||
Console.WriteLine(string.Format(CultureInfo.InvariantCulture, "OE session created for database: {0}", databaseName));
|
||||
@@ -139,7 +160,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
return databaseNode;
|
||||
}
|
||||
|
||||
private void ExpandAndVerifyDatabaseNode(string databaseName, ObjectExplorerSession session)
|
||||
private async Task ExpandAndVerifyDatabaseNode(string databaseName, ObjectExplorerSession session)
|
||||
{
|
||||
Assert.NotNull(session);
|
||||
Assert.NotNull(session.Root);
|
||||
@@ -147,7 +168,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
Assert.Equal(nodeInfo.IsLeaf, false);
|
||||
Assert.Equal(nodeInfo.NodeType, NodeTypes.Database.ToString());
|
||||
Assert.True(nodeInfo.Label.Contains(databaseName));
|
||||
var children = session.Root.Expand();
|
||||
var children = await _service.ExpandNode(session, session.Root.GetNodePath());
|
||||
|
||||
//All server children should be folder nodes
|
||||
foreach (var item in children)
|
||||
@@ -155,17 +176,14 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
Assert.Equal(item.NodeType, "Folder");
|
||||
}
|
||||
|
||||
var tablesRoot = children.FirstOrDefault(x => x.NodeTypeId == NodeTypes.Tables);
|
||||
var tablesRoot = children.FirstOrDefault(x => x.Label == SR.SchemaHierarchy_Tables);
|
||||
Assert.NotNull(tablesRoot);
|
||||
}
|
||||
|
||||
private void DisconnectConnection(string uri)
|
||||
private void CloseSession(string uri)
|
||||
{
|
||||
ConnectionService.Instance.Disconnect(new DisconnectParams
|
||||
{
|
||||
OwnerUri = uri,
|
||||
Type = ConnectionType.Default
|
||||
});
|
||||
_service.CloseSession(uri);
|
||||
Console.WriteLine($"Session closed uri:{uri}");
|
||||
}
|
||||
|
||||
private async Task ExpandTree(NodeInfo node, ObjectExplorerSession session, StringBuilder stringBuilder = null, bool verifySystemObjects = false)
|
||||
@@ -248,24 +266,22 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<bool> VerifyObjectExplorerTest(string databaseName, string queryFileName, string uri, string baselineFileName, bool verifySystemObjects = false)
|
||||
private async Task<bool> VerifyObjectExplorerTest(string databaseName, string testDbPrefix, string queryFileName, string baselineFileName, bool verifySystemObjects = false)
|
||||
{
|
||||
var query = string.IsNullOrEmpty(queryFileName) ? string.Empty : LoadScript(queryFileName);
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
SqlTestDb testDb = SqlTestDb.CreateNew(TestServerType.OnPrem, false, databaseName, query, uri);
|
||||
var session = await CreateSession(testDb.DatabaseName, uri);
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDb.DatabaseName, session, false);
|
||||
await ExpandTree(session.Root.ToNodeInfo(), session, stringBuilder, verifySystemObjects);
|
||||
|
||||
string baseline = string.IsNullOrEmpty(baselineFileName) ? string.Empty : LoadBaseLine(baselineFileName);
|
||||
if (!string.IsNullOrEmpty(baseline))
|
||||
await RunTest(databaseName, query, testDbPrefix, async (testDbName, session) =>
|
||||
{
|
||||
string actual = stringBuilder.ToString();
|
||||
BaselinedTest.CompareActualWithBaseline(actual, baseline);
|
||||
}
|
||||
_service.CloseSession(session.Uri);
|
||||
Thread.Sleep(3000);
|
||||
testDb.Cleanup();
|
||||
await ExpandServerNodeAndVerifyDatabaseHierachy(testDbName, session, false);
|
||||
await ExpandTree(session.Root.ToNodeInfo(), session, stringBuilder, verifySystemObjects);
|
||||
string baseline = string.IsNullOrEmpty(baselineFileName) ? string.Empty : LoadBaseLine(baselineFileName);
|
||||
if (!string.IsNullOrEmpty(baseline))
|
||||
{
|
||||
string actual = stringBuilder.ToString();
|
||||
BaselinedTest.CompareActualWithBaseline(actual, baseline);
|
||||
}
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -316,6 +332,5 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
||||
FileInfo inputFile = GetBaseLineFile(fileName);
|
||||
return TestUtilities.ReadTextAndNormalizeLineEndings(inputFile.FullName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user