mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -81,9 +81,9 @@ function createInstantiationService(addAccountFailureEmitter?: Emitter<string>):
|
||||
|
||||
// Create a mocked out instantiation service
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
instantiationService.setup(x => x.createInstance<AccountViewModel>(TypeMoq.It.isValue(AccountViewModel)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountViewModel)))
|
||||
.returns(() => mockAccountViewModel.object);
|
||||
instantiationService.setup(x => x.createInstance<AccountListRenderer>(TypeMoq.It.isValue(AccountListRenderer)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountListRenderer)))
|
||||
.returns(() => undefined);
|
||||
|
||||
// Create a mock account dialog
|
||||
@@ -97,7 +97,7 @@ function createInstantiationService(addAccountFailureEmitter?: Emitter<string>):
|
||||
.returns(() => undefined);
|
||||
mockAccountDialog.setup(x => x.open())
|
||||
.returns(() => undefined);
|
||||
instantiationService.setup(x => x.createInstance<AccountDialog>(TypeMoq.It.isValue(AccountDialog)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountDialog)))
|
||||
.returns(() => mockAccountDialog.object);
|
||||
|
||||
return instantiationService.object;
|
||||
|
||||
@@ -94,7 +94,7 @@ function createInstantiationService(): InstantiationService {
|
||||
|
||||
// Create a mocked out instantiation service
|
||||
let instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
instantiationService.setup(x => x.createInstance<AccountPickerViewModel>(TypeMoq.It.isValue(AccountPickerViewModel), TypeMoq.It.isAny()))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountPickerViewModel), TypeMoq.It.isAny()))
|
||||
.returns(() => mockAccountViewModel.object);
|
||||
|
||||
// Create a mock account picker
|
||||
@@ -113,7 +113,7 @@ function createInstantiationService(): InstantiationService {
|
||||
.returns((container) => undefined);
|
||||
mockAccountDialog.setup(x => x.createAccountPickerComponent());
|
||||
|
||||
instantiationService.setup(x => x.createInstance<AccountPicker>(TypeMoq.It.isValue(AccountPicker), TypeMoq.It.isAny()))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountPicker), TypeMoq.It.isAny()))
|
||||
.returns(() => mockAccountDialog.object);
|
||||
|
||||
return instantiationService.object;
|
||||
|
||||
@@ -52,7 +52,7 @@ suite('auto OAuth dialog controller tests', () => {
|
||||
|
||||
// Create a mocked out instantiation service
|
||||
instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
instantiationService.setup(x => x.createInstance<AutoOAuthDialog>(TypeMoq.It.isValue(AutoOAuthDialog)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AutoOAuthDialog)))
|
||||
.returns(() => mockAutoOAuthDialog.object);
|
||||
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ suite('Firewall rule dialog controller tests', () => {
|
||||
|
||||
// Create a mocked out instantiation service
|
||||
instantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
instantiationService.setup(x => x.createInstance<FirewallRuleViewModel>(TypeMoq.It.isValue(FirewallRuleViewModel)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(FirewallRuleViewModel)))
|
||||
.returns(() => mockFirewallRuleViewModel.object);
|
||||
|
||||
// Create a mock account picker
|
||||
@@ -73,7 +73,7 @@ suite('Firewall rule dialog controller tests', () => {
|
||||
mockFirewallRuleDialog.setup(x => x.open());
|
||||
mockFirewallRuleDialog.setup(x => x.close());
|
||||
|
||||
instantiationService.setup(x => x.createInstance<FirewallRuleDialog>(TypeMoq.It.isValue(FirewallRuleDialog)))
|
||||
instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(FirewallRuleDialog)))
|
||||
.returns(() => mockFirewallRuleDialog.object);
|
||||
|
||||
connectionProfile = {
|
||||
|
||||
@@ -10,7 +10,7 @@ import data = require('data');
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { ServiceOptionType, ServiceOptionTypeNames } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
suite('Advanced options helper tests', () => {
|
||||
var possibleInputs: string[];
|
||||
@@ -41,7 +41,7 @@ suite('Advanced options helper tests', () => {
|
||||
],
|
||||
defaultValue: null,
|
||||
isRequired: false,
|
||||
valueType: ServiceOptionType.category,
|
||||
valueType: <any>ServiceOptionTypeNames.category,
|
||||
objectType: undefined,
|
||||
isArray: undefined
|
||||
};
|
||||
@@ -54,7 +54,7 @@ suite('Advanced options helper tests', () => {
|
||||
categoryValues: null,
|
||||
defaultValue: null,
|
||||
isRequired: false,
|
||||
valueType: ServiceOptionType.boolean,
|
||||
valueType: <any>ServiceOptionTypeNames.boolean,
|
||||
objectType: undefined,
|
||||
isArray: undefined
|
||||
};
|
||||
@@ -67,7 +67,7 @@ suite('Advanced options helper tests', () => {
|
||||
categoryValues: null,
|
||||
defaultValue: '15',
|
||||
isRequired: false,
|
||||
valueType: ServiceOptionType.number,
|
||||
valueType: <any>ServiceOptionTypeNames.number,
|
||||
objectType: undefined,
|
||||
isArray: undefined
|
||||
};
|
||||
@@ -80,7 +80,7 @@ suite('Advanced options helper tests', () => {
|
||||
categoryValues: null,
|
||||
defaultValue: null,
|
||||
isRequired: false,
|
||||
valueType: ServiceOptionType.string,
|
||||
valueType: <any>ServiceOptionTypeNames.string,
|
||||
objectType: undefined,
|
||||
isArray: undefined
|
||||
};
|
||||
@@ -93,7 +93,7 @@ suite('Advanced options helper tests', () => {
|
||||
categoryValues: null,
|
||||
defaultValue: null,
|
||||
isRequired: false,
|
||||
valueType: ServiceOptionType.string,
|
||||
valueType: <any>ServiceOptionTypeNames.string,
|
||||
objectType: undefined,
|
||||
isArray: undefined
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
|
||||
// Setup configuration to return a config that can be modified later.
|
||||
workspaceConfigurationServiceMock = TypeMoq.Mock.ofType(WorkspaceConfigurationTestService);
|
||||
workspaceConfigurationServiceMock.setup(x => x.getConfiguration(Constants.sqlConfigSectionName))
|
||||
workspaceConfigurationServiceMock.setup(x => x.getValue(Constants.sqlConfigSectionName))
|
||||
.returns(() => configResult);
|
||||
|
||||
connectionManagementService = createConnectionManagementService();
|
||||
|
||||
@@ -168,7 +168,6 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
let savedProfile = storedProfile;
|
||||
let connectionProfile = ConnectionProfile.createFromStoredProfile(savedProfile, msSQLCapabilities);
|
||||
assert.equal(savedProfile.groupId, connectionProfile.groupId);
|
||||
assert.deepEqual(savedProfile.options, connectionProfile.options);
|
||||
assert.deepEqual(savedProfile.providerName, connectionProfile.providerName);
|
||||
assert.deepEqual(savedProfile.savePassword, connectionProfile.savePassword);
|
||||
assert.deepEqual(savedProfile.id, connectionProfile.id);
|
||||
@@ -178,7 +177,6 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
let savedProfile = Object.assign({}, storedProfile, { id: undefined });
|
||||
let connectionProfile = ConnectionProfile.createFromStoredProfile(savedProfile, msSQLCapabilities);
|
||||
assert.equal(savedProfile.groupId, connectionProfile.groupId);
|
||||
assert.deepEqual(savedProfile.options, connectionProfile.options);
|
||||
assert.deepEqual(savedProfile.providerName, connectionProfile.providerName);
|
||||
assert.equal(savedProfile.savePassword, connectionProfile.savePassword);
|
||||
assert.notEqual(connectionProfile.id, undefined);
|
||||
|
||||
@@ -85,7 +85,7 @@ suite('SQL ConnectionStore tests', () => {
|
||||
configResult[Constants.configMaxRecentConnections] = maxRecent;
|
||||
|
||||
workspaceConfigurationServiceMock = TypeMoq.Mock.ofType(WorkspaceConfigurationTestService);
|
||||
workspaceConfigurationServiceMock.setup(x => x.getConfiguration(Constants.sqlConfigSectionName))
|
||||
workspaceConfigurationServiceMock.setup(x => x.getValue(Constants.sqlConfigSectionName))
|
||||
.returns(() => configResult);
|
||||
|
||||
storageServiceMock = TypeMoq.Mock.ofType(StorageTestService);
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
|
||||
import { IDbColumn, BatchSummary, QueryExecuteSubsetResult, ResultSetSubset } from 'data';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { equal } from 'assert';
|
||||
import { Mock, MockBehavior, It } from 'typemoq';
|
||||
|
||||
@@ -35,7 +35,7 @@ suite('Insights Dialog Controller Tests', () => {
|
||||
let { runner, complete } = getPrimedQueryRunner(testData, testColumns);
|
||||
|
||||
let instMoq = Mock.ofType(InstantiationService, MockBehavior.Strict);
|
||||
instMoq.setup(x => x.createInstance<QueryRunner>(It.isValue(QueryRunner), It.isAny(), undefined))
|
||||
instMoq.setup(x => x.createInstance(It.isValue(QueryRunner), It.isAny(), undefined))
|
||||
.returns(() => runner);
|
||||
|
||||
let connMoq = Mock.ofType(ConnectionManagementService, MockBehavior.Strict, {}, {});
|
||||
|
||||
@@ -445,7 +445,7 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... Add mocking for instantiating an account dialog controller
|
||||
let mockDialogController = TypeMoq.Mock.ofType(AccountDialogController);
|
||||
mockDialogController.setup(x => x.openAccountDialog());
|
||||
state.instantiationService.setup(x => x.createInstance<AccountDialogController>(TypeMoq.It.isValue(AccountDialogController)))
|
||||
state.instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountDialogController)))
|
||||
.returns(() => mockDialogController.object);
|
||||
|
||||
// If: I open the account dialog when it doesn't exist
|
||||
@@ -453,7 +453,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.then(() => {
|
||||
// Then:
|
||||
// ... The instantiation service should have been called once
|
||||
state.instantiationService.verify(x => x.createInstance<AccountDialogController>(TypeMoq.It.isValue(AccountDialogController)), TypeMoq.Times.once());
|
||||
state.instantiationService.verify(x => x.createInstance(TypeMoq.It.isValue(AccountDialogController)), TypeMoq.Times.once());
|
||||
|
||||
// ... The dialog should have been opened
|
||||
mockDialogController.verify(x => x.openAccountDialog(), TypeMoq.Times.once());
|
||||
@@ -472,7 +472,7 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... Add mocking for instantiating an account dialog controller
|
||||
let mockDialogController = TypeMoq.Mock.ofType(AccountDialogController);
|
||||
mockDialogController.setup(x => x.openAccountDialog());
|
||||
state.instantiationService.setup(x => x.createInstance<AccountDialogController>(TypeMoq.It.isValue(AccountDialogController)))
|
||||
state.instantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountDialogController)))
|
||||
.returns(() => mockDialogController.object);
|
||||
|
||||
// If: I open the account dialog for a second time
|
||||
@@ -481,7 +481,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.then(() => {
|
||||
// Then:
|
||||
// ... The instantiation service should have only been called once
|
||||
state.instantiationService.verify(x => x.createInstance<AccountDialogController>(TypeMoq.It.isValue(AccountDialogController)), TypeMoq.Times.once());
|
||||
state.instantiationService.verify(x => x.createInstance(TypeMoq.It.isValue(AccountDialogController)), TypeMoq.Times.once());
|
||||
|
||||
// ... The dialog should have been opened twice
|
||||
mockDialogController.verify(x => x.openAccountDialog(), TypeMoq.Times.exactly(2));
|
||||
@@ -559,7 +559,7 @@ function getTestState(): AccountManagementState {
|
||||
|
||||
// Create instantiation service
|
||||
let mockInstantiationService = TypeMoq.Mock.ofType(InstantiationService, TypeMoq.MockBehavior.Strict);
|
||||
mockInstantiationService.setup(x => x.createInstance<AccountStore>(TypeMoq.It.isValue(AccountStore), TypeMoq.It.isAny()))
|
||||
mockInstantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountStore), TypeMoq.It.isAny()))
|
||||
.returns(() => mockAccountStore.object);
|
||||
|
||||
// Create mock memento
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IContextKeyService, IContextKeyServiceTarget, IContextKey, ContextKeyExpr, IContext } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
import { IContextKeyService, IContextKeyServiceTarget, IContextKey, ContextKeyExpr, IContext, IContextKeyChangeEvent } from 'vs/platform/contextkey/common/contextkey';
|
||||
import Event from 'vs/base/common/event';
|
||||
|
||||
export class ContextKeyServiceStub implements IContextKeyService {
|
||||
@@ -13,7 +14,7 @@ export class ContextKeyServiceStub implements IContextKeyService {
|
||||
//
|
||||
}
|
||||
|
||||
onDidChangeContext: Event<string[]>;
|
||||
onDidChangeContext: Event<IContextKeyChangeEvent>;
|
||||
|
||||
createKey<T>(key: string, defaultValue: T): IContextKey<T> {
|
||||
return undefined;
|
||||
|
||||
@@ -25,8 +25,8 @@ export class MessageServiceStub implements IMessageService{
|
||||
return undefined;
|
||||
}
|
||||
|
||||
confirm(confirmation: IConfirmation): TPromise<IConfirmationResult> {
|
||||
return undefined;
|
||||
confirm(confirmation: IConfirmation): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,4 +35,11 @@ export class MessageServiceStub implements IMessageService{
|
||||
confirmSync(confirmation: IConfirmation): boolean {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask the user for confirmation with a checkbox.
|
||||
*/
|
||||
confirmWithCheckbox(confirmation: IConfirmation): TPromise<IConfirmationResult> {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -16,20 +16,26 @@ import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
|
||||
export class WorkspaceConfigurationTestService implements IWorkspaceConfigurationService {
|
||||
_serviceBrand: any;
|
||||
|
||||
getValue<T>(): T;
|
||||
getValue<T>(section: string): T;
|
||||
getValue<T>(overrides: IConfigurationOverrides): T;
|
||||
getValue<T>(section: string, overrides: IConfigurationOverrides): T;
|
||||
getValue(arg1?: any, arg2?: any): any {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
|
||||
|
||||
getConfigurationData(): IConfigurationData { return undefined; }
|
||||
|
||||
getConfiguration<T>(): T
|
||||
getConfiguration<T>(section: string): T
|
||||
getConfiguration<T>(overrides: IConfigurationOverrides): T
|
||||
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T
|
||||
getConfiguration<T>(): T;
|
||||
getConfiguration<T>(section: string): T;
|
||||
getConfiguration<T>(overrides: IConfigurationOverrides): T;
|
||||
getConfiguration<T>(section: string, overrides: IConfigurationOverrides): T;
|
||||
getConfiguration(arg1?: any, arg2?: any): any {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
getValue<T>(key: string, overrides?: IConfigurationOverrides): T { return undefined; }
|
||||
|
||||
updateValue(key: string, value: any): TPromise<void>
|
||||
updateValue(key: string, value: any, overrides: IConfigurationOverrides): TPromise<void>
|
||||
updateValue(key: string, value: any, target: ConfigurationTarget): TPromise<void>
|
||||
|
||||
Reference in New Issue
Block a user