Capabilities Cache (#831)

* init

* finished compile erros

* fixed all merge conflicts

* fix dialog problems

* formatting

* fix opening dialog on first open

* fix various problems with connectiondialog

* formatting

* fix tests
This commit is contained in:
Anthony Dresser
2018-03-08 17:16:40 -08:00
committed by GitHub
parent 45b1ae1fb1
commit 8b2ea4f0a0
26 changed files with 302 additions and 414 deletions

View File

@@ -33,6 +33,7 @@ import Severity from 'vs/base/common/severity';
import { ObjectExplorerActionsContext, ManageConnectionAction } from 'sql/parts/registeredServer/viewlet/objectExplorerActions';
import { IConnectionResult, IConnectionParams } from 'sql/parts/connection/common/connectionManagement';
import { TreeSelectionHandler } from 'sql/parts/registeredServer/viewlet/treeSelectionHandler';
import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService';
suite('SQL Connection Tree Action tests', () => {
let errorMessageService: TypeMoq.Mock<ErrorMessageServiceStub>;
@@ -42,6 +43,7 @@ suite('SQL Connection Tree Action tests', () => {
errorCode: undefined,
callStack: undefined
};
let capabilitiesService = new CapabilitiesTestService();
setup(() => {
errorMessageService = TypeMoq.Mock.ofType(ErrorMessageServiceStub, TypeMoq.MockBehavior.Loose);
let nothing: void;
@@ -91,7 +93,7 @@ suite('SQL Connection Tree Action tests', () => {
let manageConnectionAction: ManageConnectionAction = new ManageConnectionAction(ManageConnectionAction.ID,
ManageConnectionAction.LABEL, connectionManagementService.object, instantiationService.object, objectExplorerService.object);
let connection: ConnectionProfile = new ConnectionProfile(undefined, {
let connection: ConnectionProfile = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -126,7 +128,7 @@ suite('SQL Connection Tree Action tests', () => {
let manageConnectionAction: ManageConnectionAction = new ManageConnectionAction(ManageConnectionAction.ID,
ManageConnectionAction.LABEL, connectionManagementService.object, instantiationService.object, objectExplorerService.object);
let connection: ConnectionProfile = new ConnectionProfile(undefined, {
let connection: ConnectionProfile = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -158,7 +160,7 @@ suite('SQL Connection Tree Action tests', () => {
let objectExplorerService = createObjectExplorerService(connectionManagementService.object);
let changeConnectionAction: DisconnectConnectionAction = new DisconnectConnectionAction(DisconnectConnectionAction.ID, DisconnectConnectionAction.LABEL, connectionManagementService.object, objectExplorerService.object, errorMessageService.object);
let connection: ConnectionProfile = new ConnectionProfile(undefined, {
let connection: ConnectionProfile = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -265,7 +267,7 @@ suite('SQL Connection Tree Action tests', () => {
test('DeleteConnectionAction - test delete connection', (done) => {
let connectionManagementService = createConnectionManagementService(true);
let connection: ConnectionProfile = new ConnectionProfile(undefined, {
let connection: ConnectionProfile = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -311,7 +313,7 @@ suite('SQL Connection Tree Action tests', () => {
let isConnectedReturnValue: boolean = false;
let connectionManagementService = createConnectionManagementService(isConnectedReturnValue);
let connection: ConnectionProfile = new ConnectionProfile(undefined, {
let connection: ConnectionProfile = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -348,7 +350,9 @@ suite('SQL Connection Tree Action tests', () => {
features: undefined
};
var connection = new ConnectionProfile(sqlProvider, {
capabilitiesService.capabilities['MSSQL'] = sqlProvider;
var connection = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',
@@ -437,7 +441,9 @@ suite('SQL Connection Tree Action tests', () => {
features: undefined
};
var connection = new ConnectionProfile(sqlProvider, {
capabilitiesService.capabilities['MSSQL'] = sqlProvider;
var connection = new ConnectionProfile(capabilitiesService, {
savePassword: false,
groupFullName: 'testGroup',
serverName: 'testServerName',