@aj-shadow/z-abs-funclayer-engine-server 0.0.0-aj-beta.221
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/.gitattributes +26 -0
- package/LICENSE.txt +96 -0
- package/README.md +5 -0
- package/npm-shrinkwrap.json +13 -0
- package/package.json +10 -0
- package/project/server/_build/Server-FuncLayer-Engine-server.bld +12 -0
- package/project/server/_build/z-abs-funclayer-engine-server.prj +12 -0
- package/project/server/address/address-calculator.js +377 -0
- package/project/server/address/address-data.js +364 -0
- package/project/server/address/address-manager.js +251 -0
- package/project/server/address/address.js +176 -0
- package/project/server/address/addresses.js +122 -0
- package/project/server/address/dns-url-cache.js +130 -0
- package/project/server/address/interfaces.js +100 -0
- package/project/server/address/local-dns.js +35 -0
- package/project/server/address/login-report.js +56 -0
- package/project/server/address/networks.js +598 -0
- package/project/server/address/real-networks.js +102 -0
- package/project/server/address/subnet.js +60 -0
- package/project/server/communication/messages/messages-s-to-c/message-execution-started.js +17 -0
- package/project/server/communication/messages/messages-s-to-c/message-execution-stopped.js +14 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-case-debug-paused.js +18 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-case-log.js +25 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-case-started.js +21 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-case-state.js +18 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-case-stopped.js +22 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-stage-started.js +19 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-stage-stopped.js +19 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-suite-started.js +16 -0
- package/project/server/communication/messages/messages-s-to-c/message-test-suite-stopped.js +19 -0
- package/project/server/communication/messages/messages-s-to-w/message-test-case-debug-actor-index-ok.js +15 -0
- package/project/server/communication/messages/messages-w-to-s/message-test-case-debug-actor-index.js +15 -0
- package/project/server/debug/debug-step-over.js +54 -0
- package/project/server/debug/debugger.js +102 -0
- package/project/server/debug-dashboard/debug-dashboard.js +14 -0
- package/project/server/debug-dashboard/gauge-manager.js +44 -0
- package/project/server/debug-dashboard/gauge.js +37 -0
- package/project/server/engine/actor/actor-condition.js +335 -0
- package/project/server/engine/actor/actor-intercepting.js +32 -0
- package/project/server/engine/actor/actor-local.js +24 -0
- package/project/server/engine/actor/actor-mixins/asynch-mixin.js +103 -0
- package/project/server/engine/actor/actor-mixins/content-mixin.js +22 -0
- package/project/server/engine/actor/actor-mixins/logger-mixin.js +603 -0
- package/project/server/engine/actor/actor-mixins/process-mixin.js +35 -0
- package/project/server/engine/actor/actor-mixins/shared-data-mixin.js +109 -0
- package/project/server/engine/actor/actor-mixins/shared-execution-data-mixin.js +57 -0
- package/project/server/engine/actor/actor-mixins/stack-mixin-client.js +157 -0
- package/project/server/engine/actor/actor-mixins/stack-mixin-server.js +123 -0
- package/project/server/engine/actor/actor-mixins/stack-mixin.js +128 -0
- package/project/server/engine/actor/actor-mixins/test-data-mixin.js +402 -0
- package/project/server/engine/actor/actor-mixins/timer-mixin.js +44 -0
- package/project/server/engine/actor/actor-mixins/verify-mixin-base.js +668 -0
- package/project/server/engine/actor/actor-mixins/verify-mixin-mandatory.js +46 -0
- package/project/server/engine/actor/actor-mixins/verify-mixin-optional.js +44 -0
- package/project/server/engine/actor/actor-mixins/verify-mixin-value.js +71 -0
- package/project/server/engine/actor/actor-originating.js +32 -0
- package/project/server/engine/actor/actor-part-mixins/part-asynch-mixin.js +24 -0
- package/project/server/engine/actor/actor-part-mixins/part-logger-mixin.js +39 -0
- package/project/server/engine/actor/actor-part-mixins/part-shared-runtime-data-mixin.js +33 -0
- package/project/server/engine/actor/actor-part-mixins/part-timer-mixin.js +12 -0
- package/project/server/engine/actor/actor-part-mixins/part-verify-mixin-mandatory.js +15 -0
- package/project/server/engine/actor/actor-part-mixins/part-verify-mixin-optional.js +15 -0
- package/project/server/engine/actor/actor-part-mixins/part-verify-mixin-value.js +15 -0
- package/project/server/engine/actor/actor-part-post.js +37 -0
- package/project/server/engine/actor/actor-part-pre.js +37 -0
- package/project/server/engine/actor/actor-pending.js +79 -0
- package/project/server/engine/actor/actor-proxy.js +38 -0
- package/project/server/engine/actor/actor-results.js +36 -0
- package/project/server/engine/actor/actor-state-timeout.js +35 -0
- package/project/server/engine/actor/actor-sut.js +38 -0
- package/project/server/engine/actor/actor-terminating.js +32 -0
- package/project/server/engine/actor/actor.js +553 -0
- package/project/server/engine/actor-phase.js +26 -0
- package/project/server/engine/actor-state-machine-base.js +298 -0
- package/project/server/engine/actor-state-machine-data.js +383 -0
- package/project/server/engine/actor-state-machine-exec.js +137 -0
- package/project/server/engine/actor-state-machine-post.js +177 -0
- package/project/server/engine/actor-state-machine-pre.js +142 -0
- package/project/server/engine/actor-state-machine-process.js +88 -0
- package/project/server/engine/actor-state-machine-state.js +52 -0
- package/project/server/engine/actor-state-machine.js +185 -0
- package/project/server/engine/actor-state.js +35 -0
- package/project/server/engine/actor-worker.js +68 -0
- package/project/server/engine/actors-phase.js +49 -0
- package/project/server/engine/actors.js +317 -0
- package/project/server/engine/data/content-audio.js +18 -0
- package/project/server/engine/data/content-base.js +91 -0
- package/project/server/engine/data/content-binary.js +15 -0
- package/project/server/engine/data/content-cache.js +67 -0
- package/project/server/engine/data/content-data.js +254 -0
- package/project/server/engine/data/content-documents.js +18 -0
- package/project/server/engine/data/content-image.js +20 -0
- package/project/server/engine/data/content-other.js +19 -0
- package/project/server/engine/data/content-text.js +19 -0
- package/project/server/engine/data/content-undefined.js +14 -0
- package/project/server/engine/data/content-video.js +20 -0
- package/project/server/engine/data/content.js +60 -0
- package/project/server/engine/data/runtime-data-shared.js +75 -0
- package/project/server/engine/data/test-data.js +239 -0
- package/project/server/engine/execution-context-test-case.js +48 -0
- package/project/server/engine/execution-context-test-suite.js +66 -0
- package/project/server/engine/execution-context.js +93 -0
- package/project/server/engine/stage-setter.js +132 -0
- package/project/server/engine/stage.js +83 -0
- package/project/server/engine/test-case-load.js +25 -0
- package/project/server/engine/test-case-loader.js +125 -0
- package/project/server/engine/test-case-not-found.js +29 -0
- package/project/server/engine/test-case-result-type.js +42 -0
- package/project/server/engine/test-case.js +417 -0
- package/project/server/engine/test-output.js +116 -0
- package/project/server/engine/test-statistics-test-case.js +59 -0
- package/project/server/engine/test-statistics-test-suite.js +63 -0
- package/project/server/engine/test-suite.js +276 -0
- package/project/server/stack/api/base-64.js +16 -0
- package/project/server/stack/api/const-commands-decoder.js +15 -0
- package/project/server/stack/api/const-commands-encoder.js +15 -0
- package/project/server/stack/api/hmacSha1.js +14 -0
- package/project/server/stack/api/json-web-token.js +38 -0
- package/project/server/stack/api/sdp/sdp-decoder.js +70 -0
- package/project/server/stack/api/sdp/sdp-encoder.js +40 -0
- package/project/server/stack/api/sdp/sdp-media-attribute.js +13 -0
- package/project/server/stack/api/sdp/sdp-media-session.js +16 -0
- package/project/server/stack/api/sdp/sdp-message.js +17 -0
- package/project/server/stack/api/sdp/sdp-origin.js +17 -0
- package/project/server/stack/api/sdp/sdp-session-attribute.js +13 -0
- package/project/server/stack/api/sdp/sdp-timing.js +15 -0
- package/project/server/stack/api/text-protocol-header.js +35 -0
- package/project/server/stack/factory/stack-components-helpers.js +22 -0
- package/project/server/stack/factory/stack-components-template-base-actors.js +124 -0
- package/project/server/stack/factory/stack-components-template-base-test-cases.js +22 -0
- package/project/server/stack/factory/stack-components-templates-actors.js +15 -0
- package/project/server/stack/factory/stack-components-templates-test-cases.js +20 -0
- package/project/server/stack/managers/client-manager/client-manager.js +193 -0
- package/project/server/stack/managers/connection-manager/connection-data.js +82 -0
- package/project/server/stack/managers/connection-manager/connection-manager.js +177 -0
- package/project/server/stack/managers/connection-manager/connection-object.js +148 -0
- package/project/server/stack/managers/connection-manager/shared-data.js +14 -0
- package/project/server/stack/managers/manager.js +95 -0
- package/project/server/stack/managers/server-manager/server-manager.js +76 -0
- package/project/server/stack/managers/server-manager/server.js +384 -0
- package/project/server/stack/managers/shared-manager.js +117 -0
- package/project/server/stack/network/buffer-manager.js +190 -0
- package/project/server/stack/network/mc/mc-connection-client-shared.js +51 -0
- package/project/server/stack/network/mc/mc-connection-client.js +117 -0
- package/project/server/stack/network/mc/mc-connection-server-shared.js +51 -0
- package/project/server/stack/network/mc/mc-connection-server.js +58 -0
- package/project/server/stack/network/mc/mc-connection-shared.js +26 -0
- package/project/server/stack/network/mc/mc-connection.js +33 -0
- package/project/server/stack/network/mc/mc-server.js +90 -0
- package/project/server/stack/network/network-connection-shared.js +177 -0
- package/project/server/stack/network/network-connection.js +134 -0
- package/project/server/stack/network/network-helper.js +12 -0
- package/project/server/stack/network/network-server.js +36 -0
- package/project/server/stack/network/network-type.js +46 -0
- package/project/server/stack/network/tcp/tcp-connection-client-shared.js +18 -0
- package/project/server/stack/network/tcp/tcp-connection-client.js +71 -0
- package/project/server/stack/network/tcp/tcp-connection-server-shared.js +14 -0
- package/project/server/stack/network/tcp/tcp-connection-server.js +16 -0
- package/project/server/stack/network/tcp/tcp-connection-shared.js +55 -0
- package/project/server/stack/network/tcp/tcp-connection.js +167 -0
- package/project/server/stack/network/tcp/tcp-server.js +35 -0
- package/project/server/stack/network/tls/tls-connection-client-shared.js +18 -0
- package/project/server/stack/network/tls/tls-connection-client.js +76 -0
- package/project/server/stack/network/tls/tls-connection-server-shared.js +14 -0
- package/project/server/stack/network/tls/tls-connection-server.js +16 -0
- package/project/server/stack/network/tls/tls-connection-shared.js +63 -0
- package/project/server/stack/network/tls/tls-connection.js +176 -0
- package/project/server/stack/network/tls/tls-server.js +45 -0
- package/project/server/stack/network/transport.js +19 -0
- package/project/server/stack/network/udp/udp-connection-client-shared.js +47 -0
- package/project/server/stack/network/udp/udp-connection-client.js +93 -0
- package/project/server/stack/network/udp/udp-connection-server-shared.js +51 -0
- package/project/server/stack/network/udp/udp-connection-server.js +58 -0
- package/project/server/stack/network/udp/udp-connection-shared.js +26 -0
- package/project/server/stack/network/udp/udp-connection.js +33 -0
- package/project/server/stack/network/udp/udp-server.js +74 -0
- package/project/server/stack/pending/pending-const.js +22 -0
- package/project/server/stack/pending/pending-context-receive.js +18 -0
- package/project/server/stack/pending/pending-context-send.js +18 -0
- package/project/server/stack/pending/pending-context.js +18 -0
- package/project/server/stack/pending/pending-inner.js +107 -0
- package/project/server/stack/pending/pending-switch.js +146 -0
- package/project/server/stack/stacks/ascii-dictionary.js +289 -0
- package/project/server/stack/stacks/binary-log.js +88 -0
- package/project/server/stack/stacks/bit-byte.js +51 -0
- package/project/server/stack/stacks/browser-data.js +25 -0
- package/project/server/stack/stacks/cancel-object.js +16 -0
- package/project/server/stack/stacks/connection-client.js +228 -0
- package/project/server/stack/stacks/connection-instance.js +69 -0
- package/project/server/stack/stacks/connection-ip.js +374 -0
- package/project/server/stack/stacks/connection-server.js +169 -0
- package/project/server/stack/stacks/connection-web.js +113 -0
- package/project/server/stack/stacks/connection-worker-client.js +29 -0
- package/project/server/stack/stacks/connection-worker-connection.js +41 -0
- package/project/server/stack/stacks/connection-worker-server.js +29 -0
- package/project/server/stack/stacks/connection-worker.js +99 -0
- package/project/server/stack/stacks/connection.js +132 -0
- package/project/server/stack/stacks/decoder.js +83 -0
- package/project/server/stack/stacks/encoder.js +82 -0
- package/project/server/stack/stacks/ip-log.js +24 -0
- package/project/server/stack/stacks/message-selector.js +22 -0
- package/project/server/stack/stacks/msg-ip.js +18 -0
- package/project/server/stack/stacks/stack-content-cache.js +27 -0
- package/project/z-abs-funclayer-engine-server.tree +230 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const Actor = require('./actor');
|
|
5
|
+
const StackMixinServer = require('./actor-mixins/stack-mixin-server');
|
|
6
|
+
const StackMixin = require('./actor-mixins/stack-mixin');
|
|
7
|
+
const ActorTypeConst = require('z-abs-funclayer-engine-cs/clientServer/execution/actor-type-const');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ActorTerminating extends Actor {
|
|
11
|
+
constructor(actorParts, expectInterrupt) {
|
|
12
|
+
super(ActorTypeConst.TERM, actorParts, expectInterrupt);
|
|
13
|
+
this.srvDst = [];
|
|
14
|
+
this.srv = [];
|
|
15
|
+
this.srvDstResolved = [];
|
|
16
|
+
this.srvResolved = [];
|
|
17
|
+
this.initStackMixin();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
init(uniqueTcId, actorData, instanceIndex, cbMessage, executionContext, tcData, config, slowAwaitTime, nodes, cb) {
|
|
21
|
+
if('' === actorData.execution) {
|
|
22
|
+
actorData.execution = 'parallel';
|
|
23
|
+
}
|
|
24
|
+
return super.init(uniqueTcId, actorData, instanceIndex, cbMessage, executionContext, tcData, config, slowAwaitTime, nodes, cb);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Object.assign(ActorTerminating.prototype, StackMixinServer);
|
|
29
|
+
Object.assign(ActorTerminating.prototype, StackMixin);
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
module.exports = ActorTerminating;
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const ActorState = require('../actor-state');
|
|
5
|
+
const Address = require('../../address/address');
|
|
6
|
+
const ActorResults = require('./actor-results');
|
|
7
|
+
const ActorStateTimeout = require('./actor-state-timeout');
|
|
8
|
+
const AsynchMixin = require('./actor-mixins/asynch-mixin');
|
|
9
|
+
const ContentMixin = require('./actor-mixins/content-mixin');
|
|
10
|
+
const LoggerMixin = require('./actor-mixins/logger-mixin');
|
|
11
|
+
const SharedDataMixin = require('./actor-mixins/shared-data-mixin');
|
|
12
|
+
const SharedExecutionDataMixin = require('./actor-mixins/shared-execution-data-mixin');
|
|
13
|
+
const TimerMixin = require('./actor-mixins/timer-mixin');
|
|
14
|
+
const TestDataMixin = require('./actor-mixins/test-data-mixin');
|
|
15
|
+
const VerifyMixinBase = require('./actor-mixins/verify-mixin-base');
|
|
16
|
+
const VerifyMixinMandatory = require('./actor-mixins/verify-mixin-mandatory');
|
|
17
|
+
const VerifyMixinOptional = require('./actor-mixins/verify-mixin-optional');
|
|
18
|
+
const VerifyMixinValue = require('./actor-mixins/verify-mixin-value');
|
|
19
|
+
const ActorPending = require('./actor-pending');
|
|
20
|
+
const MessageTestCaseDebugActorIndex = require('z-abs-funclayer-engine-server/server/communication/messages/messages-w-to-s/message-test-case-debug-actor-index');
|
|
21
|
+
const ActorPhaseConst = require('z-abs-funclayer-engine-cs/clientServer/execution/actor-phase-const');
|
|
22
|
+
const ActorResultConst = require('z-abs-funclayer-engine-cs/clientServer/execution/actor-result-const');
|
|
23
|
+
const ActorStateConst = require('z-abs-funclayer-engine-cs/clientServer/execution/actor-state-const');
|
|
24
|
+
const ActorTypeConst = require('z-abs-funclayer-engine-cs/clientServer/execution/actor-type-const');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Actor {
|
|
28
|
+
static instanceId = 0;
|
|
29
|
+
|
|
30
|
+
constructor(inheritedType, actorParts, expectInterrupt=false) {
|
|
31
|
+
this.uniqueTcId = 0n;
|
|
32
|
+
this.inheritedType = inheritedType;
|
|
33
|
+
this.expectInterrupt = expectInterrupt;
|
|
34
|
+
this.name = '';
|
|
35
|
+
this.index = -1;
|
|
36
|
+
this.orderIndex = -1;
|
|
37
|
+
this.columnIndex = -1;
|
|
38
|
+
this.logName = '';
|
|
39
|
+
this.logFileName = '';
|
|
40
|
+
this.instanceIndex = 0;
|
|
41
|
+
this.node = '';
|
|
42
|
+
this.dependentOnIndices = [];
|
|
43
|
+
this.type = '';
|
|
44
|
+
this.execution = '';
|
|
45
|
+
this.phaseId = -1;
|
|
46
|
+
this.currentPhaseId = -1;
|
|
47
|
+
this.typeId = 0;
|
|
48
|
+
this.cbMessage = null;
|
|
49
|
+
this.actorState = null;
|
|
50
|
+
this.actorResults = null;
|
|
51
|
+
this.cbActorStateDone = null;
|
|
52
|
+
this.executionContext = null;
|
|
53
|
+
this.tcData = null;
|
|
54
|
+
this.config = null;
|
|
55
|
+
this.slowAwaitTime = -1;
|
|
56
|
+
this.testDataActor = new Map();
|
|
57
|
+
this.verificationActor = new Map();
|
|
58
|
+
this.nodes = [];
|
|
59
|
+
this.currentGenerator = null;
|
|
60
|
+
this.done = false;
|
|
61
|
+
this.interrupted = false;
|
|
62
|
+
this.debug = false;
|
|
63
|
+
this.stateTimeout = null;
|
|
64
|
+
if(actorParts) {
|
|
65
|
+
let partIndex = 0;
|
|
66
|
+
if(Array.isArray(actorParts)) {
|
|
67
|
+
for(let i = 0; i < actorParts.length; ++i) {
|
|
68
|
+
const actorPart = new actorParts[i]().init(this, ++partIndex);
|
|
69
|
+
if(0 === actorPart.type) {
|
|
70
|
+
if(undefined === this.preActorParts) {
|
|
71
|
+
this.preActorParts = [actorPart];
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.preActorParts.push(actorPart);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
if(undefined === this.postActorParts) {
|
|
79
|
+
this.postActorParts = [actorPart];
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.postActorParts.push(actorPart);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const actorPart = new actorParts().init(this, ++partIndex);
|
|
89
|
+
if(0 === actorPart.type) {
|
|
90
|
+
this.preActorParts = [actorPart];
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
this.postActorParts = [actorPart];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
this._next = null;
|
|
98
|
+
this._debugData = null;
|
|
99
|
+
this.process = process;
|
|
100
|
+
this.actorPending = new ActorPending(this);
|
|
101
|
+
this.initLoggerMixin();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
init(uniqueTcId, actorData, instanceIndex, cbMessage, executionContext, tcData, config, slowAwaitTime, nodes, cb) {
|
|
105
|
+
this.uniqueTcId = uniqueTcId;
|
|
106
|
+
this.name = actorData.name;
|
|
107
|
+
this.index = -1;
|
|
108
|
+
this.instanceIndex = instanceIndex;
|
|
109
|
+
this.node = actorData.node;
|
|
110
|
+
this.logName = `${this.name.substr(this.name.lastIndexOf('.') + 1)}[${this.instanceIndex}]`;
|
|
111
|
+
this.logFileName = `${actorData.name.replace(/\./g, '/')}.js`;
|
|
112
|
+
this.type = actorData.type;
|
|
113
|
+
this.typeId = ActorTypeConst.getId(actorData.type);
|
|
114
|
+
this.execution = actorData.execution;
|
|
115
|
+
this.cbMessage = cbMessage;
|
|
116
|
+
this.executionContext = executionContext;
|
|
117
|
+
this.tcData = tcData;
|
|
118
|
+
this.config = config;
|
|
119
|
+
this.slowAwaitTime = slowAwaitTime;
|
|
120
|
+
this.nodes = nodes;
|
|
121
|
+
this.actorState = new ActorState(this);
|
|
122
|
+
this.actorResults = new ActorResults();
|
|
123
|
+
if(undefined === actorData.phase || '' === actorData.phase) {
|
|
124
|
+
if(ActorTypeConst.COND === this.typeId) {
|
|
125
|
+
this.phaseId = ActorPhaseConst.PRE;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.phaseId = ActorPhaseConst.EXEC;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
this.phaseId = ActorPhaseConst.getId(actorData.phase);
|
|
133
|
+
}
|
|
134
|
+
this._setTestDataActor('actor-name', this.logName, 'The name of the Actor.');
|
|
135
|
+
this._setTestDatasActor(actorData.testData);
|
|
136
|
+
this._setVerificationsActor(actorData.verification);
|
|
137
|
+
this._getAddresses(actorData);
|
|
138
|
+
process.nextTick(cb, this.typeId === this.inheritedType);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
executeInit(debug, process) {
|
|
142
|
+
this.process = process;
|
|
143
|
+
this.debug = debug;
|
|
144
|
+
if(debug) {
|
|
145
|
+
this._next = this.next;
|
|
146
|
+
this.next = (value, err) => {
|
|
147
|
+
if(this.debug && this.executionContext.executingActorIndex !== this.orderIndex) {
|
|
148
|
+
this._debugData = {value, err};
|
|
149
|
+
this.executionContext.setExecutingActorIndex(this.orderIndex);
|
|
150
|
+
this.process.stall();
|
|
151
|
+
this.cbMessage(new MessageTestCaseDebugActorIndex(this.orderIndex), null, this.debug);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
return this._next(value, err);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
this.loadLoggerMixin();
|
|
159
|
+
this.stateTimeout = new ActorStateTimeout(!debug ? null : process, !debug ? this.getTestDataNumber('tc-state-timeout', 5000) : this.getTestDataNumber('tc-state-debug-timeout', 90000));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
debugContinue() {
|
|
163
|
+
const _debugData = this._debugData;
|
|
164
|
+
this._debugData = null;
|
|
165
|
+
this.process.unstall();
|
|
166
|
+
this._next(_debugData.value, _debugData.err);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
setDependency(actorIndex) {
|
|
170
|
+
this.dependentOnIndices.push(actorIndex);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
getDependencies() {
|
|
174
|
+
return this.dependentOnIndices;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
getDependenciesFromPhase(phaseId) {
|
|
178
|
+
return this.dependentOnIndices;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
getName() {
|
|
182
|
+
return this.name;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
getPhaseLogNameState() {
|
|
186
|
+
return `${ActorPhaseConst.getName(this.currentPhaseId)}.${this.logName}.${this.getState().getName()}`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
getIndex() {
|
|
190
|
+
return this.index;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
getIndexFromPhase(phaseId) {
|
|
194
|
+
return this.index;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
setIndex(index) {
|
|
198
|
+
this.index = index;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
getOrderIndex() {
|
|
202
|
+
return this.orderIndex;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
getOrderIndexFromPhase(phaseId) {
|
|
206
|
+
return this.orderIndex;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
setOrderIndex(index) {
|
|
210
|
+
this.orderIndex = index;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
setColumnIndex(index) {
|
|
214
|
+
this.columnIndex = index;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
getInstanceIndex() {
|
|
218
|
+
return this.instanceIndex;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
getSequence() {
|
|
222
|
+
return this.execution;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
getState() {
|
|
226
|
+
return this.actorState;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
getStateId() {
|
|
230
|
+
return this.actorState.getActorStateId();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
getStateName() {
|
|
234
|
+
return this.actorState.getName();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
getActorResultId() {
|
|
238
|
+
return this.actorResults.getActorResultId();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
setActorResultId(resultId) {
|
|
242
|
+
return this.actorResults.setResultId(this.actorState.getActorStateId(), resultId);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
getResultId() {
|
|
246
|
+
return this.actorResults.getResultId(this.actorState.getActorStateId());
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
getStateResultId(state) {
|
|
250
|
+
return this.actorResults.getResultId(state);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
isSuccess() {
|
|
254
|
+
return ActorResultConst.SUCCESS >= this.getActorResultId();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
getResultName() {
|
|
258
|
+
return ActorResultConst.getName(this.actorResults.getResultId(this.actorState.getActorStateId()));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
getStateResultName(state) {
|
|
262
|
+
return ActorResultConst.getName(this.getStateResultId(state));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
setCurrentPhase(phaseId) {
|
|
266
|
+
this.currentPhaseId = phaseId;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
_getAddresses(actorData) {
|
|
270
|
+
switch(this.typeId) {
|
|
271
|
+
case ActorTypeConst.ORIG:
|
|
272
|
+
case ActorTypeConst.COND:
|
|
273
|
+
this._getAddress(this.src, null, actorData.src, Address.CLIENT);
|
|
274
|
+
this._getAddress(this.srcDst, null, actorData.dst, Address.SUT);
|
|
275
|
+
break;
|
|
276
|
+
case ActorTypeConst.TERM:
|
|
277
|
+
case ActorTypeConst.INTER:
|
|
278
|
+
this._getAddress(this.srvDst, null, actorData.dst, Address.SUT);
|
|
279
|
+
this._getAddress(this.srv, null, actorData.srv, Address.SERVER);
|
|
280
|
+
break;
|
|
281
|
+
case ActorTypeConst.PROXY:
|
|
282
|
+
case ActorTypeConst.SUT:
|
|
283
|
+
this._getAddress(this.src, null, actorData.src, Address.CLIENT);
|
|
284
|
+
this._getAddress(this.srcDst, this.srvDst, actorData.dst, Address.SUT);
|
|
285
|
+
this._getAddress(this.srv, null, actorData.srv, Address.SERVER);
|
|
286
|
+
break;
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
_getAddress(addressesLeft, addressesRight, addressData, addressType) {
|
|
291
|
+
if(addressData) {
|
|
292
|
+
if(/^[\[{]/.test(addressData.trim())) {
|
|
293
|
+
const parsedAddressData = JSON.parse(addressData);
|
|
294
|
+
if(Array.isArray(parsedAddressData)) {
|
|
295
|
+
parsedAddressData.forEach((address) => {
|
|
296
|
+
if(!Array.isArray(address)) {
|
|
297
|
+
this._getAddress(addressesLeft, null, address, addressType);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
if(2 === address.length) {
|
|
301
|
+
this._getAddress(addressesLeft, null, address[0], addressType);
|
|
302
|
+
this._getAddress(addressesLeft, null, address[1], addressType);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
this.logError("Address length must be 2.", '6523a606-e5fe-428b-86ab-6bbd5a118863');
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else if(typeof parsedAddressData === 'object') {
|
|
311
|
+
addressesLeft.push({
|
|
312
|
+
type: Address.IS_HARD_CODED,
|
|
313
|
+
value: new Address('hard coded', parsedAddressData.host, parsedAddressData.family, parsedAddressData.port, addressType, parsedAddressData.page, parsedAddressData.incognitoBrowser, parsedAddressData.uri)
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
addressesLeft.push({
|
|
319
|
+
type: Address.IS_GENERATED,
|
|
320
|
+
value: addressData
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
setPending(cbCancel) {
|
|
327
|
+
return this.actorPending.setPending(cbCancel);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
deletePending(pendingId) {
|
|
331
|
+
return this.actorPending.deletePending(pendingId);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
pendingSuccess(pendingId, value) {
|
|
335
|
+
this.actorPending.pendingSuccess(pendingId, value);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
pendingError(pendingId, err) {
|
|
339
|
+
this.actorPending.pendingError(pendingId, err);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
setCbActorStateDone(cbDone) {
|
|
343
|
+
this.cbActorStateDone = cbDone;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
actorStateDone(resultId) {
|
|
347
|
+
this.stateTimeout.stop();
|
|
348
|
+
if(ActorStateConst.EXIT === this.getStateId()) {
|
|
349
|
+
this._unlockAddresses(ActorResultConst.N_EXEC !== resultId && ActorResultConst.ERROR !== resultId && ActorResultConst.TIMEOUT !== resultId);
|
|
350
|
+
}
|
|
351
|
+
return this.cbActorStateDone(this, resultId);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
next(value, err) {
|
|
355
|
+
let result = null;
|
|
356
|
+
if(this.done) {
|
|
357
|
+
this.done = false;
|
|
358
|
+
this.actorStateDone(ActorResultConst.SUCCESS);
|
|
359
|
+
}
|
|
360
|
+
try {
|
|
361
|
+
if(err) {
|
|
362
|
+
this.actorPending.clear();
|
|
363
|
+
if('internal_error_interrupted' === err.message) {
|
|
364
|
+
this.interrupted = true;
|
|
365
|
+
this.currentGenerator = null;
|
|
366
|
+
this.actorStateDone(ActorResultConst.INTERRUPT);
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
else if('internal_error_timeout' === err.message) {
|
|
370
|
+
this.currentGenerator = null;
|
|
371
|
+
this.actorStateDone(ActorResultConst.TIMEOUT);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
else if('internal_error_expected_interrupted' === err.message) {
|
|
375
|
+
this.currentGenerator = null;
|
|
376
|
+
this.actorStateDone(ActorResultConst.E_INTERRUPT);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
else if('internal_error_network_end' === err.message) {
|
|
380
|
+
this.logError('Receiving on a closed connection with no more data.', '77c6fdf8-7ae8-4b37-a7ab-7afe873d39bb');
|
|
381
|
+
this.setActorResultId(ActorResultConst.ERROR);
|
|
382
|
+
result = this.currentGenerator.next();
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
else if('internal_error_worker' === err.message) {
|
|
386
|
+
this.setActorResultId(ActorResultConst.ERROR);
|
|
387
|
+
result = this.currentGenerator.next();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
result = this.currentGenerator.throw(err);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
result = this.currentGenerator.next(value);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
catch(e) {
|
|
399
|
+
this.actorPending.clear();
|
|
400
|
+
this.done = false;
|
|
401
|
+
if('verify__asdf1234' === e.message) {
|
|
402
|
+
this.actorStateDone(ActorResultConst.FAILURE);
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
this.logError(e, '4d4f2872-b0e0-4d2f-bdfb-4dd89a981aac');
|
|
407
|
+
this.actorStateDone(ActorResultConst.ERROR);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
if(result.done) {
|
|
412
|
+
if(this.actorPending.hasPendings()) {
|
|
413
|
+
this.logWarning('A pending without a yield.', 'core', '508421db-9d8c-46a3-83fa-bf7b977b1b9e');
|
|
414
|
+
this.done = true;
|
|
415
|
+
}
|
|
416
|
+
else {
|
|
417
|
+
this.done = false;
|
|
418
|
+
if(ActorStateConst.EXIT !== this.getStateId()) {
|
|
419
|
+
this.actorStateDone(ActorResultConst.SUCCESS);
|
|
420
|
+
}
|
|
421
|
+
else {
|
|
422
|
+
this._awaitClosePendingConnections(() => {
|
|
423
|
+
this.actorStateDone(ActorResultConst.SUCCESS);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
else if(!this.actorPending.hasPendings()) {
|
|
429
|
+
this.logWarning('A yield without a pending.', 'core', '5a8aed39-766d-4134-a11b-d5609089de2d');
|
|
430
|
+
this.process.nextTick(this.next.bind(this));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
*partsRun() {
|
|
435
|
+
if(undefined !== this.preActorParts) {
|
|
436
|
+
for(let pre = 0; pre < this.preActorParts.length; ++pre) {
|
|
437
|
+
yield* this.preActorParts[pre].run();
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if(undefined !== this.run) {
|
|
441
|
+
yield* this.run();
|
|
442
|
+
}
|
|
443
|
+
if(undefined !== this.postActorParts) {
|
|
444
|
+
for(let post = 0; post < this.postActorParts.length; ++post) {
|
|
445
|
+
yield* this.postActorParts[post].run();
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
executeState(generator) {
|
|
451
|
+
this.currentGenerator = generator;
|
|
452
|
+
this.process.nextTick((self, ActorResultConst) => {
|
|
453
|
+
if(self.currentGenerator) {
|
|
454
|
+
if(ActorResultConst.INTERRUPT !== self.actorResults.actorStateResult[self.actorState.getActorStateId()]) {
|
|
455
|
+
self.stateTimeout.start(self.doTimeout.bind(self));
|
|
456
|
+
self.next();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}, this, ActorResultConst);
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
hasState() {
|
|
464
|
+
switch(this.getStateId()) {
|
|
465
|
+
case ActorStateConst.DATA:
|
|
466
|
+
return undefined !== this.data;
|
|
467
|
+
case ActorStateConst.INIT_SERVER:
|
|
468
|
+
return undefined !== this.initServer;
|
|
469
|
+
case ActorStateConst.INIT_CLIENT:
|
|
470
|
+
return undefined !== this.initClient;
|
|
471
|
+
case ActorStateConst.RUN:
|
|
472
|
+
return undefined !== this.run || undefined !== this.preActorParts || undefined !== this.postActorParts;
|
|
473
|
+
case ActorStateConst.EXIT:
|
|
474
|
+
return undefined !== this.exit;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
doData() {
|
|
479
|
+
this.logEngine('actor state: data', 'actor-state', 'c4675385-9403-4838-9d55-933cd551fd08');
|
|
480
|
+
if(undefined === this.data) {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
return this.executeState(this.data());
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
doInitServer() {
|
|
487
|
+
this.logEngine('actor state: initServer', 'actor-state', '5f9bfd4a-1d42-4a23-964d-5df3cabefa60');
|
|
488
|
+
if(undefined === this.initServer) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
return this.executeState(this.initServer());
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
doInitClient() {
|
|
495
|
+
this.logEngine('actor state: initClient', 'actor-state', '381af64c-258a-452a-aed3-fe8857cdad9d');
|
|
496
|
+
if(undefined === this.initClient) {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
return this.executeState(this.initClient());
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
doRun() {
|
|
503
|
+
this.logEngine('actor state: run', 'actor-state', '7106fc36-a732-43ad-9cf0-e1b03a8a10b6');
|
|
504
|
+
if(undefined === this.preActorParts && undefined === this.postActorParts) {
|
|
505
|
+
if(undefined !== this.run) {
|
|
506
|
+
return this.executeState(this.run());
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
else {
|
|
510
|
+
return this.executeState(this.partsRun());
|
|
511
|
+
}
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
doExit() {
|
|
516
|
+
this.logEngine('actor state: exit', 'actor-state', '25b81886-fb3c-41d3-9262-92c7f9a21c35');
|
|
517
|
+
if(undefined === this.exit) {
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
520
|
+
return this.executeState(this.exit(this.interrupted));
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
doInterrupt(throwOrCancel) {
|
|
524
|
+
this.logWarning('Interrupt', 'core', '7941f7ad-8717-452b-a45d-c83b7babe0f1');
|
|
525
|
+
if(throwOrCancel) {
|
|
526
|
+
this.next(undefined, new Error('internal_error_interrupted'));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
doTimeout() {
|
|
531
|
+
this.logWarning('Timeout', 'core', '1184e77d-8cb2-41af-9964-c2eba3185bf9');
|
|
532
|
+
this.next(undefined, new Error('internal_error_timeout'));
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
doExpectedInterrupt() {
|
|
536
|
+
this.next(undefined, new Error('internal_error_expected_interrupted'));
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
Object.assign(Actor.prototype, AsynchMixin);
|
|
541
|
+
Object.assign(Actor.prototype, ContentMixin);
|
|
542
|
+
Object.assign(Actor.prototype, SharedDataMixin);
|
|
543
|
+
Object.assign(Actor.prototype, SharedExecutionDataMixin);
|
|
544
|
+
Object.assign(Actor.prototype, LoggerMixin);
|
|
545
|
+
Object.assign(Actor.prototype, TimerMixin);
|
|
546
|
+
Object.assign(Actor.prototype, VerifyMixinBase);
|
|
547
|
+
Object.assign(Actor.prototype, VerifyMixinMandatory);
|
|
548
|
+
Object.assign(Actor.prototype, VerifyMixinOptional);
|
|
549
|
+
Object.assign(Actor.prototype, VerifyMixinValue);
|
|
550
|
+
Object.assign(Actor.prototype, TestDataMixin);
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
module.exports = Actor;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// TODO: remove
|
|
5
|
+
class ActorPhase {
|
|
6
|
+
constructor(tabNames) {
|
|
7
|
+
this.PRE = 0;
|
|
8
|
+
this.EXEC = 1;
|
|
9
|
+
this.POST = 2;
|
|
10
|
+
this.NAME_PRE = 'pre';
|
|
11
|
+
this.NAME_EXEC = 'exec';
|
|
12
|
+
this.NAME_POST = 'post';
|
|
13
|
+
this.phaseIds = new Map([[this.NAME_PRE, this.PRE], [this.NAME_EXEC, this.EXEC], [this.NAME_POST, this.POST], ['pre, post', this.PRE]]);
|
|
14
|
+
this.phaseNames = [this.NAME_PRE, this.NAME_EXEC, this.NAME_POST];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getName(phaseId) {
|
|
18
|
+
return this.phaseNames[phaseId];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getId(phaseName) {
|
|
22
|
+
return this.phaseIds.get(phaseName);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = new ActorPhase();
|