mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-26 17:23:15 -05:00
Fixing new connections not expanding in object explorer. (#22307)
* Fixing new connection node not expanding in OE * Fixing new connections not expanding and fixing expand request not resolving because of some provider error. * Fixing test * Adding a setting for node expansion timeout * Not saving when loading tree based connections * Adding some logs * Removing special casing for mssql provider * Missing providers * Adding user toast for node expansion timeout * Adding notification service to test * Fixing node type for mssql * remove polling * Fixing onNodeStatus * Fixing stuff * consolidating functions * Consolidating resolve logic * removing extra try catch * code cleanup * adding size checks * Removing commented code * Ignoring errors from other sessions and nodepaths.
This commit is contained in:
@@ -20,10 +20,14 @@ import { TestConnectionManagementService } from 'sql/platform/connection/test/co
|
||||
import { TestCapabilitiesService } from 'sql/platform/capabilities/test/common/testCapabilitiesService';
|
||||
import { NullAdsTelemetryService } from 'sql/platform/telemetry/common/adsTelemetryService';
|
||||
import { ConnectionOptionSpecialType, ServiceOptionType } from 'sql/platform/connection/common/interfaces';
|
||||
import { TestConfigurationService } from 'sql/platform/connection/test/common/testConfigurationService';
|
||||
import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService';
|
||||
|
||||
suite('SQL Object Explorer Service tests', () => {
|
||||
let sqlOEProvider: TypeMoq.Mock<TestObjectExplorerProvider>;
|
||||
let connectionManagementService: TypeMoq.Mock<TestConnectionManagementService>;
|
||||
let notificationService: TypeMoq.Mock<TestNotificationService>;
|
||||
let configurationService: TypeMoq.Mock<TestConfigurationService>;
|
||||
let connection: ConnectionProfile;
|
||||
let connectionToFail: ConnectionProfile;
|
||||
let conProfGroup: ConnectionProfileGroup;
|
||||
@@ -267,10 +271,23 @@ suite('SQL Object Explorer Service tests', () => {
|
||||
resolve(connection);
|
||||
}));
|
||||
|
||||
configurationService = TypeMoq.Mock.ofType(TestConfigurationService, TypeMoq.MockBehavior.Strict);
|
||||
configurationService.setup(x => x.getValue('serverTree.nodeExpansionTimeout')).returns(() => 45);
|
||||
|
||||
connectionManagementService.setup(x => x.getCapabilities(mssqlProviderName)).returns(() => undefined);
|
||||
|
||||
notificationService = TypeMoq.Mock.ofType(TestNotificationService, TypeMoq.MockBehavior.Strict);
|
||||
notificationService.setup(x => x.error(TypeMoq.It.isAny())).returns(() => undefined);
|
||||
|
||||
const logService = new NullLogService();
|
||||
objectExplorerService = new ObjectExplorerService(connectionManagementService.object, new NullAdsTelemetryService(), capabilitiesService, logService);
|
||||
objectExplorerService = new ObjectExplorerService(
|
||||
connectionManagementService.object,
|
||||
new NullAdsTelemetryService(),
|
||||
capabilitiesService,
|
||||
logService,
|
||||
configurationService.object,
|
||||
notificationService.object);
|
||||
|
||||
objectExplorerService.registerProvider(mssqlProviderName, sqlOEProvider.object);
|
||||
sqlOEProvider.setup(x => x.createNewSession(TypeMoq.It.is<azdata.ConnectionInfo>(x => x.options['serverName'] === connection.serverName))).returns(() => new Promise<any>((resolve) => {
|
||||
resolve(response);
|
||||
|
||||
Reference in New Issue
Block a user