From bc291f79d4487e2deb7e7dfcef700149aecade8b Mon Sep 17 00:00:00 2001 From: lajones Date: Wed, 11 Jun 2014 10:43:08 -0700 Subject: [PATCH] Updates for tests and based on review comments. Some InProcTests still failing for vNext. (cherry picked from commit a3b99ea62ef54842eadf4e486370ad8cf3c9e1cb) --- .../VisualStudio/Package/ConnectionManager.cs | 4 ++++ src/EFTools/XmlCore/Model/EFArtifact.cs | 2 +- src/EFTools/XmlCore/Model/EFArtifactSet.cs | 2 +- .../Utilities/DbProviderServicesExtensions.cs | 6 +++--- test/EFTools/E2ETests/DBInitialize.cs | 4 ++++ test/EFTools/E2ETests/WhiteE2ETests.cs | 8 ++++++++ .../ModelWizard/Gui/WizardPageStartTests.cs | 20 +++++++++++++++---- .../Package/ConnectionManagerTests.cs | 4 ++++ tools/EntityFramework.targets | 2 +- tools/VsIdeHostAdapter/Installer/Defines.wxi | 2 +- 10 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs b/src/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs index 839a9b2d8b..164f8549a6 100644 --- a/src/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs +++ b/src/EFTools/EntityDesign/VisualStudio/Package/ConnectionManager.cs @@ -989,7 +989,11 @@ public static string CreateDefaultLocalDbConnectionString(string initialCatalog) return string.Format( CultureInfo.InvariantCulture, +#if VS14 + @"Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog={0};Integrated Security=True", +#else @"Data Source=(LocalDb)\v11.0;Initial Catalog={0};Integrated Security=True", +#endif initialCatalog); } diff --git a/src/EFTools/XmlCore/Model/EFArtifact.cs b/src/EFTools/XmlCore/Model/EFArtifact.cs index fe92de92ac..e19a4142b0 100644 --- a/src/EFTools/XmlCore/Model/EFArtifact.cs +++ b/src/EFTools/XmlCore/Model/EFArtifact.cs @@ -899,7 +899,7 @@ internal class ChangeProcessingFailedException : Exception } /// - /// Returns the XObject for the given line & column number. + /// Returns the XObject for the given line & column number. /// internal XObject FindXObjectForLineAndColumn(int lineNumber, int columnNumber) { diff --git a/src/EFTools/XmlCore/Model/EFArtifactSet.cs b/src/EFTools/XmlCore/Model/EFArtifactSet.cs index 2d5df5d2e7..a0b0f1b9d2 100644 --- a/src/EFTools/XmlCore/Model/EFArtifactSet.cs +++ b/src/EFTools/XmlCore/Model/EFArtifactSet.cs @@ -15,7 +15,7 @@ namespace Microsoft.Data.Entity.Design.Model /// /// This class represents a set of artifacts that are validated and resolved with respect to one another. - /// This class contains resolve information (symbols & bindings) and dep & anti-dep info + /// This class contains resolve information (symbols & bindings) and dep & anti-dep info /// internal abstract class EFArtifactSet { diff --git a/src/EntityFramework/Utilities/DbProviderServicesExtensions.cs b/src/EntityFramework/Utilities/DbProviderServicesExtensions.cs index e164e5c8da..1975e9ab95 100644 --- a/src/EntityFramework/Utilities/DbProviderServicesExtensions.cs +++ b/src/EntityFramework/Utilities/DbProviderServicesExtensions.cs @@ -22,9 +22,9 @@ public static string GetProviderManifestTokenChecked( } catch (ProviderIncompatibleException ex) { - if ("(localdb)\v11.0".Equals( - DbInterception.Dispatch.Connection.GetDataSource(connection, new DbInterceptionContext()), - StringComparison.OrdinalIgnoreCase)) + var dataSource = DbInterception.Dispatch.Connection.GetDataSource(connection, new DbInterceptionContext()); + if (@"(localdb)\v11.0".Equals(dataSource, StringComparison.OrdinalIgnoreCase) + || @"(localdb)\mssqllocaldb".Equals(dataSource, StringComparison.OrdinalIgnoreCase)) { throw new ProviderIncompatibleException(Strings.BadLocalDBDatabaseName, ex); } diff --git a/test/EFTools/E2ETests/DBInitialize.cs b/test/EFTools/E2ETests/DBInitialize.cs index 0e8b36d32c..a6ba34342c 100644 --- a/test/EFTools/E2ETests/DBInitialize.cs +++ b/test/EFTools/E2ETests/DBInitialize.cs @@ -16,7 +16,11 @@ public class MyConf : DbConfiguration { public MyConf() { +#if VS14 + SetDefaultConnectionFactory(new LocalDbConnectionFactory("mssqllocaldb")); +#else SetDefaultConnectionFactory(new LocalDbConnectionFactory("v11.0")); +#endif this.SetDatabaseInitializer(new Initializer1()); } } diff --git a/test/EFTools/E2ETests/WhiteE2ETests.cs b/test/EFTools/E2ETests/WhiteE2ETests.cs index 15fa3a384b..47f780e762 100644 --- a/test/EFTools/E2ETests/WhiteE2ETests.cs +++ b/test/EFTools/E2ETests/WhiteE2ETests.cs @@ -409,7 +409,11 @@ public void AddModelFromDBUpdateModel() "Title CHAR(50) NOT NULL, Author CHAR(50), " + "PageCount INTEGER, Topic CHAR(30), Code CHAR(15))"; +#if VS14 + const string connectionString = @"Data Source=(localdb)\mssqllocaldb;initial catalog=School;integrated security=True;Pooling=false"; +#else const string connectionString = @"Data Source=(localdb)\v11.0;initial catalog=School;integrated security=True;Pooling=false"; +#endif ExecuteSqlCommand(connectionString, createTable); // Update model from db @@ -912,7 +916,11 @@ private void HandleConnectionDialog(string dbName) var serverNameText = _wizard.Get( SearchCriteria.ByText( _resourceHelper.GetConnectionUIDialogResourceString("serverLabel.Text"))); +#if VS14 + serverNameText.Enter(@"(localdb)\mssqllocaldb"); +#else serverNameText.Enter(@"(localdb)\v11.0"); +#endif var refreshButton = _wizard.Get