mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add back getOptionsKey test that was reverted (#23274)
* Add back getOptionsKey test that was reverted * Add serverCapabilities to the IConnectionProfile object
This commit is contained in:
@@ -253,6 +253,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
|||||||
serverName: this.serverName,
|
serverName: this.serverName,
|
||||||
databaseName: this.databaseName,
|
databaseName: this.databaseName,
|
||||||
authenticationType: this.authenticationType,
|
authenticationType: this.authenticationType,
|
||||||
|
serverCapabilities: this.serverCapabilities,
|
||||||
getOptionsKey: this.getOptionsKey,
|
getOptionsKey: this.getOptionsKey,
|
||||||
getOptionKeyIdNames: this.getOptionKeyIdNames,
|
getOptionKeyIdNames: this.getOptionKeyIdNames,
|
||||||
matches: this.matches,
|
matches: this.matches,
|
||||||
|
|||||||
@@ -4,11 +4,13 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as azdata from 'azdata';
|
import * as azdata from 'azdata';
|
||||||
|
import { ConnectionProviderProperties } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||||
|
|
||||||
// Used to allow various methods of matching profiles
|
// Used to allow various methods of matching profiles
|
||||||
export type ProfileMatcher = (a: IConnectionProfile, b: IConnectionProfile) => boolean;
|
export type ProfileMatcher = (a: IConnectionProfile, b: IConnectionProfile) => boolean;
|
||||||
|
|
||||||
export interface IConnectionProfile extends azdata.IConnectionProfile {
|
export interface IConnectionProfile extends azdata.IConnectionProfile {
|
||||||
|
serverCapabilities: ConnectionProviderProperties | undefined;
|
||||||
getOptionsKey(): string;
|
getOptionsKey(): string;
|
||||||
getOptionKeyIdNames(): string[];
|
getOptionKeyIdNames(): string[];
|
||||||
matches(profile: azdata.IConnectionProfile): boolean;
|
matches(profile: azdata.IConnectionProfile): boolean;
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -309,6 +310,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupId: existingConnection.groupId,
|
groupId: existingConnection.groupId,
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: undefined,
|
groupFullName: undefined,
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -342,6 +344,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -486,6 +489,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -517,6 +521,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -555,6 +560,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'newid',
|
groupId: 'newid',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -636,6 +642,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -654,6 +661,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -695,6 +703,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -799,6 +808,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'g3',
|
groupFullName: 'g3',
|
||||||
groupId: 'g3',
|
groupId: 'g3',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
@@ -817,6 +827,7 @@ suite('ConnectionConfig', () => {
|
|||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
providerName: 'MSSQL',
|
providerName: 'MSSQL',
|
||||||
@@ -834,6 +845,7 @@ suite('ConnectionConfig', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'test',
|
groupFullName: 'test',
|
||||||
groupId: 'test',
|
groupId: 'test',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -282,4 +283,10 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
|||||||
test('an empty connection profile does not cause issues', () => {
|
test('an empty connection profile does not cause issues', () => {
|
||||||
assert.doesNotThrow(() => new ConnectionProfile(capabilitiesService, {} as IConnectionProfile));
|
assert.doesNotThrow(() => new ConnectionProfile(capabilitiesService, {} as IConnectionProfile));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('getOptionsKey should produce the same optionsKey after converting to IConnectionProfile', () => {
|
||||||
|
let conn = new ConnectionProfile(capabilitiesService, iConnectionProfile);
|
||||||
|
const myIConnectionProfile = conn.toIConnectionProfile();
|
||||||
|
assert.equal(conn.getOptionsKey(), myIConnectionProfile.getOptionsKey());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ suite('ConnectionStore', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupId: '',
|
groupId: '',
|
||||||
groupFullName: '',
|
groupFullName: '',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: () => false,
|
matches: () => false,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ suite('SQL ProviderConnectionInfo tests', () => {
|
|||||||
authenticationType: '',
|
authenticationType: '',
|
||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
|
serverCapabilities: undefined,
|
||||||
groupId: undefined,
|
groupId: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ let connectionProfile: IConnectionProfile = {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => 'connection1',
|
getOptionsKey: () => 'connection1',
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -44,6 +45,7 @@ let editorConnectionProfile: IConnectionProfile = {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => 'connection2',
|
getOptionsKey: () => 'connection2',
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -62,6 +64,7 @@ let connectionProfileWithoutDbName: IConnectionProfile = {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => 'connection1',
|
getOptionsKey: () => 'connection1',
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ suite('SQL ConnectionManagementService tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => { return 'connectionId'; },
|
getOptionsKey: () => { return 'connectionId'; },
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined,
|
matches: undefined,
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ suite('Insights Dialog Controller Tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: '',
|
groupFullName: '',
|
||||||
groupId: '',
|
groupId: '',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => '',
|
getOptionsKey: () => '',
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined,
|
matches: undefined,
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ suite('AsyncServerTreeDragAndDrop', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ suite('SQL Drag And Drop Controller tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
@@ -59,6 +60,7 @@ suite('SQL Drag And Drop Controller tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: undefined!,
|
getOptionsKey: undefined!,
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: undefined!,
|
matches: undefined!,
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ suite('Firewall rule dialog controller tests', () => {
|
|||||||
savePassword: true,
|
savePassword: true,
|
||||||
groupFullName: 'g2/g2-2',
|
groupFullName: 'g2/g2-2',
|
||||||
groupId: 'group id',
|
groupId: 'group id',
|
||||||
|
serverCapabilities: undefined,
|
||||||
getOptionsKey: () => '',
|
getOptionsKey: () => '',
|
||||||
getOptionKeyIdNames: undefined!,
|
getOptionKeyIdNames: undefined!,
|
||||||
matches: () => false,
|
matches: () => false,
|
||||||
|
|||||||
Reference in New Issue
Block a user