mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-27 15:20:30 -04:00
Move protocol client out (#643)
* close * connection is working * formatting * adds all * formatting * formatting and changing how features are initialized * formatting * changed named of typings file * update * updated to use dataprotocol npm * formatting * removed unneeded logging * readd npm shrinkwrap * still not working * removed unnecessary codfe * addressed comments * readded azure resource provider * fix capabilities cacheing * added backwards capat for older protocol * update shrinkwrap * update shrinkwrap * updated shrinkwrap * fixed tests * removed dead code * remove dead code * fix compile * remove backcompat stuff * change location of npm * vbump sqltools * merge master * fix imports * fix build breaks * update for sqlops * update yarn dependencies
This commit is contained in:
@@ -6,14 +6,14 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { AddAccountAction, RemoveAccountAction } from 'sql/parts/accountManagement/common/accountActions';
|
||||
import { AccountManagementTestService } from 'sqltest/stubs/accountManagementStubs';
|
||||
import { MessageServiceStub } from 'sqltest/stubs/messageServiceStub';
|
||||
import { ErrorMessageServiceStub } from 'sqltest/stubs/errorMessageServiceStub';
|
||||
|
||||
let testAccount = <data.Account>{
|
||||
let testAccount = <sqlops.Account>{
|
||||
key: {
|
||||
providerId: 'azure',
|
||||
accountId: 'testAccount'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as assert from 'assert';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
|
||||
@@ -19,7 +19,7 @@ import { InstantiationService } from 'vs/platform/instantiation/common/instantia
|
||||
let mockAddAccountCompleteEmitter: Emitter<void>;
|
||||
let mockAddAccountErrorEmitter: Emitter<string>;
|
||||
let mockAddAccountStartEmitter: Emitter<void>;
|
||||
let mockOnAccountSelectionChangeEvent: Emitter<data.Account>;
|
||||
let mockOnAccountSelectionChangeEvent: Emitter<sqlops.Account>;
|
||||
|
||||
// TESTS ///////////////////////////////////////////////////////////////////
|
||||
suite('Account picker service tests', () => {
|
||||
@@ -28,7 +28,7 @@ suite('Account picker service tests', () => {
|
||||
mockAddAccountCompleteEmitter = new Emitter<void>();
|
||||
mockAddAccountErrorEmitter = new Emitter<string>();
|
||||
mockAddAccountStartEmitter = new Emitter<void>();
|
||||
mockOnAccountSelectionChangeEvent = new Emitter<data.Account>();
|
||||
mockOnAccountSelectionChangeEvent = new Emitter<sqlops.Account>();
|
||||
});
|
||||
|
||||
test('Construction - Events are properly defined', () => {
|
||||
@@ -76,7 +76,7 @@ suite('Account picker service tests', () => {
|
||||
properties: [],
|
||||
isStale: false
|
||||
};
|
||||
let evOnAccountSelectionChangeEvent = new EventVerifierSingle<data.Account>();
|
||||
let evOnAccountSelectionChangeEvent = new EventVerifierSingle<sqlops.Account>();
|
||||
service.onAccountSelectionChangeEvent(evOnAccountSelectionChangeEvent.eventHandler);
|
||||
mockOnAccountSelectionChangeEvent.fire(account);
|
||||
evOnAccountSelectionChangeEvent.assertFired(account);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as assert from 'assert';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
|
||||
@@ -16,8 +16,8 @@ import { AccountManagementTestService } from 'sqltest/stubs/accountManagementStu
|
||||
// SUITE STATE /////////////////////////////////////////////////////////////
|
||||
let mockUpdateAccountEmitter: Emitter<UpdateAccountListEventParams>;
|
||||
|
||||
let providers: data.AccountProviderMetadata[];
|
||||
let accounts: data.Account[];
|
||||
let providers: sqlops.AccountProviderMetadata[];
|
||||
let accounts: sqlops.Account[];
|
||||
suite('Account picker view model tests', () => {
|
||||
setup(() => {
|
||||
providers = [{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
@@ -16,11 +16,11 @@ import { AccountManagementTestService } from 'sqltest/stubs/accountManagementStu
|
||||
|
||||
// SUITE STATE /////////////////////////////////////////////////////////////
|
||||
let mockAddProviderEmitter: Emitter<AccountProviderAddedEventParams>;
|
||||
let mockRemoveProviderEmitter: Emitter<data.AccountProviderMetadata>;
|
||||
let mockRemoveProviderEmitter: Emitter<sqlops.AccountProviderMetadata>;
|
||||
let mockUpdateAccountEmitter: Emitter<UpdateAccountListEventParams>;
|
||||
|
||||
let providers: data.AccountProviderMetadata[];
|
||||
let accounts: data.Account[];
|
||||
let providers: sqlops.AccountProviderMetadata[];
|
||||
let accounts: sqlops.Account[];
|
||||
|
||||
suite('Account Management Dialog ViewModel Tests', () => {
|
||||
|
||||
@@ -56,7 +56,7 @@ suite('Account Management Dialog ViewModel Tests', () => {
|
||||
|
||||
// Setup event mocks for the account management service
|
||||
mockAddProviderEmitter = new Emitter<AccountProviderAddedEventParams>();
|
||||
mockRemoveProviderEmitter = new Emitter<data.AccountProviderMetadata>();
|
||||
mockRemoveProviderEmitter = new Emitter<sqlops.AccountProviderMetadata>();
|
||||
mockUpdateAccountEmitter = new Emitter<UpdateAccountListEventParams>();
|
||||
});
|
||||
|
||||
@@ -79,7 +79,7 @@ suite('Account Management Dialog ViewModel Tests', () => {
|
||||
evAddProvider.assertFired(argAddProvider);
|
||||
|
||||
let argRemoveProvider = providers[0];
|
||||
let evRemoveProvider = new EventVerifierSingle<data.AccountProviderMetadata>();
|
||||
let evRemoveProvider = new EventVerifierSingle<sqlops.AccountProviderMetadata>();
|
||||
vm.removeProviderEvent(evRemoveProvider.eventHandler);
|
||||
mockRemoveProviderEmitter.fire(argRemoveProvider);
|
||||
evRemoveProvider.assertFired(argRemoveProvider);
|
||||
@@ -95,7 +95,7 @@ suite('Account Management Dialog ViewModel Tests', () => {
|
||||
// Setup: Create a viewmodel with event handlers
|
||||
let mockAccountManagementService = getMockAccountManagementService(true, true);
|
||||
let evAddProvider = new EventVerifierSingle<AccountProviderAddedEventParams>();
|
||||
let evRemoveProvider = new EventVerifierSingle<data.AccountProviderMetadata>();
|
||||
let evRemoveProvider = new EventVerifierSingle<sqlops.AccountProviderMetadata>();
|
||||
let evUpdateAccounts = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||
let vm = getViewModel(mockAccountManagementService.object, evAddProvider, evRemoveProvider, evUpdateAccounts);
|
||||
|
||||
@@ -125,7 +125,7 @@ suite('Account Management Dialog ViewModel Tests', () => {
|
||||
// Setup: Create a mock account management service that rejects looking up providers
|
||||
let mockAccountManagementService = getMockAccountManagementService(false, true);
|
||||
let evAddProvider = new EventVerifierSingle<AccountProviderAddedEventParams>();
|
||||
let evRemoveProvider = new EventVerifierSingle<data.AccountProviderMetadata>();
|
||||
let evRemoveProvider = new EventVerifierSingle<sqlops.AccountProviderMetadata>();
|
||||
let evUpdateAccounts = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||
let vm = getViewModel(mockAccountManagementService.object, evAddProvider, evRemoveProvider, evUpdateAccounts);
|
||||
|
||||
@@ -154,7 +154,7 @@ suite('Account Management Dialog ViewModel Tests', () => {
|
||||
// Setup: Create a mock account management service that rejects the promise
|
||||
let mockAccountManagementService = getMockAccountManagementService(true, false);
|
||||
let evAddProvider = new EventVerifierSingle<AccountProviderAddedEventParams>();
|
||||
let evRemoveProvider = new EventVerifierSingle<data.AccountProviderMetadata>();
|
||||
let evRemoveProvider = new EventVerifierSingle<sqlops.AccountProviderMetadata>();
|
||||
let evUpdateAccounts = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||
let vm = getViewModel(mockAccountManagementService.object, evAddProvider, evRemoveProvider, evUpdateAccounts);
|
||||
|
||||
@@ -202,7 +202,7 @@ function getMockAccountManagementService(resolveProviders: boolean, resolveAccou
|
||||
function getViewModel(
|
||||
ams: AccountManagementTestService,
|
||||
evAdd: EventVerifierSingle<AccountProviderAddedEventParams>,
|
||||
evRemove: EventVerifierSingle<data.AccountProviderMetadata>,
|
||||
evRemove: EventVerifierSingle<sqlops.AccountProviderMetadata>,
|
||||
evUpdate: EventVerifierSingle<UpdateAccountListEventParams>
|
||||
): AccountViewModel {
|
||||
let vm = new AccountViewModel(ams);
|
||||
@@ -215,7 +215,7 @@ function getViewModel(
|
||||
|
||||
function assertNoEventsFired(
|
||||
evAdd: EventVerifierSingle<AccountProviderAddedEventParams>,
|
||||
evRemove: EventVerifierSingle<data.AccountProviderMetadata>,
|
||||
evRemove: EventVerifierSingle<sqlops.AccountProviderMetadata>,
|
||||
evUpdate: EventVerifierSingle<UpdateAccountListEventParams>
|
||||
): void {
|
||||
evAdd.assertNotFired();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
@@ -21,7 +21,7 @@ import { Deferred } from 'sql/base/common/promise';
|
||||
// TESTS ///////////////////////////////////////////////////////////////////
|
||||
suite('Firewall rule dialog controller tests', () => {
|
||||
let connectionProfile: IConnectionProfile;
|
||||
let account: data.Account;
|
||||
let account: sqlops.Account;
|
||||
let IPAddress = '250.222.155.198';
|
||||
let mockOnAddAccountErrorEvent: Emitter<string>;
|
||||
let mockOnCreateFirewallRule: Emitter<void>;
|
||||
@@ -236,7 +236,7 @@ function getMockAccountManagementService(resolveSecurityToken: boolean): TypeMoq
|
||||
return mockAccountManagementService;
|
||||
}
|
||||
|
||||
function getMockResourceProvider(resolveCreateFirewallRule: boolean, response?: data.CreateFirewallRuleResponse): TypeMoq.Mock<ResourceProviderStub> {
|
||||
function getMockResourceProvider(resolveCreateFirewallRule: boolean, response?: sqlops.CreateFirewallRuleResponse): TypeMoq.Mock<ResourceProviderStub> {
|
||||
let resourceProviderStub = new ResourceProviderStub();
|
||||
let mockResourceProvider = TypeMoq.Mock.ofInstance(resourceProviderStub);
|
||||
mockResourceProvider.setup(x => x.createFirewallRule(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
|
||||
import { AdminService } from 'sql/parts/admin/common/adminService';
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
import * as OptionsDialogHelper from 'sql/base/browser/ui/modal/optionsDialogHelper';
|
||||
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
@@ -15,11 +15,11 @@ import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
suite('Advanced options helper tests', () => {
|
||||
var possibleInputs: string[];
|
||||
let options: { [name: string]: any };
|
||||
var categoryOption: data.ServiceOption;
|
||||
var booleanOption: data.ServiceOption;
|
||||
var numberOption: data.ServiceOption;
|
||||
var stringOption: data.ServiceOption;
|
||||
var defaultGroupOption: data.ServiceOption;
|
||||
var categoryOption: sqlops.ServiceOption;
|
||||
var booleanOption: sqlops.ServiceOption;
|
||||
var numberOption: sqlops.ServiceOption;
|
||||
var stringOption: sqlops.ServiceOption;
|
||||
var defaultGroupOption: sqlops.ServiceOption;
|
||||
var isValid: boolean;
|
||||
var inputValue: string;
|
||||
var inputBox: TypeMoq.Mock<InputBox>;
|
||||
|
||||
@@ -8,13 +8,13 @@ import { OptionsDialog } from 'sql/base/browser/ui/modal/optionsDialog';
|
||||
import { AdvancedPropertiesController } from 'sql/parts/connection/connectionDialog/advancedPropertiesController';
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import { ContextKeyServiceStub } from 'sqltest/stubs/contextKeyServiceStub';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
|
||||
suite('Advanced properties dialog tests', () => {
|
||||
var advancedController: AdvancedPropertiesController;
|
||||
var providerOptions: data.ConnectionOption[];
|
||||
var providerOptions: sqlops.ConnectionOption[];
|
||||
|
||||
setup(() => {
|
||||
advancedController = new AdvancedPropertiesController(() => { }, null);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ import { CapabilitiesTestService } from 'sqltest/stubs/capabilitiesTestService';
|
||||
import { ConnectionProviderStub } from 'sqltest/stubs/connectionProviderStub';
|
||||
import { ResourceProviderStub } from 'sqltest/stubs/resourceProviderServiceStub';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { WorkspaceConfigurationTestService } from 'sqltest/stubs/workspaceConfigurationTestService';
|
||||
@@ -213,7 +213,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
let id = connectionToUse.getOptionsKey();
|
||||
let defaultUri = 'connection://' + (id ? id : connectionToUse.serverName + ':' + connectionToUse.databaseName);
|
||||
connectionManagementService.onConnectionRequestSent(() => {
|
||||
let info: data.ConnectionInfoSummary = {
|
||||
let info: sqlops.ConnectionInfoSummary = {
|
||||
connectionId: error ? undefined : 'id',
|
||||
connectionSummary: {
|
||||
databaseName: connectionToUse.databaseName,
|
||||
@@ -702,7 +702,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
// when I call doChangeLanguageFlavor
|
||||
try {
|
||||
let called = false;
|
||||
connectionManagementService.onLanguageFlavorChanged((changeParams: data.DidChangeLanguageFlavorParams) => {
|
||||
connectionManagementService.onLanguageFlavorChanged((changeParams: sqlops.DidChangeLanguageFlavorParams) => {
|
||||
called = true;
|
||||
assert.equal(changeParams.uri, uri);
|
||||
assert.equal(changeParams.language, language);
|
||||
@@ -727,7 +727,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
};
|
||||
let connectionManagementService = createConnectionManagementService();
|
||||
let called = false;
|
||||
connectionManagementService.onLanguageFlavorChanged((changeParams: data.DidChangeLanguageFlavorParams) => {
|
||||
connectionManagementService.onLanguageFlavorChanged((changeParams: sqlops.DidChangeLanguageFlavorParams) => {
|
||||
called = true;
|
||||
});
|
||||
connect(uri, options).then(() => {
|
||||
@@ -776,7 +776,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
||||
// Set up the connection store to give back a group for the expected connection profile
|
||||
configResult['tabColorMode'] = 'border';
|
||||
let expectedColor = 'red';
|
||||
connectionStore.setup(x => x.getGroupFromId(connectionProfile.groupId)).returns(() => <IConnectionProfileGroup> {
|
||||
connectionStore.setup(x => x.getGroupFromId(connectionProfile.groupId)).returns(() => <IConnectionProfileGroup>{
|
||||
color: expectedColor
|
||||
});
|
||||
let uri = 'testUri';
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { IConnectionProfile, IConnectionProfileStore } from 'sql/parts/connection/common/interfaces';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as assert from 'assert';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
suite('SQL ConnectionProfileInfo tests', () => {
|
||||
let msSQLCapabilities: data.DataProtocolServerCapabilities;
|
||||
let msSQLCapabilities: sqlops.DataProtocolServerCapabilities;
|
||||
|
||||
let connectionProfile: IConnectionProfile = {
|
||||
serverName: 'new server',
|
||||
@@ -47,8 +47,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
||||
};
|
||||
|
||||
setup(() => {
|
||||
let capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
let capabilities: sqlops.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ConnectionStatusManager } from 'sql/parts/connection/common/connectionStatusManager';
|
||||
import * as Utils from 'sql/parts/connection/common/utils';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
@@ -127,7 +127,7 @@ suite('SQL ConnectionStatusManager tests', () => {
|
||||
|
||||
test('addConnection should set connecting to true', () => {
|
||||
let expected = true;
|
||||
let summary: data.ConnectionInfoSummary = {
|
||||
let summary: sqlops.ConnectionInfoSummary = {
|
||||
ownerUri: connection1Id,
|
||||
connectionId: connection1Id,
|
||||
messages: undefined,
|
||||
@@ -143,7 +143,7 @@ suite('SQL ConnectionStatusManager tests', () => {
|
||||
|
||||
test('onConnectionComplete should set connecting to false', () => {
|
||||
let expected = false;
|
||||
let summary: data.ConnectionInfoSummary = {
|
||||
let summary: sqlops.ConnectionInfoSummary = {
|
||||
ownerUri: connection1Id,
|
||||
connectionId: connection1Id,
|
||||
messages: undefined,
|
||||
@@ -177,7 +177,7 @@ suite('SQL ConnectionStatusManager tests', () => {
|
||||
|
||||
test('updateDatabaseName should update the database name in connection', () => {
|
||||
let dbName: string = 'db name';
|
||||
let summary: data.ConnectionInfoSummary = {
|
||||
let summary: sqlops.ConnectionInfoSummary = {
|
||||
connectionSummary: {
|
||||
databaseName: dbName,
|
||||
serverName: undefined,
|
||||
@@ -203,7 +203,7 @@ suite('SQL ConnectionStatusManager tests', () => {
|
||||
|
||||
test('getOriginalOwnerUri should return the original uri given uri with db name', () => {
|
||||
let dbName: string = 'db name';
|
||||
let summary: data.ConnectionInfoSummary = {
|
||||
let summary: sqlops.ConnectionInfoSummary = {
|
||||
connectionSummary: {
|
||||
databaseName: dbName,
|
||||
serverName: undefined,
|
||||
|
||||
@@ -15,7 +15,7 @@ import { CredentialsService } from 'sql/services/credentials/credentialsService'
|
||||
import * as assert from 'assert';
|
||||
import { Memento } from 'vs/workbench/common/memento';
|
||||
import { CapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/parts/connection/common/connectionProfileGroup';
|
||||
@@ -32,9 +32,9 @@ suite('SQL ConnectionStore tests', () => {
|
||||
let capabilitiesService: TypeMoq.Mock<CapabilitiesService>;
|
||||
let mementoArray: any = [];
|
||||
let maxRecent = 5;
|
||||
let msSQLCapabilities: data.DataProtocolServerCapabilities;
|
||||
let msSQLCapabilities: sqlops.DataProtocolServerCapabilities;
|
||||
let defaultNamedConnectionProfile: ConnectionProfile;
|
||||
let onProviderRegistered = new Emitter<data.DataProtocolServerCapabilities>();
|
||||
let onProviderRegistered = new Emitter<sqlops.DataProtocolServerCapabilities>();
|
||||
|
||||
|
||||
setup(() => {
|
||||
@@ -97,8 +97,8 @@ suite('SQL ConnectionStore tests', () => {
|
||||
};
|
||||
|
||||
capabilitiesService = TypeMoq.Mock.ofType(CapabilitiesService, TypeMoq.MockBehavior.Loose, extensionManagementServiceMock, {});
|
||||
let capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
let capabilities: sqlops.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
@@ -371,7 +371,7 @@ suite('SQL ConnectionStore tests', () => {
|
||||
|
||||
test('isPasswordRequired should return false if the password is not required in capabilities', () => {
|
||||
let providerName: string = 'providername';
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: msSQLCapabilities.connectionProvider.options.map(o => {
|
||||
if (o.name === 'password') {
|
||||
o.isRequired = false;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { NodeType } from 'sql/parts/registeredServer/common/nodeType';
|
||||
import { TreeNode } from 'sql/parts/registeredServer/common/treeNode';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import * as assert from 'assert';
|
||||
import { ServerTreeView } from 'sql/parts/registeredServer/viewlet/serverTreeView';
|
||||
@@ -27,11 +27,11 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
let connectionToFail: ConnectionProfile;
|
||||
let conProfGroup: ConnectionProfileGroup;
|
||||
let objectExplorerService: ObjectExplorerService;
|
||||
let objectExplorerSession: data.ObjectExplorerSession;
|
||||
let objectExplorerFailedSession: data.ObjectExplorerSession;
|
||||
let objectExplorerCloseSessionResponse: data.ObjectExplorerCloseSessionResponse;
|
||||
let objectExplorerExpandInfo: data.ObjectExplorerExpandInfo;
|
||||
let objectExplorerExpandInfoRefresh: data.ObjectExplorerExpandInfo;
|
||||
let objectExplorerSession: sqlops.ObjectExplorerSession;
|
||||
let objectExplorerFailedSession: sqlops.ObjectExplorerSession;
|
||||
let objectExplorerCloseSessionResponse: sqlops.ObjectExplorerCloseSessionResponse;
|
||||
let objectExplorerExpandInfo: sqlops.ObjectExplorerExpandInfo;
|
||||
let objectExplorerExpandInfoRefresh: sqlops.ObjectExplorerExpandInfo;
|
||||
let sessionId = '1234';
|
||||
let failedSessionId = '12345';
|
||||
let numberOfFailedSession: number = 0;
|
||||
@@ -111,11 +111,11 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
errorMessage: '',
|
||||
nodePath: objectExplorerSession.rootNode.nodePath
|
||||
};
|
||||
let response: data.ObjectExplorerSessionResponse = {
|
||||
let response: sqlops.ObjectExplorerSessionResponse = {
|
||||
sessionId: objectExplorerSession.sessionId
|
||||
};
|
||||
|
||||
let failedResponse: data.ObjectExplorerSessionResponse = {
|
||||
let failedResponse: sqlops.ObjectExplorerSessionResponse = {
|
||||
sessionId: failedSessionId
|
||||
};
|
||||
|
||||
@@ -253,10 +253,10 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
|
||||
objectExplorerService = new ObjectExplorerService(connectionManagementService.object, undefined);
|
||||
objectExplorerService.registerProvider('MSSQL', sqlOEProvider.object);
|
||||
sqlOEProvider.setup(x => x.createNewSession(TypeMoq.It.is<data.ConnectionInfo>(x => x.options['serverName'] === connection.serverName))).returns(() => new Promise<any>((resolve) => {
|
||||
sqlOEProvider.setup(x => x.createNewSession(TypeMoq.It.is<sqlops.ConnectionInfo>(x => x.options['serverName'] === connection.serverName))).returns(() => new Promise<any>((resolve) => {
|
||||
resolve(response);
|
||||
}));
|
||||
sqlOEProvider.setup(x => x.createNewSession(TypeMoq.It.is<data.ConnectionInfo>(x => x.options['serverName'] === connectionToFail.serverName))).returns(() => new Promise<any>((resolve) => {
|
||||
sqlOEProvider.setup(x => x.createNewSession(TypeMoq.It.is<sqlops.ConnectionInfo>(x => x.options['serverName'] === connectionToFail.serverName))).returns(() => new Promise<any>((resolve) => {
|
||||
resolve(failedResponse);
|
||||
}));
|
||||
sqlOEProvider.setup(x => x.expandNode(TypeMoq.It.isAny())).callback(() => {
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
import { ProviderConnectionInfo } from 'sql/parts/connection/common/providerConnectionInfo';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as assert from 'assert';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
suite('SQL ProviderConnectionInfo tests', () => {
|
||||
let msSQLCapabilities: data.DataProtocolServerCapabilities;
|
||||
let msSQLCapabilities: sqlops.DataProtocolServerCapabilities;
|
||||
|
||||
let connectionProfile: IConnectionProfile = {
|
||||
serverName: 'new server',
|
||||
@@ -33,8 +33,8 @@ suite('SQL ProviderConnectionInfo tests', () => {
|
||||
};
|
||||
|
||||
setup(() => {
|
||||
let capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
let capabilities: sqlops.DataProtocolServerCapabilities[] = [];
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as assert from 'assert';
|
||||
import { RestoreViewModel } from 'sql/parts/disasterRecovery/restore/restoreViewModel';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
@@ -14,14 +14,14 @@ suite('Restore Dialog view model tests', () => {
|
||||
let option2Category = 'option2';
|
||||
let option3Boolean = 'option3';
|
||||
let options: { [name: string]: any };
|
||||
let stringServiceOption: data.ServiceOption;
|
||||
let categoryServiceOption: data.ServiceOption;
|
||||
let booleanServiceOption: data.ServiceOption;
|
||||
let stringServiceOption: sqlops.ServiceOption;
|
||||
let categoryServiceOption: sqlops.ServiceOption;
|
||||
let booleanServiceOption: sqlops.ServiceOption;
|
||||
|
||||
let viewModel: RestoreViewModel;
|
||||
|
||||
let planDetails: { [key: string]: data.RestorePlanDetailInfo };
|
||||
let backupSets: data.DatabaseFileInfo[];
|
||||
let planDetails: { [key: string]: sqlops.RestorePlanDetailInfo };
|
||||
let backupSets: sqlops.DatabaseFileInfo[];
|
||||
|
||||
setup(() => {
|
||||
options = {};
|
||||
@@ -168,7 +168,7 @@ suite('Restore Dialog view model tests', () => {
|
||||
});
|
||||
|
||||
test('on restore plan response should update all options from restore plan response correctly', () => {
|
||||
let restorePlanResponse: data.RestorePlanResponse = {
|
||||
let restorePlanResponse: sqlops.RestorePlanResponse = {
|
||||
sessionId: '123',
|
||||
backupSetsToRestore: backupSets,
|
||||
canRestore: true,
|
||||
@@ -198,7 +198,7 @@ suite('Restore Dialog view model tests', () => {
|
||||
|
||||
|
||||
test('on reset restore options should reset all options', () => {
|
||||
let restorePlanResponse: data.RestorePlanResponse = {
|
||||
let restorePlanResponse: sqlops.RestorePlanResponse = {
|
||||
sessionId: '123',
|
||||
backupSetsToRestore: backupSets,
|
||||
canRestore: true,
|
||||
|
||||
@@ -12,7 +12,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 { IDbColumn, BatchSummary, QueryExecuteSubsetResult, ResultSetSubset } from 'sqlops';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { equal } from 'assert';
|
||||
import { Mock, MockBehavior, It } from 'typemoq';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
import { ISelectionData } from 'data';
|
||||
import { ISelectionData } from 'sqlops';
|
||||
|
||||
import {
|
||||
IConnectionManagementService,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import AccountStore from 'sql/services/accountManagement/accountStore';
|
||||
import { AccountDialogController } from 'sql/parts/accountManagement/accountDialog/accountDialogController';
|
||||
@@ -18,16 +18,16 @@ import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
|
||||
// SUITE CONSTANTS /////////////////////////////////////////////////////////
|
||||
const hasAccountProvider: data.AccountProviderMetadata = {
|
||||
const hasAccountProvider: sqlops.AccountProviderMetadata = {
|
||||
id: 'hasAccounts',
|
||||
displayName: 'Provider with Accounts'
|
||||
};
|
||||
const noAccountProvider: data.AccountProviderMetadata = {
|
||||
const noAccountProvider: sqlops.AccountProviderMetadata = {
|
||||
id: 'noAccounts',
|
||||
displayName: 'Provider without Accounts'
|
||||
};
|
||||
|
||||
const account: data.Account = {
|
||||
const account: sqlops.Account = {
|
||||
key: {
|
||||
providerId: hasAccountProvider.id,
|
||||
accountId: 'testAccount1'
|
||||
@@ -40,7 +40,7 @@ const account: data.Account = {
|
||||
isStale: false,
|
||||
properties: {}
|
||||
};
|
||||
const accountList: data.Account[] = [account];
|
||||
const accountList: sqlops.Account[] = [account];
|
||||
|
||||
suite('Account Management Service Tests:', () => {
|
||||
test('Constructor', () => {
|
||||
@@ -69,7 +69,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.returns(() => Promise.resolve(true));
|
||||
|
||||
// ... Register a account provider with the management service
|
||||
let mockProvider = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
let mockProvider = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mockProvider.setup(x => x.clear(TypeMoq.It.isAny())).returns(() => Promise.resolve());
|
||||
state.accountManagementService._providers[hasAccountProvider.id] = {
|
||||
accounts: [account],
|
||||
@@ -85,8 +85,8 @@ suite('Account Management Service Tests:', () => {
|
||||
state.mockAccountStore.verify(x => x.remove(TypeMoq.It.isAny()), TypeMoq.Times.once());
|
||||
})
|
||||
.then(
|
||||
() => done(),
|
||||
err => done(err)
|
||||
() => done(),
|
||||
err => done(err)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -95,14 +95,14 @@ suite('Account Management Service Tests:', () => {
|
||||
// ... Create account management service and to mock up the store
|
||||
let state = getTestState();
|
||||
state.mockAccountStore.setup(x => x.addOrUpdate(TypeMoq.It.isAny()))
|
||||
.returns(account => Promise.resolve(<AccountAdditionResult> {
|
||||
.returns(account => Promise.resolve(<AccountAdditionResult>{
|
||||
accountModified: true,
|
||||
accountAdded: false,
|
||||
changedAccount: account
|
||||
}));
|
||||
|
||||
// ... Register a account provider with the management service
|
||||
let mockProvider = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
let mockProvider = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mockProvider.setup(x => x.clear(TypeMoq.It.isAny())).returns(() => Promise.resolve());
|
||||
state.accountManagementService._providers[hasAccountProvider.id] = {
|
||||
accounts: [account],
|
||||
@@ -125,8 +125,8 @@ suite('Account Management Service Tests:', () => {
|
||||
});
|
||||
})
|
||||
.then(
|
||||
() => done(),
|
||||
err => done(err)
|
||||
() => done(),
|
||||
err => done(err)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -240,8 +240,8 @@ suite('Account Management Service Tests:', () => {
|
||||
// Then: Nothing should have happened and the promise should be resolved
|
||||
return state.accountManagementService.addAccount(noAccountProvider.id)
|
||||
.then(
|
||||
() => done('Add account promise resolved when it should have rejected'),
|
||||
() => done()
|
||||
() => done('Add account promise resolved when it should have rejected'),
|
||||
() => done()
|
||||
);
|
||||
});
|
||||
|
||||
@@ -255,8 +255,8 @@ suite('Account Management Service Tests:', () => {
|
||||
// Then: Nothing should have happened and the promise should be resolved
|
||||
return state.accountManagementService.addAccount(noAccountProvider.id)
|
||||
.then(
|
||||
() => done(),
|
||||
err => done(err)
|
||||
() => done(),
|
||||
err => done(err)
|
||||
);
|
||||
});
|
||||
|
||||
@@ -364,7 +364,7 @@ suite('Account Management Service Tests:', () => {
|
||||
.returns(() => Promise.resolve(true));
|
||||
|
||||
// ... Register a account provider with the management service
|
||||
let mockProvider = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
let mockProvider = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mockProvider.setup(x => x.clear(TypeMoq.It.isAny())).returns(() => Promise.resolve());
|
||||
state.accountManagementService._providers[hasAccountProvider.id] = {
|
||||
accounts: [account],
|
||||
@@ -571,7 +571,7 @@ function getTestState(): AccountManagementState {
|
||||
// Wire up event handlers
|
||||
let evUpdate = new EventVerifierSingle<UpdateAccountListEventParams>();
|
||||
let evAddProvider = new EventVerifierSingle<AccountProviderAddedEventParams>();
|
||||
let evRemoveProvider = new EventVerifierSingle<data.AccountProviderMetadata>();
|
||||
let evRemoveProvider = new EventVerifierSingle<sqlops.AccountProviderMetadata>();
|
||||
ams.updateAccountListEvent(evUpdate.eventHandler);
|
||||
ams.addAccountProviderEvent(evAddProvider.eventHandler);
|
||||
ams.removeAccountProviderEvent(evRemoveProvider.eventHandler);
|
||||
@@ -587,8 +587,8 @@ function getTestState(): AccountManagementState {
|
||||
};
|
||||
}
|
||||
|
||||
function getMockAccountProvider(): TypeMoq.Mock<data.AccountProvider> {
|
||||
let mockProvider = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
function getMockAccountProvider(): TypeMoq.Mock<sqlops.AccountProvider> {
|
||||
let mockProvider = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mockProvider.setup(x => x.clear(TypeMoq.It.isAny())).returns(() => Promise.resolve());
|
||||
mockProvider.setup(x => x.initialize(TypeMoq.It.isAny())).returns(param => Promise.resolve(param));
|
||||
mockProvider.setup(x => x.prompt()).returns(() => Promise.resolve(account));
|
||||
@@ -596,8 +596,8 @@ function getMockAccountProvider(): TypeMoq.Mock<data.AccountProvider> {
|
||||
return mockProvider;
|
||||
}
|
||||
|
||||
function getFailingMockAccountProvider(cancel: boolean): TypeMoq.Mock<data.AccountProvider> {
|
||||
let mockProvider = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
function getFailingMockAccountProvider(cancel: boolean): TypeMoq.Mock<sqlops.AccountProvider> {
|
||||
let mockProvider = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mockProvider.setup(x => x.clear(TypeMoq.It.isAny()))
|
||||
.returns(() => Promise.resolve());
|
||||
mockProvider.setup(x => x.initialize(TypeMoq.It.isAny()))
|
||||
@@ -605,13 +605,13 @@ function getFailingMockAccountProvider(cancel: boolean): TypeMoq.Mock<data.Accou
|
||||
mockProvider.setup(x => x.prompt())
|
||||
.returns(() => {
|
||||
return cancel
|
||||
? Promise.reject(<data.UserCancelledSignInError>{userCancelledSignIn: true}).then()
|
||||
? Promise.reject(<sqlops.UserCancelledSignInError>{ userCancelledSignIn: true }).then()
|
||||
: Promise.reject(new Error()).then();
|
||||
});
|
||||
mockProvider.setup(x => x.refresh(TypeMoq.It.isAny()))
|
||||
.returns(() => {
|
||||
return cancel
|
||||
? Promise.reject(<data.UserCancelledSignInError>{userCancelledSignIn: true}).then()
|
||||
? Promise.reject(<sqlops.UserCancelledSignInError>{ userCancelledSignIn: true }).then()
|
||||
: Promise.reject(new Error()).then();
|
||||
});
|
||||
return mockProvider;
|
||||
@@ -623,5 +623,5 @@ interface AccountManagementState {
|
||||
mockAccountStore: TypeMoq.Mock<IAccountStore>;
|
||||
eventVerifierUpdate: EventVerifierSingle<UpdateAccountListEventParams>;
|
||||
eventVerifierProviderAdded: EventVerifierSingle<AccountProviderAddedEventParams>;
|
||||
eventVerifierProviderRemoved: EventVerifierSingle<data.AccountProviderMetadata>;
|
||||
eventVerifierProviderRemoved: EventVerifierSingle<sqlops.AccountProviderMetadata>;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import AccountStore from 'sql/services/accountManagement/accountStore';
|
||||
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
|
||||
|
||||
@@ -68,7 +68,7 @@ suite('Account Store Tests', () => {
|
||||
let as = new AccountStore(memento);
|
||||
|
||||
// If: I add an account to the store that already exists
|
||||
let param = <data.Account>{
|
||||
let param = <sqlops.Account>{
|
||||
key: account2.key,
|
||||
displayInfo: account1.displayInfo,
|
||||
isStale: account1.isStale
|
||||
@@ -308,7 +308,7 @@ suite('Account Store Tests', () => {
|
||||
let as = new AccountStore(memento);
|
||||
|
||||
// ... Create a callback that we can verify was called
|
||||
let updateCallback = new EventVerifierSingle<data.Account>();
|
||||
let updateCallback = new EventVerifierSingle<sqlops.Account>();
|
||||
|
||||
// If: I update an account
|
||||
as.update(account1.key, updateCallback.eventHandler)
|
||||
@@ -337,7 +337,7 @@ suite('Account Store Tests', () => {
|
||||
let as = new AccountStore(memento);
|
||||
|
||||
// ... Create a callback that we can verify was called
|
||||
let updateCallback = new EventVerifierSingle<data.Account>();
|
||||
let updateCallback = new EventVerifierSingle<sqlops.Account>();
|
||||
|
||||
// If: I update an account that doesn't exist
|
||||
as.update({ accountId: 'testyTest', providerId: 'cloudyCloud' }, updateCallback.eventHandler)
|
||||
@@ -366,7 +366,7 @@ suite('Account Store Tests', () => {
|
||||
|
||||
// ... Create a callback to update the account
|
||||
let newDisplayName = 'Display Name Changed!';
|
||||
let updateCallback = (arg: data.Account) => {
|
||||
let updateCallback = (arg: sqlops.Account) => {
|
||||
arg.displayInfo.displayName = newDisplayName;
|
||||
};
|
||||
|
||||
@@ -397,7 +397,7 @@ suite('Account Store Tests', () => {
|
||||
});
|
||||
|
||||
// TODO: Reinstate contextual logo once UI changes are checked in
|
||||
const account1 = <data.Account>{
|
||||
const account1 = <sqlops.Account>{
|
||||
key: {
|
||||
providerId: 'azure',
|
||||
accountId: 'testAccount1'
|
||||
@@ -410,7 +410,7 @@ const account1 = <data.Account>{
|
||||
isStale: false
|
||||
};
|
||||
|
||||
const account2 = <data.Account>{
|
||||
const account2 = <sqlops.Account>{
|
||||
key: {
|
||||
providerId: 'azure',
|
||||
accountId: 'testAccount2'
|
||||
@@ -430,7 +430,7 @@ function getTestMemento() {
|
||||
return memento;
|
||||
}
|
||||
|
||||
function assertAccountEqual(a: data.Account, b: data.Account) {
|
||||
function assertAccountEqual(a: sqlops.Account, b: sqlops.Account) {
|
||||
assert.equal(a.key.providerId, b.key.providerId);
|
||||
assert.equal(a.key.accountId, b.key.accountId);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event from 'vs/base/common/event';
|
||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/services/accountManagement/eventTypes';
|
||||
@@ -15,10 +15,10 @@ export class AccountManagementTestService implements IAccountManagementService {
|
||||
_serviceBrand: any;
|
||||
|
||||
public get addAccountProviderEvent(): Event<AccountProviderAddedEventParams> { return () => { return undefined; }; }
|
||||
public get removeAccountProviderEvent(): Event<data.AccountProviderMetadata> { return () => { return undefined; }; }
|
||||
public get removeAccountProviderEvent(): Event<sqlops.AccountProviderMetadata> { return () => { return undefined; }; }
|
||||
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return () => { return undefined; }; }
|
||||
|
||||
accountUpdated(account: data.Account): Thenable<void> {
|
||||
accountUpdated(account: sqlops.Account): Thenable<void> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -42,23 +42,23 @@ export class AccountManagementTestService implements IAccountManagementService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getAccountProviderMetadata(): Thenable<data.AccountProviderMetadata[]> {
|
||||
getAccountProviderMetadata(): Thenable<sqlops.AccountProviderMetadata[]> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getAccountsForProvider(providerId: string): Thenable<data.Account[]> {
|
||||
getAccountsForProvider(providerId: string): Thenable<sqlops.Account[]> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getSecurityToken(account: data.Account): Thenable<{}> {
|
||||
getSecurityToken(account: sqlops.Account): Thenable<{}> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
removeAccount(accountKey: data.AccountKey): Thenable<boolean> {
|
||||
removeAccount(accountKey: sqlops.AccountKey): Thenable<boolean> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
refreshAccount(account: data.Account): Thenable<data.Account> {
|
||||
refreshAccount(account: sqlops.Account): Thenable<sqlops.Account> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export class AccountManagementTestService implements IAccountManagementService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
registerProvider(providerMetadata: data.AccountProviderMetadata, provider: data.AccountProvider): void {
|
||||
registerProvider(providerMetadata: sqlops.AccountProviderMetadata, provider: sqlops.AccountProvider): void {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -74,33 +74,33 @@ export class AccountManagementTestService implements IAccountManagementService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
unregisterProvider(providerMetadata: data.AccountProviderMetadata): void {
|
||||
unregisterProvider(providerMetadata: sqlops.AccountProviderMetadata): void {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export class AccountProviderStub implements data.AccountProvider {
|
||||
export class AccountProviderStub implements sqlops.AccountProvider {
|
||||
autoOAuthCancelled(): Thenable<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
clear(account: data.AccountKey): Thenable<void> {
|
||||
clear(account: sqlops.AccountKey): Thenable<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
getSecurityToken(account: data.Account): Thenable<{}> {
|
||||
getSecurityToken(account: sqlops.Account): Thenable<{}> {
|
||||
return Promise.resolve({});
|
||||
}
|
||||
|
||||
initialize(storedAccounts: data.Account[]): Thenable<data.Account[]> {
|
||||
initialize(storedAccounts: sqlops.Account[]): Thenable<sqlops.Account[]> {
|
||||
return Promise.resolve(storedAccounts);
|
||||
}
|
||||
|
||||
prompt(): Thenable<data.Account> {
|
||||
prompt(): Thenable<sqlops.Account> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
refresh(account: data.Account): Thenable<data.Account> {
|
||||
refresh(account: sqlops.Account): Thenable<sqlops.Account> {
|
||||
return Promise.resolve(account);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import { ICapabilitiesService } from 'sql/services/capabilities/capabilitiesService';
|
||||
import Event from 'vs/base/common/event';
|
||||
@@ -16,14 +16,14 @@ export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _providers: data.CapabilitiesProvider[] = [];
|
||||
private _providers: sqlops.CapabilitiesProvider[] = [];
|
||||
|
||||
private _capabilities: data.DataProtocolServerCapabilities[] = [];
|
||||
private _capabilities: sqlops.DataProtocolServerCapabilities[] = [];
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
let connectionProvider: data.ConnectionProviderOptions = {
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
@@ -102,7 +102,7 @@ export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
/**
|
||||
* Retrieve a list of registered server capabilities
|
||||
*/
|
||||
public getCapabilities(): data.DataProtocolServerCapabilities[] {
|
||||
public getCapabilities(): sqlops.DataProtocolServerCapabilities[] {
|
||||
return this._capabilities;
|
||||
}
|
||||
|
||||
@@ -110,11 +110,11 @@ export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
* Register the capabilities provider and query the provider for its capabilities
|
||||
* @param provider
|
||||
*/
|
||||
public registerProvider(provider: data.CapabilitiesProvider): void {
|
||||
public registerProvider(provider: sqlops.CapabilitiesProvider): void {
|
||||
}
|
||||
|
||||
// Event Emitters
|
||||
public get onProviderRegisteredEvent(): Event<data.DataProtocolServerCapabilities> {
|
||||
public get onProviderRegisteredEvent(): Event<sqlops.DataProtocolServerCapabilities> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/parts/conne
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
import { ConnectionProfile } from 'sql/parts/connection/common/connectionProfile';
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
|
||||
// Test stubs for commonly used objects
|
||||
@@ -31,7 +31,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
return conEvent.event;
|
||||
}
|
||||
|
||||
registerProvider(providerId: string, provider: data.ConnectionProvider): void {
|
||||
registerProvider(providerId: string, provider: sqlops.ConnectionProvider): void {
|
||||
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
return undefined;
|
||||
}
|
||||
|
||||
onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void {
|
||||
onConnectionComplete(handle: number, connectionInfoSummary: sqlops.ConnectionInfoSummary): void {
|
||||
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
|
||||
}
|
||||
|
||||
public onConnectionChangedNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void {
|
||||
public onConnectionChangedNotification(handle: number, changedConnInfo: sqlops.ChangedConnectionInfo): void {
|
||||
|
||||
}
|
||||
|
||||
getCurrentConnectionSummary(): data.ConnectionSummary {
|
||||
getCurrentConnectionSummary(): sqlops.ConnectionSummary {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
});
|
||||
}
|
||||
|
||||
getAdvancedProperties(): data.ConnectionOption[] {
|
||||
getAdvancedProperties(): sqlops.ConnectionOption[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
return new Promise<IConnectionProfile>(() => connectionProfile);
|
||||
}
|
||||
|
||||
public listDatabases(connectionUri: string): Thenable<data.ListDatabasesResult> {
|
||||
public listDatabases(connectionUri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer
|
||||
return true;
|
||||
}
|
||||
|
||||
getCapabilities(providerName: string): data.DataProtocolServerCapabilities {
|
||||
getCapabilities(providerName: string): sqlops.DataProtocolServerCapabilities {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
export class ConnectionProviderStub implements data.ConnectionProvider {
|
||||
export class ConnectionProviderStub implements sqlops.ConnectionProvider {
|
||||
public readonly providerId = 'MSSQL';
|
||||
|
||||
connect(connectionUri: string, connectionInfo: data.ConnectionInfo): Thenable<boolean> {
|
||||
connect(connectionUri: string, connectionInfo: sqlops.ConnectionInfo): Thenable<boolean> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ConnectionProviderStub implements data.ConnectionProvider {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
listDatabases(connectionUri: string): Thenable<data.ListDatabasesResult> {
|
||||
listDatabases(connectionUri: string): Thenable<sqlops.ListDatabasesResult> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class ConnectionProviderStub implements data.ConnectionProvider {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
registerOnConnectionComplete(handler: (connSummary: data.ConnectionInfoSummary) => any) {
|
||||
registerOnConnectionComplete(handler: (connSummary: sqlops.ConnectionInfoSummary) => any) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class ConnectionProviderStub implements data.ConnectionProvider {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
registerOnConnectionChanged(handler: (changedConnInfo: data.ChangedConnectionInfo) => any) {
|
||||
registerOnConnectionChanged(handler: (changedConnInfo: sqlops.ChangedConnectionInfo) => any) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -5,15 +5,15 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import {CredentialManagementEvents, ICredentialsService} from "sql/services/credentials/credentialsService";
|
||||
import {IDisposable} from "vs/base/common/lifecycle";
|
||||
import { CredentialManagementEvents, ICredentialsService } from 'sql/services/credentials/credentialsService';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class CredentialsTestProvider implements data.CredentialProvider {
|
||||
export class CredentialsTestProvider implements sqlops.CredentialProvider {
|
||||
handle: number;
|
||||
|
||||
public storedCredentials: {[K: string]: data.Credential} = {};
|
||||
public storedCredentials: { [K: string]: sqlops.Credential } = {};
|
||||
|
||||
saveCredential(credentialId: string, password: string): Thenable<boolean> {
|
||||
this.storedCredentials[credentialId] = {
|
||||
@@ -23,7 +23,7 @@ export class CredentialsTestProvider implements data.CredentialProvider {
|
||||
return TPromise.as(true);
|
||||
}
|
||||
|
||||
readCredential(credentialId: string): Thenable<data.Credential> {
|
||||
readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return TPromise.as(this.storedCredentials[credentialId]);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class CredentialsTestService implements ICredentialsService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
readCredential(credentialId: string): Thenable<data.Credential> {
|
||||
readCredential(credentialId: string): Thenable<sqlops.Credential> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
// Test stubs for commonly used objects
|
||||
|
||||
export class ObjectExplorerProviderTestService implements data.ObjectExplorerProvider {
|
||||
export class ObjectExplorerProviderTestService implements sqlops.ObjectExplorerProvider {
|
||||
|
||||
public readonly providerId = 'MSSQL';
|
||||
|
||||
public createNewSession(connInfo: data.ConnectionInfo): Thenable<data.ObjectExplorerCloseSessionResponse> {
|
||||
public createNewSession(connInfo: sqlops.ConnectionInfo): Thenable<sqlops.ObjectExplorerCloseSessionResponse> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public expandNode(nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
public expandNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public refreshNode(nodeInfo: data.ExpandNodeInfo): Thenable<boolean> {
|
||||
public refreshNode(nodeInfo: sqlops.ExpandNodeInfo): Thenable<boolean> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public closeSession(closeSessionInfo: data.ObjectExplorerCloseSessionInfo): Thenable<data.ObjectExplorerCloseSessionResponse> {
|
||||
public closeSession(closeSessionInfo: sqlops.ObjectExplorerCloseSessionInfo): Thenable<sqlops.ObjectExplorerCloseSessionResponse> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
public registerOnSessionCreated(handler: (response: data.ObjectExplorerSession) => any): void {
|
||||
public registerOnSessionCreated(handler: (response: sqlops.ObjectExplorerSession) => any): void {
|
||||
|
||||
}
|
||||
|
||||
public registerOnExpandCompleted(handler: (response: data.ObjectExplorerExpandInfo) => any): void {
|
||||
public registerOnExpandCompleted(handler: (response: sqlops.ObjectExplorerExpandInfo) => any): void {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,14 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { IHandleFirewallRuleResult, IResourceProviderService } from 'sql/parts/accountManagement/common/interfaces';
|
||||
import { IConnectionProfile } from 'sql/parts/connection/common/interfaces';
|
||||
|
||||
export class ResourceProviderStub implements IResourceProviderService {
|
||||
_serviceBrand: any;
|
||||
|
||||
registerProvider(providerId: string, provider: data.ResourceProvider) {
|
||||
registerProvider(providerId: string, provider: sqlops.ResourceProvider) {
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export class ResourceProviderStub implements IResourceProviderService {
|
||||
|
||||
}
|
||||
|
||||
createFirewallRule(selectedAccount: data.Account, firewallruleInfo: data.FirewallRuleInfo, resourceProviderId: string): Promise<data.CreateFirewallRuleResponse> {
|
||||
createFirewallRule(selectedAccount: sqlops.Account, firewallruleInfo: sqlops.FirewallRuleInfo, resourceProviderId: string): Promise<sqlops.CreateFirewallRuleResponse> {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as TypeMoq from 'typemoq';
|
||||
import { AccountProviderStub, AccountManagementTestService } from 'sqltest/stubs/accountManagementStubs';
|
||||
import { ExtHostAccountManagement } from 'sql/workbench/api/node/extHostAccountManagement';
|
||||
@@ -22,8 +22,8 @@ const IThreadService = createDecorator<IThreadService>('threadService');
|
||||
|
||||
// SUITE STATE /////////////////////////////////////////////////////////////
|
||||
let instantiationService: TestInstantiationService;
|
||||
let mockAccountMetadata: data.AccountProviderMetadata;
|
||||
let mockAccount: data.Account;
|
||||
let mockAccountMetadata: sqlops.AccountProviderMetadata;
|
||||
let mockAccount: sqlops.Account;
|
||||
let threadService: TestThreadService;
|
||||
|
||||
// TESTS ///////////////////////////////////////////////////////////////////
|
||||
@@ -258,8 +258,8 @@ suite('ExtHostAccountManagement', () => {
|
||||
});
|
||||
});
|
||||
|
||||
function getMockAccountProvider(): TypeMoq.Mock<data.AccountProvider> {
|
||||
let mock = TypeMoq.Mock.ofType<data.AccountProvider>(AccountProviderStub);
|
||||
function getMockAccountProvider(): TypeMoq.Mock<sqlops.AccountProvider> {
|
||||
let mock = TypeMoq.Mock.ofType<sqlops.AccountProvider>(AccountProviderStub);
|
||||
mock.setup((obj) => obj.clear(TypeMoq.It.isValue(mockAccount.key)))
|
||||
.returns(() => Promise.resolve(undefined));
|
||||
mock.setup((obj) => obj.refresh(TypeMoq.It.isValue(mockAccount)))
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
'use strict';
|
||||
|
||||
import * as assert from 'assert';
|
||||
import {TestThreadService} from 'vs/workbench/test/electron-browser/api/testThreadService';
|
||||
import {TestInstantiationService} from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import {ExtHostCredentialManagement} from 'sql/workbench/api/node/extHostCredentialManagement';
|
||||
import {SqlMainContext} from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import {IThreadService} from 'vs/workbench/services/thread/common/threadService';
|
||||
import {MainThreadCredentialManagement} from 'sql/workbench/api/node/mainThreadCredentialManagement';
|
||||
import {CredentialsTestProvider, CredentialsTestService} from 'sqltest/stubs/credentialsTestStubs';
|
||||
import {ICredentialsService} from 'sql/services/credentials/credentialsService';
|
||||
import {Credential, CredentialProvider} from 'data';
|
||||
import { TestThreadService } from 'vs/workbench/test/electron-browser/api/testThreadService';
|
||||
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
|
||||
import { ExtHostCredentialManagement } from 'sql/workbench/api/node/extHostCredentialManagement';
|
||||
import { SqlMainContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
|
||||
import { MainThreadCredentialManagement } from 'sql/workbench/api/node/mainThreadCredentialManagement';
|
||||
import { CredentialsTestProvider, CredentialsTestService } from 'sqltest/stubs/credentialsTestStubs';
|
||||
import { ICredentialsService } from 'sql/services/credentials/credentialsService';
|
||||
import { Credential, CredentialProvider } from 'sqlops';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
const IThreadService = createDecorator<IThreadService>('threadService');
|
||||
@@ -116,18 +116,18 @@ suite('ExtHostCredentialManagement', () => {
|
||||
// Then: I should get an error
|
||||
extHost.$getCredentialProvider(undefined)
|
||||
.then(
|
||||
() => { done('Provider was returned from undefined'); },
|
||||
() => { /* Swallow error, this is success path */ }
|
||||
() => { done('Provider was returned from undefined'); },
|
||||
() => { /* Swallow error, this is success path */ }
|
||||
)
|
||||
.then(() => { return extHost.$getCredentialProvider(null); })
|
||||
.then(
|
||||
() => { done('Provider was returned from null'); },
|
||||
() => { /* Swallow error, this is success path */ }
|
||||
() => { done('Provider was returned from null'); },
|
||||
() => { /* Swallow error, this is success path */ }
|
||||
)
|
||||
.then(() => {return extHost.$getCredentialProvider(''); })
|
||||
.then(() => { return extHost.$getCredentialProvider(''); })
|
||||
.then(
|
||||
() => { done('Provider was returned from \'\''); },
|
||||
() => { done(); }
|
||||
() => { done('Provider was returned from \'\''); },
|
||||
() => { done(); }
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ import { ExtHostDiagnostics } from 'vs/workbench/api/node/extHostDiagnostics';
|
||||
import { ExtHostHeapService } from 'vs/workbench/api/node/extHostHeapService';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ExtHostDataProtocol } from 'sql/workbench/api/node/extHostDataProtocol';
|
||||
import { SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user