mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Renames ShowPlan directories along with corresponding namespaces (#1435)
* Renames ShowPlan directories along with corresponding namespaces * Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils * Revert "Renames ShowPlanGraphUtils to ExecutionPlanGraphUtils" This reverts commit 5dc2696ae906598447eed7360a3f342218432b83. * Reverts show plan tests name change. * Renames show plan test XML files. * Renames ported directory to ShowPlan and updates namespace accordingly
This commit is contained in:
@@ -31,10 +31,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove=".\ShowPlan\TestExecution.xml" />
|
||||
<EmbeddedResource Include=".\ShowPlan\TestExecutionPlan.xml" />
|
||||
<EmbeddedResource Include="ShowPlan\TestShowPlan.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Remove=".\ShowPlan\TestExecutionPlanRecommendations.xml" />
|
||||
<EmbeddedResource Include=".\ShowPlan\TestExecutionPlanRecommendations.xml" />
|
||||
<EmbeddedResource Include="ShowPlan\TestShowPlanRecommendations.xml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -30,7 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution
|
||||
// If:
|
||||
// ... I have a result set and I ask for a valid execution plan
|
||||
ResultSet planResultSet = b.ResultSets.First();
|
||||
ExecutionPlan plan = planResultSet.GetExecutionPlan().Result;
|
||||
ServiceLayer.QueryExecution.Contracts.ExecutionPlan plan = planResultSet.GetExecutionPlan().Result;
|
||||
Assert.AreEqual("xml", plan.Format);
|
||||
Assert.That(plan.Content, Does.Contain("Execution Plan"), "I should get the execution plan back");
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution
|
||||
Batch b = Common.GetExecutedBatchWithExecutionPlan();
|
||||
|
||||
// ... And I ask for a valid execution plan
|
||||
ExecutionPlan plan = b.GetExecutionPlan(0).Result;
|
||||
ServiceLayer.QueryExecution.Contracts.ExecutionPlan plan = b.GetExecutionPlan(0).Result;
|
||||
|
||||
Assert.AreEqual("xml", plan.Format);
|
||||
Assert.That(plan.Content, Does.Contain("Execution Plan"), "I should get the execution plan back");
|
||||
|
||||
@@ -4,16 +4,11 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using NUnit.Framework;
|
||||
using Microsoft.SqlTools.ServiceLayer.ShowPlan;
|
||||
using Microsoft.SqlTools.ServiceLayer.ExecutionPlan;
|
||||
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
@@ -25,7 +20,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
[Test]
|
||||
public void ParseXMLFileReturnsValidShowPlanGraph()
|
||||
{
|
||||
ReadFile(".ShowPlan.TestExecutionPlan.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlan.xml");
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
Assert.AreEqual(1, showPlanGraphs.Count, "exactly one show plan graph should be returned");
|
||||
Assert.NotNull(showPlanGraphs[0], "graph should not be null");
|
||||
@@ -35,7 +30,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
[Test]
|
||||
public void ParsingNestedProperties()
|
||||
{
|
||||
ReadFile(".ShowPlan.TestExecutionPlan.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlan.xml");
|
||||
string[] commonNestedPropertiesNames = { "MemoryGrantInfo", "OptimizerHardwareDependentProperties" };
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
ExecutionPlanNode rootNode = showPlanGraphs[0].Root;
|
||||
@@ -52,7 +47,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ShowPlan
|
||||
public void ParseXMLFileWithRecommendations()
|
||||
{
|
||||
//The first graph in this execution plan has 3 recommendations
|
||||
ReadFile(".ShowPlan.TestExecutionPlanRecommendations.xml");
|
||||
ReadFile(".ShowPlan.TestShowPlanRecommendations.xml");
|
||||
string[] commonNestedPropertiesNames = { "MemoryGrantInfo", "OptimizerHardwareDependentProperties" };
|
||||
var showPlanGraphs = ShowPlanGraphUtils.CreateShowPlanGraph(queryPlanFileText, "testFile.sql");
|
||||
List<ExecutionPlanRecommendation> rootNode = showPlanGraphs[0].Recommendations;
|
||||
|
||||
Reference in New Issue
Block a user