Create MS.SqlTools.Credentials project (#249)

* Initial credential service files

* Clean-up hostloader

* Update build scripts to build credentials archive

* Move hosting files to new assembly

* Add credentials files to MS.SqlTools.Credentials

* Remove duplicate files

* Update namespace in program.cs

* Fix test build breaks

* Update extensions visibility.

* Remove unused resource strings

* Add xproj files to SLN for appveyor builds

* Fix appveyor build break in test project

* Fix extensibility tests

* Fix various typos in latest iteration

* Add settings for Integration build

* Fix codecoverage.bat to use full pdb for new projects

* Fix bug when packing in folder with native images

* Fix typos in xproj

* Reset XLF to fix build.cmd
This commit is contained in:
Karl Burtram
2017-02-23 16:09:58 -08:00
committed by GitHub
parent e79a37bdfe
commit 0af7bef66d
112 changed files with 4887 additions and 1870 deletions

View File

@@ -10,6 +10,8 @@ COPY /Y %WORKINGDIR%..\..\src\Microsoft.SqlTools.ServiceLayer\project.json %WORK
REM switch PDB type to Full since that is required by OpenCover for now
REM we should remove this step on OpenCover supports portable PDB
cscript /nologo ReplaceText.vbs %WORKINGDIR%..\..\src\Microsoft.SqlTools.Credentials\project.json portable full
cscript /nologo ReplaceText.vbs %WORKINGDIR%..\..\src\Microsoft.SqlTools.Hosting\project.json portable full
cscript /nologo ReplaceText.vbs %WORKINGDIR%..\..\src\Microsoft.SqlTools.ServiceLayer\project.json portable full
REM rebuild the SqlToolsService project
@@ -45,4 +47,9 @@ SET SERVICECODECOVERAGE=FALSE
REM restore original project.json
COPY /Y %WORKINGDIR%..\..\src\Microsoft.SqlTools.ServiceLayer\project.json.BAK %WORKINGDIR%..\..\src\Microsoft.SqlTools.ServiceLayer\project.json
DEL %WORKINGDIR%..\..\src\Microsoft.SqlTools.ServiceLayer\project.json.BAK
COPY /Y %WORKINGDIR%..\..\src\Microsoft.SqlTools.Credentials\project.json.BAK %WORKINGDIR%..\..\src\Microsoft.SqlTools.Credentials\project.json
DEL %WORKINGDIR%..\..\src\Microsoft.SqlTools.Credentials\project.json.BAK
COPY /Y %WORKINGDIR%..\..\src\Microsoft.SqlTools.Hosting\project.json.BAK %WORKINGDIR%..\..\src\Microsoft.SqlTools.Hosting\project.json
DEL %WORKINGDIR%..\..\src\Microsoft.SqlTools.Hosting\project.json.BAK
EXIT

View File

@@ -26,6 +26,12 @@
"Microsoft.SqlTools.ServiceLayer": {
"target": "project"
},
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
},
"Moq": "4.6.36-alpha",
"Microsoft.SqlTools.ServiceLayer.Test": "1.0.0-*"
},

View File

@@ -11,6 +11,12 @@
"Microsoft.SqlTools.ServiceLayer": {
"target": "project"
},
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
},
"Microsoft.SqlTools.ServiceLayer.TestDriver": "1.0.0-*",
"Microsoft.SqlTools.ServiceLayer.Test.Common": "1.0.0-*"
},

View File

@@ -25,6 +25,12 @@
"Microsoft.SqlTools.ServiceLayer": {
"target": "project"
},
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
},
"Moq": "4.6.36-alpha",
"Microsoft.SqlTools.ServiceLayer.TestDriver": "1.0.0-*"
},

View File

@@ -29,28 +29,27 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Extensibility
}
[Fact]
public void CreateDefaultLoaderShouldOnlyFindTypesInMainAssembly()
public void CreateDefaultLoaderShouldFindTypesOnlyInMainAssembly()
{
// Given a store created using CreateDefaultLoader
// Then should not find exports from a different assembly
// Then not should find exports from a different assembly
ExtensionStore store = ExtensionStore.CreateDefaultLoader<MyExportType>();
Assert.Equal(0, store.GetExports<MyExportType>().Count());
// But should find exports that are defined in the main assembly
// And should not find exports that are defined in the ServiceLayer assembly
store = ExtensionStore.CreateDefaultLoader<ASTNodeFormatterFactory>();
Assert.NotEmpty(store.GetExports<ASTNodeFormatterFactory>());
Assert.Empty(store.GetExports<ASTNodeFormatterFactory>());
}
[Fact]
public void CreateDefaultServiceProviderShouldOnlyFindTypesInMainAssembly()
public void CreateDefaultServiceProviderShouldFindTypesInAllAssemblies()
{
// Given a default ExtensionServiceProvider
// Then should not find exports from a different assembly
ExtensionServiceProvider serviceProvider = ExtensionServiceProvider.CreateDefaultServiceProvider();
Assert.Empty(serviceProvider.GetServices<MyExportType>());
Assert.NotEmpty(serviceProvider.GetServices<MyExportType>());
// But should find exports that are defined in the main assembly
// But should find exports that are defined in the main assembly
Assert.NotEmpty(serviceProvider.GetServices<ASTNodeFormatterFactory>());
}

View File

@@ -25,11 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.ServiceHost
Assert.True(SR.Culture == culture);
var connectionServiceListDbErrorNullOwnerUri = SR.ConnectionServiceListDbErrorNullOwnerUri;
var connectionParamsValidateNullConnection = SR.ConnectionParamsValidateNullConnection;
var credentialsServiceInvalidCriticalHandle = SR.CredentialsServiceInvalidCriticalHandle;
var credentialsServicePasswordLengthExceeded = SR.CredentialsServicePasswordLengthExceeded;
var credentialsServiceTargetForDelete = SR.CredentialsServiceTargetForDelete;
var credentialsServiceTargetForLookup = SR.CredentialsServiceTargetForLookup;
var connectionParamsValidateNullConnection = SR.ConnectionParamsValidateNullConnection;
var queryServiceCancelDisposeFailed = SR.QueryServiceCancelDisposeFailed;
var queryServiceQueryCancelled = SR.QueryServiceQueryCancelled;
var queryServiceDataReaderByteCountInvalid = SR.QueryServiceDataReaderByteCountInvalid;

View File

@@ -29,7 +29,13 @@
"target": "project"
},
"Moq": "4.6.36-alpha",
"Microsoft.SqlTools.ServiceLayer.Test.Common": "1.0.0-*"
"Microsoft.SqlTools.ServiceLayer.Test.Common": "1.0.0-*",
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
}
},
"testRunner": "xunit",
"frameworks": {

View File

@@ -11,6 +11,12 @@
"Microsoft.SqlTools.ServiceLayer": {
"target": "project"
},
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
},
"Microsoft.SqlTools.ServiceLayer.TestDriver": "1.0.0-*",
"Microsoft.SqlTools.ServiceLayer.Test.Common": "1.0.0-*"
},

View File

@@ -9,6 +9,12 @@
"dotnet-test-xunit": "1.0.0-rc2-192208-24",
"Microsoft.SqlTools.ServiceLayer": {
"target": "project"
},
"Microsoft.SqlTools.Hosting": {
"target": "project"
},
"Microsoft.SqlTools.Credentials": {
"target": "project"
}
},
"testRunner": "xunit",