From b451670222fba13cb52981187ea108c9993c2e93 Mon Sep 17 00:00:00 2001
From: Kim Santiago <31145923+kisantia@users.noreply.github.com>
Date: Thu, 13 Jun 2019 14:24:19 -0700
Subject: [PATCH] Schema Compare open SCMP file (#825)
* initial open scmp changes
* more open scmp changes and adding tests
* moving some common test code
* simplify endpoint info parsing
* addressing comments and moving more common test code
* addressing comments
---
.../HostLoader.cs | 4 +-
.../Localization/sr.cs | 11 ++
.../Localization/sr.resx | 4 +
.../Localization/sr.strings | 3 +-
.../Localization/sr.xlf | 5 +
.../Contracts/DeploymentOptions.cs | 15 ++
.../Contracts/SchemaCompareOpenScmpRequest.cs | 87 +++++++++
.../Contracts/SchemaCompareRequest.cs | 6 +
.../SchemaCompareOpenScmpOperation.cs | 183 ++++++++++++++++++
.../SchemaCompare/SchemaCompareService.cs | 48 ++++-
.../SchemaCompareServiceOptionsTests.cs | 1 -
.../SchemaCompareServiceTests.cs | 113 +++++++++++
12 files changed, 472 insertions(+), 8 deletions(-)
create mode 100644 src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/Contracts/SchemaCompareOpenScmpRequest.cs
create mode 100644 src/Microsoft.SqlTools.ServiceLayer/SchemaCompare/SchemaCompareOpenScmpOperation.cs
diff --git a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs
index d7b47456..225906fa 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/HostLoader.cs
@@ -21,7 +21,7 @@ using Microsoft.SqlTools.ServiceLayer.LanguageServices;
using Microsoft.SqlTools.ServiceLayer.Metadata;
using Microsoft.SqlTools.ServiceLayer.Profiler;
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
-using Microsoft.SqlTools.ServiceLayer.SchemaCopmare;
+using Microsoft.SqlTools.ServiceLayer.SchemaCompare;
using Microsoft.SqlTools.ServiceLayer.Scripting;
using Microsoft.SqlTools.ServiceLayer.Security;
using Microsoft.SqlTools.ServiceLayer.SqlContext;
@@ -119,7 +119,7 @@ namespace Microsoft.SqlTools.ServiceLayer
CmsService.Instance.InitializeService(serviceHost);
serviceProvider.RegisterSingleService(CmsService.Instance);
- SchemaCopmare.SchemaCompareService.Instance.InitializeService(serviceHost);
+ SchemaCompare.SchemaCompareService.Instance.InitializeService(serviceHost);
serviceProvider.RegisterSingleService(SchemaCompareService.Instance);
InitializeHostedServices(serviceProvider, serviceHost);
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
index 42f33f0b..ef2950c6 100755
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
@@ -2933,6 +2933,14 @@ namespace Microsoft.SqlTools.ServiceLayer
}
}
+ public static string OpenScmpConnectionBasedModelParsingError
+ {
+ get
+ {
+ return Keys.GetString(Keys.OpenScmpConnectionBasedModelParsingError);
+ }
+ }
+
public static string ConnectionServiceListDbErrorNotConnected(string uri)
{
return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri);
@@ -4270,6 +4278,9 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string SchemaCompareExcludeIncludeNodeNotFound = "SchemaCompareExcludeIncludeNodeNotFound";
+ public const string OpenScmpConnectionBasedModelParsingError = "OpenScmpConnectionBasedModelParsingError";
+
+
private Keys()
{ }
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
index 15589826..e156dcce 100755
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
@@ -1719,4 +1719,8 @@
Failed to find the specified change in the model
+
+ Error encountered while trying to parse connection information for endpoint '{0}' with error message '{1}'
+
+
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
index 2760c71e..9b55edcd 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
@@ -796,4 +796,5 @@ ExtractInvalidVersion = Invalid version '{0}' passed. Version must be in the for
############################################################################
# Schema Compare
PublishChangesTaskName = Apply schema compare changes
-SchemaCompareExcludeIncludeNodeNotFound = Failed to find the specified change in the model
\ No newline at end of file
+SchemaCompareExcludeIncludeNodeNotFound = Failed to find the specified change in the model
+OpenScmpConnectionBasedModelParsingError = Error encountered while trying to parse connection information for endpoint '{0}' with error message '{1}'
\ No newline at end of file
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
index 8d130e1f..524dc2d8 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
@@ -1996,6 +1996,11 @@
Failed to find the specified change in the model
+
+ Error encountered while trying to parse connection information for endpoint '{0}' with error message '{1}'
+ Error encountered while trying to parse connection information for endpoint '{0}' with error message '{1}'
+
+