@eclipse-glsp/server 1.1.0-RC08 → 1.1.0-RC10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/launch/worker-server-launcher.js +2 -3
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/action-dispatcher.js +2 -3
- package/lib/common/actions/action-dispatcher.js.map +1 -1
- package/lib/common/actions/action-handler-registry.js +4 -6
- package/lib/common/actions/action-handler-registry.js.map +1 -1
- package/lib/common/actions/client-action-handler.js +2 -3
- package/lib/common/actions/client-action-handler.js.map +1 -1
- package/lib/common/actions/global-action-provider.js +2 -3
- package/lib/common/actions/global-action-provider.js.map +1 -1
- package/lib/common/command/command-stack.js +2 -3
- package/lib/common/command/command-stack.js.map +1 -1
- package/lib/common/command/command.js +1 -1
- package/lib/common/command/command.js.map +1 -1
- package/lib/common/command/undo-redo-action-handler.js +2 -3
- package/lib/common/command/undo-redo-action-handler.js.map +1 -1
- package/lib/common/di/binding-target.d.ts.map +1 -1
- package/lib/common/di/binding-target.js +3 -2
- package/lib/common/di/binding-target.js.map +1 -1
- package/lib/common/di/glsp-module.js +2 -3
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/diagram/diagram-configuration.js +1 -1
- package/lib/common/diagram/diagram-configuration.js.map +1 -1
- package/lib/common/diagram/request-type-hints-action-handler.js +2 -3
- package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -1
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +2 -3
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -1
- package/lib/common/features/contextactions/command-palette-action-provider.js +2 -3
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.js +2 -3
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -1
- package/lib/common/features/contextactions/context-menu-item-provider.js +2 -3
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -1
- package/lib/common/features/contextactions/request-context-actions-handler.js +2 -3
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.js +4 -6
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
- package/lib/common/features/directediting/context-edit-validator-registry.js +2 -3
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -1
- package/lib/common/features/directediting/label-edit-validator.js +2 -3
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
- package/lib/common/features/directediting/request-edit-validation-handler.js +2 -3
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js +2 -3
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/features/layout/layout-operation-handler.js +2 -3
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
- package/lib/common/features/model/gmodel-factory.js +2 -3
- package/lib/common/features/model/gmodel-factory.js.map +1 -1
- package/lib/common/features/model/gmodel-index.js +2 -3
- package/lib/common/features/model/gmodel-index.js.map +1 -1
- package/lib/common/features/model/gmodel-serializer.js +2 -3
- package/lib/common/features/model/gmodel-serializer.js.map +1 -1
- package/lib/common/features/model/model-state.js +2 -3
- package/lib/common/features/model/model-state.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +2 -3
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +2 -3
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/model/save-model-action-handler.js +2 -3
- package/lib/common/features/model/save-model-action-handler.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-provider-registry.js +2 -3
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-resolver.js +2 -3
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +2 -3
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +2 -3
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/popup/request-popup-model-action-handler.js +2 -3
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -1
- package/lib/common/features/validation/request-markers-handler.js +2 -3
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +2 -3
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js +2 -3
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +2 -3
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/gmodel/cut-operation-handler.js +2 -3
- package/lib/common/gmodel/cut-operation-handler.js.map +1 -1
- package/lib/common/gmodel/delete-operation-handler.js +2 -3
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +2 -3
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +2 -3
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-diagram-module.js +2 -3
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
- package/lib/common/gmodel/gmodel-operation-handler.js +1 -1
- package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.js +2 -3
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +2 -3
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
- package/lib/common/launch/glsp-server-launcher.js +2 -3
- package/lib/common/launch/glsp-server-launcher.js.map +1 -1
- package/lib/common/launch/jsonrpc-server-launcher.js +2 -3
- package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -1
- package/lib/common/operations/compound-operation-handler.js +6 -12
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/create-operation-handler.js +1 -1
- package/lib/common/operations/create-operation-handler.js.map +1 -1
- package/lib/common/operations/operation-action-handler.js +2 -3
- package/lib/common/operations/operation-action-handler.js.map +1 -1
- package/lib/common/operations/operation-handler-registry.js +4 -6
- package/lib/common/operations/operation-handler-registry.js.map +1 -1
- package/lib/common/operations/operation-handler.js +2 -3
- package/lib/common/operations/operation-handler.js.map +1 -1
- package/lib/common/protocol/glsp-server.js +2 -3
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/session/client-session-factory.js +2 -3
- package/lib/common/session/client-session-factory.js.map +1 -1
- package/lib/common/session/client-session-manager.js +2 -3
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/utils/args-util.js +2 -2
- package/lib/common/utils/args-util.js.map +1 -1
- package/lib/common/utils/console-logger.js +2 -3
- package/lib/common/utils/console-logger.js.map +1 -1
- package/lib/common/utils/logger.d.ts.map +1 -1
- package/lib/common/utils/logger.js +5 -5
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/common/utils/registry.js +4 -6
- package/lib/common/utils/registry.js.map +1 -1
- package/lib/node/abstract-json-model-storage.js +2 -3
- package/lib/node/abstract-json-model-storage.js.map +1 -1
- package/lib/node/gmodel/gmodel-storage.js +2 -3
- package/lib/node/gmodel/gmodel-storage.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.js +2 -3
- package/lib/node/launch/socket-server-launcher.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +2 -3
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +7 -5
- package/src/common/di/binding-target.ts +1 -0
- package/src/common/utils/args-util.ts +1 -1
- package/src/common/utils/logger.ts +2 -1
- package/lib/common/actions/action-dispatcher.spec.d.ts +0 -2
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +0 -1
- package/lib/common/actions/action-dispatcher.spec.js +0 -264
- package/lib/common/actions/action-dispatcher.spec.js.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.d.ts +0 -2
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.js +0 -50
- package/lib/common/actions/action-handler-registry.spec.js.map +0 -1
- package/lib/common/actions/global-action-provider.spec.d.ts +0 -2
- package/lib/common/actions/global-action-provider.spec.d.ts.map +0 -1
- package/lib/common/actions/global-action-provider.spec.js +0 -70
- package/lib/common/actions/global-action-provider.spec.js.map +0 -1
- package/lib/common/command/command-stack.spec.d.ts +0 -2
- package/lib/common/command/command-stack.spec.d.ts.map +0 -1
- package/lib/common/command/command-stack.spec.js +0 -207
- package/lib/common/command/command-stack.spec.js.map +0 -1
- package/lib/common/command/command.spec.d.ts +0 -2
- package/lib/common/command/command.spec.d.ts.map +0 -1
- package/lib/common/command/command.spec.js +0 -86
- package/lib/common/command/command.spec.js.map +0 -1
- package/lib/common/command/recording-command.spec.d.ts +0 -17
- package/lib/common/command/recording-command.spec.d.ts.map +0 -1
- package/lib/common/command/recording-command.spec.js +0 -62
- package/lib/common/command/recording-command.spec.js.map +0 -1
- package/lib/common/di/binding-target.spec.d.ts +0 -2
- package/lib/common/di/binding-target.spec.d.ts.map +0 -1
- package/lib/common/di/binding-target.spec.js +0 -121
- package/lib/common/di/binding-target.spec.js.map +0 -1
- package/lib/common/di/multi-bindings.spec.d.ts +0 -2
- package/lib/common/di/multi-bindings.spec.d.ts.map +0 -1
- package/lib/common/di/multi-bindings.spec.js +0 -137
- package/lib/common/di/multi-bindings.spec.js.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +0 -2
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +0 -57
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +0 -2
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +0 -34
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +0 -2
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +0 -63
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +0 -2
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +0 -48
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +0 -2
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +0 -44
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +0 -2
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +0 -97
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +0 -2
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.js +0 -124
- package/lib/common/features/model/gmodel-serializer.spec.js.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.d.ts +0 -2
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.js +0 -50
- package/lib/common/operations/operation-handler-registry.spec.js.map +0 -1
- package/lib/common/protocol/glsp-server.spec.d.ts +0 -2
- package/lib/common/protocol/glsp-server.spec.d.ts.map +0 -1
- package/lib/common/protocol/glsp-server.spec.js +0 -132
- package/lib/common/protocol/glsp-server.spec.js.map +0 -1
- package/lib/common/session/client-session-factory.spec.d.ts +0 -2
- package/lib/common/session/client-session-factory.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-factory.spec.js +0 -56
- package/lib/common/session/client-session-factory.spec.js.map +0 -1
- package/lib/common/session/client-session-manager.spec.d.ts +0 -2
- package/lib/common/session/client-session-manager.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-manager.spec.js +0 -74
- package/lib/common/session/client-session-manager.spec.js.map +0 -1
- package/lib/common/test/mock-util.d.ts +0 -120
- package/lib/common/test/mock-util.d.ts.map +0 -1
- package/lib/common/test/mock-util.js +0 -216
- package/lib/common/test/mock-util.js.map +0 -1
- package/lib/common/utils/promise-queue.spec.d.ts +0 -2
- package/lib/common/utils/promise-queue.spec.d.ts.map +0 -1
- package/lib/common/utils/promise-queue.spec.js +0 -117
- package/lib/common/utils/promise-queue.spec.js.map +0 -1
- package/lib/common/utils/registry.spec.d.ts +0 -2
- package/lib/common/utils/registry.spec.d.ts.map +0 -1
- package/lib/common/utils/registry.spec.js +0 -199
- package/lib/common/utils/registry.spec.js.map +0 -1
- package/lib/node/launch/cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/cli-parser.spec.js +0 -56
- package/lib/node/launch/cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.js +0 -66
- package/lib/node/launch/socket-cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.d.ts +0 -17
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.js +0 -75
- package/lib/node/launch/socket-server-launcher.spec.js.map +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
import { GEdge, GModelElement, GModelElementConstructor, GNode } from '@eclipse-glsp/graph';
|
|
17
|
-
import { Action, ActionMessage, Args, CreateNodeOperation, EdgeTypeHint, GLSPClientProxy, GLSPServer, GLSPServerListener, InitializeClientSessionParameters, MaybeArray, MaybePromise, Point, RequestEditValidationAction, ShapeTypeHint, ValidationStatus } from '@eclipse-glsp/protocol';
|
|
18
|
-
import { Container } from 'inversify';
|
|
19
|
-
import { MessageConnection } from 'vscode-jsonrpc';
|
|
20
|
-
import { ActionDispatcher } from '../actions/action-dispatcher';
|
|
21
|
-
import { ActionHandler, ActionHandlerFactory } from '../actions/action-handler';
|
|
22
|
-
import { Command } from '../command/command';
|
|
23
|
-
import { DiagramConfiguration, ServerLayoutKind } from '../diagram/diagram-configuration';
|
|
24
|
-
import { ContextEditValidator } from '../features/directediting/context-edit-validator';
|
|
25
|
-
import { LabelEditValidator } from '../features/directediting/label-edit-validator';
|
|
26
|
-
import { GModelCreateEdgeOperationHandler, GModelCreateNodeOperationHandler } from '../gmodel/index';
|
|
27
|
-
import { ClientSession } from '../session/client-session';
|
|
28
|
-
import { ClientSessionFactory } from '../session/client-session-factory';
|
|
29
|
-
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
30
|
-
import { ClientSessionListener } from '../session/client-session-listener';
|
|
31
|
-
import { ClientSessionManager } from '../session/client-session-manager';
|
|
32
|
-
import { LogLevel, Logger } from '../utils/logger';
|
|
33
|
-
export declare function delay(ms: number): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Consumes a maybe async function and checks for error
|
|
36
|
-
* @param method - The function to check
|
|
37
|
-
* @param message - Optional message to match with error message
|
|
38
|
-
*/
|
|
39
|
-
export declare function expectToThrowAsync(toEvaluate: () => MaybePromise<void>, message?: string): Promise<void>;
|
|
40
|
-
export declare function createClientSession(id: string, diagramType: string, container?: Container, actionDispatcher?: StubActionDispatcher): ClientSession;
|
|
41
|
-
export declare class StubActionHandler implements ActionHandler {
|
|
42
|
-
actionKinds: string[];
|
|
43
|
-
constructor(actionKinds: string[]);
|
|
44
|
-
execute(action: Action): Action[];
|
|
45
|
-
}
|
|
46
|
-
export declare class StubCreateNodeOperationHandler extends GModelCreateNodeOperationHandler {
|
|
47
|
-
readonly label: string;
|
|
48
|
-
elementTypeIds: string[];
|
|
49
|
-
constructor(label: string);
|
|
50
|
-
createNode(operation: CreateNodeOperation, relativeLocation?: Point): GNode | undefined;
|
|
51
|
-
}
|
|
52
|
-
export declare class StubCreateEdgeOperationHandler extends GModelCreateEdgeOperationHandler {
|
|
53
|
-
readonly label: string;
|
|
54
|
-
elementTypeIds: string[];
|
|
55
|
-
constructor(label: string);
|
|
56
|
-
createEdge(source: GModelElement, target: GModelElement): GEdge | undefined;
|
|
57
|
-
}
|
|
58
|
-
export declare class StubActionDispatcher implements ActionDispatcher {
|
|
59
|
-
dispatchAfterNextUpdate(...actions: MaybeArray<Action[]>): void;
|
|
60
|
-
dispatch(action: Action): Promise<void>;
|
|
61
|
-
dispatchAll(...actions: MaybeArray<Action>[]): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
export declare class StubClientSessionFactory implements ClientSessionFactory {
|
|
64
|
-
create(params: InitializeClientSessionParameters): ClientSession;
|
|
65
|
-
}
|
|
66
|
-
export declare class StubClientSessionManager implements ClientSessionManager {
|
|
67
|
-
getOrCreateClientSession(params: InitializeClientSessionParameters): ClientSession;
|
|
68
|
-
getSession(clientSessionId: string): ClientSession | undefined;
|
|
69
|
-
getSessionsByType(diagramType: string): ClientSession[];
|
|
70
|
-
disposeClientSession(clientSessionId: string): boolean;
|
|
71
|
-
addListener(listener: ClientSessionListener, ...clientSessionIds: string[]): boolean;
|
|
72
|
-
removeListener(listener: ClientSessionListener): boolean;
|
|
73
|
-
removeListeners(...clientSessionIds: string[]): void;
|
|
74
|
-
}
|
|
75
|
-
export declare class StubLogger extends Logger {
|
|
76
|
-
logLevel: LogLevel;
|
|
77
|
-
caller: undefined;
|
|
78
|
-
info(message: string, ...params: any[]): void;
|
|
79
|
-
warn(message: string, ...params: any[]): void;
|
|
80
|
-
error(message: string, ...params: any[]): void;
|
|
81
|
-
debug(message: string, ...params: any[]): void;
|
|
82
|
-
}
|
|
83
|
-
export declare class StubClientSessionListener implements ClientSessionListener {
|
|
84
|
-
sessionCreated(clientSession: ClientSession): void;
|
|
85
|
-
sessionDisposed(clientSession: ClientSession): void;
|
|
86
|
-
}
|
|
87
|
-
export declare class StubGLSPClientProxy implements GLSPClientProxy {
|
|
88
|
-
connect(connection: MessageConnection): void;
|
|
89
|
-
process(message: ActionMessage<Action>): void;
|
|
90
|
-
}
|
|
91
|
-
export declare class StubGLSPServerListener implements GLSPServerListener {
|
|
92
|
-
serverInitialized(server: GLSPServer): void;
|
|
93
|
-
serverShutDown(server: GLSPServer): void;
|
|
94
|
-
}
|
|
95
|
-
export declare class StubDiagramConfiguration implements DiagramConfiguration {
|
|
96
|
-
typeMapping: Map<string, GModelElementConstructor<GModelElement>>;
|
|
97
|
-
shapeTypeHints: ShapeTypeHint[];
|
|
98
|
-
edgeTypeHints: EdgeTypeHint[];
|
|
99
|
-
layoutKind: ServerLayoutKind;
|
|
100
|
-
needsClientLayout: boolean;
|
|
101
|
-
animatedUpdate: boolean;
|
|
102
|
-
}
|
|
103
|
-
export declare class TestLabelEditValidator extends LabelEditValidator {
|
|
104
|
-
validate(label: string, element: GModelElement): ValidationStatus;
|
|
105
|
-
}
|
|
106
|
-
export declare class TestContextEditValidator implements ContextEditValidator {
|
|
107
|
-
get contextId(): string;
|
|
108
|
-
validate(action: RequestEditValidationAction): ValidationStatus;
|
|
109
|
-
}
|
|
110
|
-
export declare const stubActionHandlerFactory: ActionHandlerFactory;
|
|
111
|
-
export declare class StubClientSessionInitializer implements ClientSessionInitializer {
|
|
112
|
-
initialize(args?: Args): void;
|
|
113
|
-
}
|
|
114
|
-
export declare class StubCommand implements Command {
|
|
115
|
-
execute(): void;
|
|
116
|
-
undo(): void;
|
|
117
|
-
redo(): void;
|
|
118
|
-
canUndo?(): boolean;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=mock-util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-util.d.ts","sourceRoot":"","sources":["../../../src/common/test/mock-util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAIlF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EACH,MAAM,EACN,aAAa,EACb,IAAI,EACJ,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,iCAAiC,EACjC,UAAU,EACV,YAAY,EACZ,KAAK,EACL,2BAA2B,EAC3B,aAAa,EACb,gBAAgB,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAA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AQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,gBAAgB;CASpE;AAED,qBAAa,wBAAyB,YAAW,oBAAoB;IACjE,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,QAAQ,CAAC,MAAM,EAAE,2BAA2B,GAAG,gBAAgB;CASlE;AAED,eAAO,MAAM,wBAAwB,EAAE,oBAAuD,CAAC;AAE/F,qBAAa,4BAA6B,YAAW,wBAAwB;IACzE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI;CAChC;AAED,qBAAa,WAAY,YAAW,OAAO;IACvC,OAAO,IAAI,IAAI;IACf,IAAI,IAAI,IAAI;IACZ,IAAI,IAAI,IAAI;IACZ,OAAO,CAAC,IAAI,OAAO;CACtB"}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made available under the
|
|
6
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
*
|
|
9
|
-
* This Source Code may also be made available under the following Secondary
|
|
10
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
* with the GNU Classpath Exception which is available at
|
|
13
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
*
|
|
15
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
-
********************************************************************************/
|
|
17
|
-
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
18
|
-
// Stub-implementation classes used for unit testing
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.StubCommand = exports.StubClientSessionInitializer = exports.stubActionHandlerFactory = exports.TestContextEditValidator = exports.TestLabelEditValidator = exports.StubDiagramConfiguration = exports.StubGLSPServerListener = exports.StubGLSPClientProxy = exports.StubClientSessionListener = exports.StubLogger = exports.StubClientSessionManager = exports.StubClientSessionFactory = exports.StubActionDispatcher = exports.StubCreateEdgeOperationHandler = exports.StubCreateNodeOperationHandler = exports.StubActionHandler = exports.createClientSession = exports.expectToThrowAsync = exports.delay = void 0;
|
|
21
|
-
const graph_1 = require("@eclipse-glsp/graph");
|
|
22
|
-
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
23
|
-
const chai_1 = require("chai");
|
|
24
|
-
const inversify_1 = require("inversify");
|
|
25
|
-
const diagram_configuration_1 = require("../diagram/diagram-configuration");
|
|
26
|
-
const label_edit_validator_1 = require("../features/directediting/label-edit-validator");
|
|
27
|
-
const index_1 = require("../gmodel/index");
|
|
28
|
-
const logger_1 = require("../utils/logger");
|
|
29
|
-
async function delay(ms) {
|
|
30
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
31
|
-
}
|
|
32
|
-
exports.delay = delay;
|
|
33
|
-
/**
|
|
34
|
-
* Consumes a maybe async function and checks for error
|
|
35
|
-
* @param method - The function to check
|
|
36
|
-
* @param message - Optional message to match with error message
|
|
37
|
-
*/
|
|
38
|
-
async function expectToThrowAsync(toEvaluate, message) {
|
|
39
|
-
let err = undefined;
|
|
40
|
-
try {
|
|
41
|
-
await toEvaluate();
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
err = error;
|
|
45
|
-
}
|
|
46
|
-
if (message) {
|
|
47
|
-
(0, chai_1.expect)(err === null || err === void 0 ? void 0 : err.message).to.be.equal(message);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
(0, chai_1.expect)(err).to.be.an('Error');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.expectToThrowAsync = expectToThrowAsync;
|
|
54
|
-
function createClientSession(id, diagramType, container = new inversify_1.Container(), actionDispatcher = new StubActionDispatcher()) {
|
|
55
|
-
return {
|
|
56
|
-
id,
|
|
57
|
-
diagramType,
|
|
58
|
-
container,
|
|
59
|
-
actionDispatcher,
|
|
60
|
-
dispose: () => {
|
|
61
|
-
//
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
exports.createClientSession = createClientSession;
|
|
66
|
-
class StubActionHandler {
|
|
67
|
-
constructor(actionKinds) {
|
|
68
|
-
this.actionKinds = actionKinds;
|
|
69
|
-
}
|
|
70
|
-
execute(action) {
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.StubActionHandler = StubActionHandler;
|
|
75
|
-
class StubCreateNodeOperationHandler extends index_1.GModelCreateNodeOperationHandler {
|
|
76
|
-
constructor(label) {
|
|
77
|
-
super();
|
|
78
|
-
this.label = label;
|
|
79
|
-
this.elementTypeIds = [label];
|
|
80
|
-
}
|
|
81
|
-
createNode(operation, relativeLocation) {
|
|
82
|
-
return new graph_1.GNode();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
exports.StubCreateNodeOperationHandler = StubCreateNodeOperationHandler;
|
|
86
|
-
class StubCreateEdgeOperationHandler extends index_1.GModelCreateEdgeOperationHandler {
|
|
87
|
-
constructor(label) {
|
|
88
|
-
super();
|
|
89
|
-
this.label = label;
|
|
90
|
-
this.elementTypeIds = [label];
|
|
91
|
-
}
|
|
92
|
-
createEdge(source, target) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.StubCreateEdgeOperationHandler = StubCreateEdgeOperationHandler;
|
|
97
|
-
class StubActionDispatcher {
|
|
98
|
-
dispatchAfterNextUpdate(...actions) { }
|
|
99
|
-
dispatch(action) {
|
|
100
|
-
return Promise.resolve();
|
|
101
|
-
}
|
|
102
|
-
dispatchAll(...actions) {
|
|
103
|
-
return Promise.resolve();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
exports.StubActionDispatcher = StubActionDispatcher;
|
|
107
|
-
class StubClientSessionFactory {
|
|
108
|
-
create(params) {
|
|
109
|
-
const { clientSessionId, diagramType } = params;
|
|
110
|
-
return createClientSession(clientSessionId, diagramType);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.StubClientSessionFactory = StubClientSessionFactory;
|
|
114
|
-
class StubClientSessionManager {
|
|
115
|
-
getOrCreateClientSession(params) {
|
|
116
|
-
const { clientSessionId, diagramType } = params;
|
|
117
|
-
return createClientSession(clientSessionId, diagramType);
|
|
118
|
-
}
|
|
119
|
-
getSession(clientSessionId) {
|
|
120
|
-
return undefined;
|
|
121
|
-
}
|
|
122
|
-
getSessionsByType(diagramType) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
disposeClientSession(clientSessionId) {
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
addListener(listener, ...clientSessionIds) {
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
removeListener(listener) {
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
removeListeners(...clientSessionIds) {
|
|
135
|
-
return undefined;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.StubClientSessionManager = StubClientSessionManager;
|
|
139
|
-
class StubLogger extends logger_1.Logger {
|
|
140
|
-
constructor() {
|
|
141
|
-
super(...arguments);
|
|
142
|
-
this.logLevel = logger_1.LogLevel.none;
|
|
143
|
-
this.caller = undefined;
|
|
144
|
-
}
|
|
145
|
-
info(message, ...params) { }
|
|
146
|
-
warn(message, ...params) { }
|
|
147
|
-
error(message, ...params) { }
|
|
148
|
-
debug(message, ...params) { }
|
|
149
|
-
}
|
|
150
|
-
exports.StubLogger = StubLogger;
|
|
151
|
-
class StubClientSessionListener {
|
|
152
|
-
sessionCreated(clientSession) { }
|
|
153
|
-
sessionDisposed(clientSession) { }
|
|
154
|
-
}
|
|
155
|
-
exports.StubClientSessionListener = StubClientSessionListener;
|
|
156
|
-
class StubGLSPClientProxy {
|
|
157
|
-
connect(connection) { }
|
|
158
|
-
process(message) { }
|
|
159
|
-
}
|
|
160
|
-
exports.StubGLSPClientProxy = StubGLSPClientProxy;
|
|
161
|
-
class StubGLSPServerListener {
|
|
162
|
-
serverInitialized(server) { }
|
|
163
|
-
serverShutDown(server) { }
|
|
164
|
-
}
|
|
165
|
-
exports.StubGLSPServerListener = StubGLSPServerListener;
|
|
166
|
-
class StubDiagramConfiguration {
|
|
167
|
-
constructor() {
|
|
168
|
-
this.typeMapping = new Map();
|
|
169
|
-
this.shapeTypeHints = [];
|
|
170
|
-
this.edgeTypeHints = [];
|
|
171
|
-
this.layoutKind = diagram_configuration_1.ServerLayoutKind.NONE;
|
|
172
|
-
this.needsClientLayout = true;
|
|
173
|
-
this.animatedUpdate = true;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
exports.StubDiagramConfiguration = StubDiagramConfiguration;
|
|
177
|
-
class TestLabelEditValidator extends label_edit_validator_1.LabelEditValidator {
|
|
178
|
-
validate(label, element) {
|
|
179
|
-
if (label === 'error') {
|
|
180
|
-
return { severity: protocol_1.ValidationStatus.Severity.ERROR, message: 'error' };
|
|
181
|
-
}
|
|
182
|
-
if (label === 'warning') {
|
|
183
|
-
return { severity: protocol_1.ValidationStatus.Severity.WARNING, message: 'warning' };
|
|
184
|
-
}
|
|
185
|
-
return { severity: protocol_1.ValidationStatus.Severity.OK, message: 'ok' };
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
exports.TestLabelEditValidator = TestLabelEditValidator;
|
|
189
|
-
class TestContextEditValidator {
|
|
190
|
-
get contextId() {
|
|
191
|
-
return 'test';
|
|
192
|
-
}
|
|
193
|
-
validate(action) {
|
|
194
|
-
if (action.text === 'error') {
|
|
195
|
-
return { severity: protocol_1.ValidationStatus.Severity.ERROR, message: 'error' };
|
|
196
|
-
}
|
|
197
|
-
if (action.text === 'warning') {
|
|
198
|
-
return { severity: protocol_1.ValidationStatus.Severity.WARNING, message: 'warning' };
|
|
199
|
-
}
|
|
200
|
-
return { severity: protocol_1.ValidationStatus.Severity.OK, message: 'ok' };
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
exports.TestContextEditValidator = TestContextEditValidator;
|
|
204
|
-
const stubActionHandlerFactory = constructor => new constructor();
|
|
205
|
-
exports.stubActionHandlerFactory = stubActionHandlerFactory;
|
|
206
|
-
class StubClientSessionInitializer {
|
|
207
|
-
initialize(args) { }
|
|
208
|
-
}
|
|
209
|
-
exports.StubClientSessionInitializer = StubClientSessionInitializer;
|
|
210
|
-
class StubCommand {
|
|
211
|
-
execute() { }
|
|
212
|
-
undo() { }
|
|
213
|
-
redo() { }
|
|
214
|
-
}
|
|
215
|
-
exports.StubCommand = StubCommand;
|
|
216
|
-
//# sourceMappingURL=mock-util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-util.js","sourceRoot":"","sources":["../../../src/common/test/mock-util.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yDAAyD;AACzD,oDAAoD;;;AAEpD,+CAA4F;AAC5F,qDAgBgC;AAChC,+BAA8B;AAC9B,yCAAsC;AAKtC,4EAA0F;AAE1F,yFAAoF;AACpF,2CAAqG;AAMrG,4CAAmD;AAE5C,KAAK,UAAU,KAAK,CAAC,EAAU;IAClC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,sBAEC;AAED;;;;GAIG;AACI,KAAK,UAAU,kBAAkB,CAAC,UAAoC,EAAE,OAAgB;IAC3F,IAAI,GAAG,GAAsB,SAAS,CAAC;IACvC,IAAI;QACA,MAAM,UAAU,EAAE,CAAC;KACtB;IAAC,OAAO,KAAU,EAAE;QACjB,GAAG,GAAG,KAAK,CAAC;KACf;IACD,IAAI,OAAO,EAAE;QACT,IAAA,aAAM,EAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,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AAC;IACrE,CAAC;CACJ;AAVD,wDAUC;AAED,MAAa,wBAAwB;IACjC,IAAI,SAAS;QACT,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,MAAmC;QACxC,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO,EAAE,QAAQ,EAAE,2BAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;SAC1E;QACD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,OAAO,EAAE,QAAQ,EAAE,2BAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;SAC9E;QACD,OAAO,EAAE,QAAQ,EAAE,2BAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrE,CAAC;CACJ;AAdD,4DAcC;AAEM,MAAM,wBAAwB,GAAyB,WAAW,CAAC,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC;AAAlF,QAAA,wBAAwB,4BAA0D;AAE/F,MAAa,4BAA4B;IACrC,UAAU,CAAC,IAAW,IAAS,CAAC;CACnC;AAFD,oEAEC;AAED,MAAa,WAAW;IACpB,OAAO,KAAU,CAAC;IAClB,IAAI,KAAU,CAAC;IACf,IAAI,KAAU,CAAC;CAElB;AALD,kCAKC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise-queue.spec.d.ts","sourceRoot":"","sources":["../../../src/common/utils/promise-queue.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
5
|
-
*
|
|
6
|
-
* This program and the accompanying materials are made available under the
|
|
7
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
8
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
9
|
-
*
|
|
10
|
-
* This Source Code may also be made available under the following Secondary
|
|
11
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
12
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
13
|
-
* with the GNU Classpath Exception which is available at
|
|
14
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
15
|
-
*
|
|
16
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
|
-
********************************************************************************/
|
|
18
|
-
const mock_util_1 = require("../test/mock-util");
|
|
19
|
-
const promise_queue_1 = require("./promise-queue");
|
|
20
|
-
const chai_1 = require("chai");
|
|
21
|
-
// Helper types and functions that are needed for test setup
|
|
22
|
-
/**
|
|
23
|
-
* Helper class to inspect the state of promise during its resolve() execution.
|
|
24
|
-
*/
|
|
25
|
-
class PromiseState {
|
|
26
|
-
constructor() {
|
|
27
|
-
this._started = false;
|
|
28
|
-
this._stopped = false;
|
|
29
|
-
}
|
|
30
|
-
start() {
|
|
31
|
-
this._started = true;
|
|
32
|
-
if (this.onStartRunnable) {
|
|
33
|
-
this.onStartRunnable();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
stop() {
|
|
37
|
-
this._stopped = true;
|
|
38
|
-
if (this.onStopRunnable) {
|
|
39
|
-
this.onStopRunnable();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
onStart(runnable) {
|
|
43
|
-
this.onStartRunnable = runnable;
|
|
44
|
-
}
|
|
45
|
-
onStop(runnable) {
|
|
46
|
-
this.onStopRunnable = runnable;
|
|
47
|
-
}
|
|
48
|
-
get started() {
|
|
49
|
-
return this._started;
|
|
50
|
-
}
|
|
51
|
-
get stopped() {
|
|
52
|
-
return this._stopped;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function newTestPromise(resolveTime) {
|
|
56
|
-
const state = new PromiseState();
|
|
57
|
-
const promise = async () => {
|
|
58
|
-
state.start();
|
|
59
|
-
await (0, mock_util_1.delay)(resolveTime);
|
|
60
|
-
state.stop();
|
|
61
|
-
};
|
|
62
|
-
return { state, promise };
|
|
63
|
-
}
|
|
64
|
-
let queue = new promise_queue_1.PromiseQueue();
|
|
65
|
-
// Test execution
|
|
66
|
-
describe('test PromiseQueue', () => {
|
|
67
|
-
beforeEach(() => {
|
|
68
|
-
queue = new promise_queue_1.PromiseQueue();
|
|
69
|
-
});
|
|
70
|
-
it('enqueue - one element', async () => {
|
|
71
|
-
const { state, promise } = newTestPromise(100);
|
|
72
|
-
state.onStart(() => {
|
|
73
|
-
(0, chai_1.expect)(queue.isBusy).true;
|
|
74
|
-
});
|
|
75
|
-
const queEnd = queue.enqueue(promise);
|
|
76
|
-
(0, chai_1.expect)(queue.isEmpty).true;
|
|
77
|
-
await queEnd;
|
|
78
|
-
});
|
|
79
|
-
it('enqueue - two elements', async () => {
|
|
80
|
-
const p1 = newTestPromise(100);
|
|
81
|
-
p1.state.onStop(() => (0, chai_1.expect)(p2.state.started).false);
|
|
82
|
-
const p2 = newTestPromise(100);
|
|
83
|
-
p2.state.onStart(() => {
|
|
84
|
-
(0, chai_1.expect)(queue.isEmpty).true;
|
|
85
|
-
(0, chai_1.expect)(p1.state.stopped).true;
|
|
86
|
-
});
|
|
87
|
-
queue.enqueue(p1.promise);
|
|
88
|
-
const queEnd = queue.enqueue(p2.promise);
|
|
89
|
-
(0, chai_1.expect)(queue.size).to.be.equal(1);
|
|
90
|
-
await queEnd;
|
|
91
|
-
});
|
|
92
|
-
it('enqueue - three elements (first promise in queue has longest resolve time)', async () => {
|
|
93
|
-
const p1 = newTestPromise(300);
|
|
94
|
-
p1.state.onStop(() => {
|
|
95
|
-
(0, chai_1.expect)(p2.state.started).false;
|
|
96
|
-
(0, chai_1.expect)(p3.state.started).false;
|
|
97
|
-
});
|
|
98
|
-
const p2 = newTestPromise(200);
|
|
99
|
-
p2.state.onStart(() => {
|
|
100
|
-
(0, chai_1.expect)(queue.size).to.be.equal(1);
|
|
101
|
-
(0, chai_1.expect)(p1.state.stopped).true;
|
|
102
|
-
(0, chai_1.expect)(p3.state.started).false;
|
|
103
|
-
});
|
|
104
|
-
const p3 = newTestPromise(100);
|
|
105
|
-
p3.state.onStart(() => {
|
|
106
|
-
(0, chai_1.expect)(queue.isEmpty).true;
|
|
107
|
-
(0, chai_1.expect)(p2.state.stopped).true;
|
|
108
|
-
});
|
|
109
|
-
queue.enqueue(p1.promise);
|
|
110
|
-
queue.enqueue(p2.promise);
|
|
111
|
-
(0, chai_1.expect)(queue.size).to.be.equal(1);
|
|
112
|
-
const queueEnd = queue.enqueue(p3.promise);
|
|
113
|
-
(0, chai_1.expect)(queue.size).to.be.equal(2);
|
|
114
|
-
await queueEnd;
|
|
115
|
-
});
|
|
116
|
-
});
|
|
117
|
-
//# sourceMappingURL=promise-queue.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise-queue.spec.js","sourceRoot":"","sources":["../../../src/common/utils/promise-queue.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA0C;AAC1C,mDAA+C;AAC/C,+BAA8B;AAE9B,4DAA4D;AAE5D;;GAEG;AACH,MAAM,YAAY;IAAlB;QACY,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;IAiC7B,CAAC;IA7BG,KAAK;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC,eAAe,EAAE;YACtB,IAAI,CAAC,eAAe,EAAE,CAAC;SAC1B;IACL,CAAC;IAED,IAAI;QACA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC,cAAc,EAAE;YACrB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;IACL,CAAC;IAED,OAAO,CAAC,QAAoB;QACxB,IAAI,CAAC,eAAe,GAAG,Q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