@gatling.io/core 3.11.4-M1 → 3.11.4
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/package.json +2 -2
- package/target/body.js +5 -8
- package/target/checks/index.js +15 -26
- package/target/checks/validate.js +11 -20
- package/target/feeders.js +3 -4
- package/target/globalStore.d.ts +64 -0
- package/target/globalStore.js +19 -0
- package/target/index.d.ts +1 -1
- package/target/index.js +4 -4
- package/target/population.js +1 -2
- package/target/session.js +1 -2
- package/target/structure/asLongAs.js +4 -5
- package/target/structure/asLongAsDuring.js +12 -13
- package/target/structure/doIf.js +4 -7
- package/target/structure/doIfOrElse.js +4 -5
- package/target/structure/doSwitch.js +1 -4
- package/target/structure/doSwitchOrElse.js +1 -2
- package/target/structure/doWhile.js +2 -3
- package/target/structure/doWhileDuring.js +12 -13
- package/target/structure/during.js +4 -5
- package/target/structure/errors.js +6 -7
- package/target/structure/execs.js +1 -2
- package/target/structure/feeds.js +1 -2
- package/target/structure/forEach.js +2 -3
- package/target/structure/groups.js +1 -2
- package/target/structure/paces.js +4 -5
- package/target/structure/pauses.js +5 -6
- package/target/structure/repeat.js +2 -3
- package/target/gatlingJvm/callbacks.d.ts +0 -9
- package/target/gatlingJvm/callbacks.js +0 -14
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/core",
|
|
3
|
-
"version": "3.11.4
|
|
3
|
+
"version": "3.11.4",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "target/index.js",
|
|
6
6
|
"types": "target/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@gatling.io/jvm-types": "3.11.4
|
|
8
|
+
"@gatling.io/jvm-types": "3.11.4"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/jest": "29.5.12",
|
package/target/body.js
CHANGED
|
@@ -2,30 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ByteArrayBody = exports.PebbleFileBody = exports.PebbleStringBody = exports.ElFileBody = exports.RawFileBody = exports.StringBody = void 0;
|
|
4
4
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
|
-
const callbacks_1 = require("./gatlingJvm/callbacks");
|
|
6
5
|
const session_1 = require("./session");
|
|
7
6
|
const wrapBodyWithBytes = (_underlying) => Object.assign((session) => _underlying.apply(session._underlying), { _underlying });
|
|
8
7
|
const wrapBodyWithString = (_underlying) => Object.assign((session) => _underlying.apply(session._underlying), { _underlying });
|
|
9
|
-
const StringBody = (string) => wrapBodyWithString(typeof string === "function"
|
|
10
|
-
? jvm_types_1.CoreDsl.StringBody((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(string)))
|
|
11
|
-
: jvm_types_1.CoreDsl.StringBody(string));
|
|
8
|
+
const StringBody = (string) => wrapBodyWithString(typeof string === "function" ? jvm_types_1.CoreDsl.StringBody((0, session_1.underlyingSessionTo)(string)) : jvm_types_1.CoreDsl.StringBody(string));
|
|
12
9
|
exports.StringBody = StringBody;
|
|
13
10
|
const RawFileBody = (filePath) => wrapBodyWithBytes(typeof filePath === "function"
|
|
14
|
-
? jvm_types_1.CoreDsl.RawFileBody((0,
|
|
11
|
+
? jvm_types_1.CoreDsl.RawFileBody((0, session_1.underlyingSessionTo)(filePath))
|
|
15
12
|
: jvm_types_1.CoreDsl.RawFileBody(filePath));
|
|
16
13
|
exports.RawFileBody = RawFileBody;
|
|
17
14
|
const ElFileBody = (filePath) => wrapBodyWithString(typeof filePath === "function"
|
|
18
|
-
? jvm_types_1.CoreDsl.ElFileBody((0,
|
|
15
|
+
? jvm_types_1.CoreDsl.ElFileBody((0, session_1.underlyingSessionTo)(filePath))
|
|
19
16
|
: jvm_types_1.CoreDsl.ElFileBody(filePath));
|
|
20
17
|
exports.ElFileBody = ElFileBody;
|
|
21
18
|
const PebbleStringBody = (string) => wrapBodyWithString(jvm_types_1.CoreDsl.PebbleStringBody(string));
|
|
22
19
|
exports.PebbleStringBody = PebbleStringBody;
|
|
23
20
|
const PebbleFileBody = (filePath) => wrapBodyWithString(typeof filePath === "function"
|
|
24
|
-
? jvm_types_1.CoreDsl.PebbleFileBody((0,
|
|
21
|
+
? jvm_types_1.CoreDsl.PebbleFileBody((0, session_1.underlyingSessionTo)(filePath))
|
|
25
22
|
: jvm_types_1.CoreDsl.PebbleFileBody(filePath));
|
|
26
23
|
exports.PebbleFileBody = PebbleFileBody;
|
|
27
24
|
const ByteArrayBody = (bytes) => wrapBodyWithBytes(typeof bytes === "function"
|
|
28
|
-
? jvm_types_1.CoreDsl.ByteArrayBody((0,
|
|
25
|
+
? jvm_types_1.CoreDsl.ByteArrayBody((0, session_1.underlyingSessionTo)(bytes))
|
|
29
26
|
: typeof bytes === "string"
|
|
30
27
|
? jvm_types_1.CoreDsl.ByteArrayBody(bytes)
|
|
31
28
|
: jvm_types_1.CoreDsl.ByteArrayBody(bytes));
|
package/target/checks/index.js
CHANGED
|
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.responseTimeInMillis = exports.sha1 = exports.md5 = exports.regex = exports.jsonpJmesPath = exports.jsonpJsonPath = exports.jmesPath = exports.jsonPath = exports.form = exports.css = exports.xpath = exports.substring = exports.bodyLength = exports.bodyBytes = exports.bodyString = void 0;
|
|
18
18
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
19
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
20
19
|
const session_1 = require("../session");
|
|
21
20
|
const captureGroup_1 = require("./captureGroup");
|
|
22
21
|
const final_1 = require("./final");
|
|
@@ -58,11 +57,11 @@ exports.bodyString = bodyString;
|
|
|
58
57
|
const bodyBytes = () => ({
|
|
59
58
|
...(0, find_1.wrapCheckBuilderFind)(jvm_types_1.CoreDsl.bodyBytes()),
|
|
60
59
|
is: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
61
|
-
? jvm_types_1.CoreDsl.bodyBytes().is((0,
|
|
62
|
-
: jvm_types_1.CoreDsl.bodyBytes().is(
|
|
60
|
+
? jvm_types_1.CoreDsl.bodyBytes().is((0, session_1.underlyingSessionTo)(expected))
|
|
61
|
+
: jvm_types_1.CoreDsl.bodyBytes().is(expected)),
|
|
63
62
|
not: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
64
|
-
? jvm_types_1.CoreDsl.bodyBytes().not((0,
|
|
65
|
-
: jvm_types_1.CoreDsl.bodyBytes().not(
|
|
63
|
+
? jvm_types_1.CoreDsl.bodyBytes().not((0, session_1.underlyingSessionTo)(expected))
|
|
64
|
+
: jvm_types_1.CoreDsl.bodyBytes().not(expected))
|
|
66
65
|
});
|
|
67
66
|
exports.bodyBytes = bodyBytes;
|
|
68
67
|
/**
|
|
@@ -77,16 +76,16 @@ exports.bodyBytes = bodyBytes;
|
|
|
77
76
|
const bodyLength = () => (0, find_1.wrapCheckBuilderFind)(jvm_types_1.CoreDsl.bodyLength());
|
|
78
77
|
exports.bodyLength = bodyLength;
|
|
79
78
|
const substring = (pattern) => (0, multipleFind_1.wrapCheckBuilderMultipleFind)((typeof pattern === "function"
|
|
80
|
-
? jvm_types_1.CoreDsl.substring((0,
|
|
79
|
+
? jvm_types_1.CoreDsl.substring((0, session_1.underlyingSessionTo)(pattern))
|
|
81
80
|
: jvm_types_1.CoreDsl.substring(pattern)));
|
|
82
81
|
exports.substring = substring;
|
|
83
82
|
const xpath = (path, namespaces) => {
|
|
84
83
|
if (typeof path === "function") {
|
|
85
84
|
if (namespaces !== undefined) {
|
|
86
|
-
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.xpath((0,
|
|
85
|
+
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.xpath((0, session_1.underlyingSessionTo)(path), namespaces)); // TODO change type of java.util.Map in java2typescript
|
|
87
86
|
}
|
|
88
87
|
else {
|
|
89
|
-
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.xpath((0,
|
|
88
|
+
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.xpath((0, session_1.underlyingSessionTo)(path)));
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
@@ -102,10 +101,10 @@ exports.xpath = xpath;
|
|
|
102
101
|
const css = (selector, nodeAttribute) => {
|
|
103
102
|
if (typeof selector === "function") {
|
|
104
103
|
if (nodeAttribute !== undefined) {
|
|
105
|
-
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.css((0,
|
|
104
|
+
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.css((0, session_1.underlyingSessionTo)(selector), nodeAttribute));
|
|
106
105
|
}
|
|
107
106
|
else {
|
|
108
|
-
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.css((0,
|
|
107
|
+
return (0, multipleFind_1.wrapCheckBuilderMultipleFind)(jvm_types_1.CoreDsl.css((0, session_1.underlyingSessionTo)(selector)));
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
else {
|
|
@@ -120,29 +119,19 @@ const css = (selector, nodeAttribute) => {
|
|
|
120
119
|
exports.css = css;
|
|
121
120
|
// TODO check what type the values in the Map actually have, and if they are usable in Javascript
|
|
122
121
|
const form = (selector) => (0, multipleFind_1.wrapCheckBuilderMultipleFind)((typeof selector === "function"
|
|
123
|
-
? jvm_types_1.CoreDsl.form((0,
|
|
122
|
+
? jvm_types_1.CoreDsl.form((0, session_1.underlyingSessionTo)(selector))
|
|
124
123
|
: jvm_types_1.CoreDsl.form(selector)) // TODO change type of java.util.Map in java2typescript
|
|
125
124
|
);
|
|
126
125
|
exports.form = form;
|
|
127
|
-
const jsonPath = (path) => (0, jsonOfTypeMultipleFind_1.wrapCheckBuilderJsonOfTypeMultipleFind)(typeof path === "function"
|
|
128
|
-
? jvm_types_1.CoreDsl.jsonPath((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(path)))
|
|
129
|
-
: jvm_types_1.CoreDsl.jsonPath(path));
|
|
126
|
+
const jsonPath = (path) => (0, jsonOfTypeMultipleFind_1.wrapCheckBuilderJsonOfTypeMultipleFind)(typeof path === "function" ? jvm_types_1.CoreDsl.jsonPath((0, session_1.underlyingSessionTo)(path)) : jvm_types_1.CoreDsl.jsonPath(path));
|
|
130
127
|
exports.jsonPath = jsonPath;
|
|
131
|
-
const jmesPath = (path) => (0, jsonOfTypeFind_1.wrapCheckBuilderJsonOfTypeFind)(typeof path === "function"
|
|
132
|
-
? jvm_types_1.CoreDsl.jmesPath((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(path)))
|
|
133
|
-
: jvm_types_1.CoreDsl.jmesPath(path));
|
|
128
|
+
const jmesPath = (path) => (0, jsonOfTypeFind_1.wrapCheckBuilderJsonOfTypeFind)(typeof path === "function" ? jvm_types_1.CoreDsl.jmesPath((0, session_1.underlyingSessionTo)(path)) : jvm_types_1.CoreDsl.jmesPath(path));
|
|
134
129
|
exports.jmesPath = jmesPath;
|
|
135
|
-
const jsonpJsonPath = (path) => (0, jsonOfTypeMultipleFind_1.wrapCheckBuilderJsonOfTypeMultipleFind)(typeof path === "function"
|
|
136
|
-
? jvm_types_1.CoreDsl.jsonpJsonPath((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(path)))
|
|
137
|
-
: jvm_types_1.CoreDsl.jsonpJsonPath(path));
|
|
130
|
+
const jsonpJsonPath = (path) => (0, jsonOfTypeMultipleFind_1.wrapCheckBuilderJsonOfTypeMultipleFind)(typeof path === "function" ? jvm_types_1.CoreDsl.jsonpJsonPath((0, session_1.underlyingSessionTo)(path)) : jvm_types_1.CoreDsl.jsonpJsonPath(path));
|
|
138
131
|
exports.jsonpJsonPath = jsonpJsonPath;
|
|
139
|
-
const jsonpJmesPath = (path) => (0, jsonOfTypeFind_1.wrapCheckBuilderJsonOfTypeFind)(typeof path === "function"
|
|
140
|
-
? jvm_types_1.CoreDsl.jsonpJmesPath((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(path)))
|
|
141
|
-
: jvm_types_1.CoreDsl.jsonpJmesPath(path));
|
|
132
|
+
const jsonpJmesPath = (path) => (0, jsonOfTypeFind_1.wrapCheckBuilderJsonOfTypeFind)(typeof path === "function" ? jvm_types_1.CoreDsl.jsonpJmesPath((0, session_1.underlyingSessionTo)(path)) : jvm_types_1.CoreDsl.jsonpJmesPath(path));
|
|
142
133
|
exports.jsonpJmesPath = jsonpJmesPath;
|
|
143
|
-
const regex = (pattern) => (0, captureGroup_1.wrapCheckBuilderCaptureGroup)(typeof pattern === "function"
|
|
144
|
-
? jvm_types_1.CoreDsl.regex((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(pattern)))
|
|
145
|
-
: jvm_types_1.CoreDsl.regex(pattern));
|
|
134
|
+
const regex = (pattern) => (0, captureGroup_1.wrapCheckBuilderCaptureGroup)(typeof pattern === "function" ? jvm_types_1.CoreDsl.regex((0, session_1.underlyingSessionTo)(pattern)) : jvm_types_1.CoreDsl.regex(pattern));
|
|
146
135
|
exports.regex = regex;
|
|
147
136
|
/**
|
|
148
137
|
* Bootstrap a new md5 check that extracts the <a href="https://en.wikipedia.org/wiki/MD5">MD5</a>
|
|
@@ -1,50 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wrapCheckBuilderValidate = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const final_1 = require("./final");
|
|
7
6
|
const wrapCheckBuilderValidate = (_underlying) => ({
|
|
8
7
|
...(0, final_1.wrapCheckBuilderFinal)(_underlying),
|
|
9
|
-
transform: (f) => (0, exports.wrapCheckBuilderValidate)(_underlying.transform(
|
|
10
|
-
transformWithSession: (f) => (0, exports.wrapCheckBuilderValidate)(_underlying.transformWithSession((0,
|
|
8
|
+
transform: (f) => (0, exports.wrapCheckBuilderValidate)(_underlying.transform(f)),
|
|
9
|
+
transformWithSession: (f) => (0, exports.wrapCheckBuilderValidate)(_underlying.transformWithSession((0, session_1.underlyingXWithSessionTo)(f))),
|
|
11
10
|
withDefault: (value) => (0, exports.wrapCheckBuilderValidate)(typeof value === "function"
|
|
12
|
-
? _underlying.withDefault((0,
|
|
11
|
+
? _underlying.withDefault((0, session_1.underlyingSessionTo)(value))
|
|
13
12
|
: _underlying.withDefault(value)),
|
|
14
13
|
withDefaultEL: (value) => (0, exports.wrapCheckBuilderValidate)(_underlying.withDefaultEl(value)),
|
|
15
|
-
validate: (name, f) => (0, final_1.wrapCheckBuilderFinal)(_underlying.validate(name, (0,
|
|
14
|
+
validate: (name, f) => (0, final_1.wrapCheckBuilderFinal)(_underlying.validate(name, (0, session_1.underlyingXWithSessionTo)(f))),
|
|
16
15
|
is: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
17
|
-
? _underlying.is((0,
|
|
16
|
+
? _underlying.is((0, session_1.underlyingSessionTo)(expected))
|
|
18
17
|
: _underlying.is(expected)),
|
|
19
18
|
isEL: (expected) => (0, final_1.wrapCheckBuilderFinal)(_underlying.isEL(expected)),
|
|
20
19
|
isNull: () => (0, final_1.wrapCheckBuilderFinal)(_underlying.isNull()),
|
|
21
20
|
not: (expected) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
22
|
-
? _underlying.not((0,
|
|
21
|
+
? _underlying.not((0, session_1.underlyingSessionTo)(expected))
|
|
23
22
|
: _underlying.not(expected)),
|
|
24
23
|
notEL: (expected) => (0, final_1.wrapCheckBuilderFinal)(_underlying.notEL(expected)),
|
|
25
24
|
notNull: () => (0, final_1.wrapCheckBuilderFinal)(_underlying.notNull()),
|
|
26
25
|
in: (expected, ...rest) => (0, final_1.wrapCheckBuilderFinal)(typeof expected === "function"
|
|
27
|
-
? _underlying.in((0,
|
|
26
|
+
? _underlying.in((0, session_1.underlyingSessionTo)(expected))
|
|
28
27
|
: _underlying.in([expected, ...rest])),
|
|
29
28
|
inEL: (expected) => (0, final_1.wrapCheckBuilderFinal)(_underlying.inEL(expected)),
|
|
30
29
|
exists: () => (0, final_1.wrapCheckBuilderFinal)(_underlying.exists()),
|
|
31
30
|
notExists: () => (0, final_1.wrapCheckBuilderFinal)(_underlying.notExists()),
|
|
32
31
|
optional: () => (0, final_1.wrapCheckBuilderFinal)(_underlying.optional()),
|
|
33
|
-
lt: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function"
|
|
34
|
-
? _underlying.lt((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(value)))
|
|
35
|
-
: _underlying.lt(value)),
|
|
32
|
+
lt: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function" ? _underlying.lt((0, session_1.underlyingSessionTo)(value)) : _underlying.lt(value)),
|
|
36
33
|
ltEL: (value) => (0, final_1.wrapCheckBuilderFinal)(_underlying.ltEL(value)),
|
|
37
|
-
lte: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function"
|
|
38
|
-
? _underlying.lte((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(value)))
|
|
39
|
-
: _underlying.lte(value)),
|
|
34
|
+
lte: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function" ? _underlying.lte((0, session_1.underlyingSessionTo)(value)) : _underlying.lte(value)),
|
|
40
35
|
lteEL: (value) => (0, final_1.wrapCheckBuilderFinal)(_underlying.lteEL(value)),
|
|
41
|
-
gt: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function"
|
|
42
|
-
? _underlying.gt((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(value)))
|
|
43
|
-
: _underlying.gt(value)),
|
|
36
|
+
gt: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function" ? _underlying.gt((0, session_1.underlyingSessionTo)(value)) : _underlying.gt(value)),
|
|
44
37
|
gtEL: (value) => (0, final_1.wrapCheckBuilderFinal)(_underlying.gtEL(value)),
|
|
45
|
-
gte: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function"
|
|
46
|
-
? _underlying.gte((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(value)))
|
|
47
|
-
: _underlying.gte(value)),
|
|
38
|
+
gte: (value) => (0, final_1.wrapCheckBuilderFinal)(typeof value === "function" ? _underlying.gte((0, session_1.underlyingSessionTo)(value)) : _underlying.gte(value)),
|
|
48
39
|
gteEL: (value) => (0, final_1.wrapCheckBuilderFinal)(_underlying.gteEL(value))
|
|
49
40
|
});
|
|
50
41
|
exports.wrapCheckBuilderValidate = wrapCheckBuilderValidate;
|
package/target/feeders.js
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.arrayFeeder = exports.jsonUrl = exports.jsonFile = exports.separatedValues = exports.tsv = exports.ssv = exports.csv = exports.wrapFileBasedFeederBuilder = void 0;
|
|
4
4
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
|
-
const callbacks_1 = require("./gatlingJvm/callbacks");
|
|
6
5
|
const wrapFeederBuilder = (_underlying) => ({
|
|
7
6
|
_underlying,
|
|
8
7
|
queue: () => wrapFeederBuilder(_underlying.queue()),
|
|
9
8
|
random: () => wrapFeederBuilder(_underlying.random()),
|
|
10
9
|
shuffle: () => wrapFeederBuilder(_underlying.shuffle()),
|
|
11
10
|
circular: () => wrapFeederBuilder(_underlying.circular()),
|
|
12
|
-
transform: (f) => wrapFeederBuilder(_underlying.transform(
|
|
11
|
+
transform: (f) => wrapFeederBuilder(_underlying.transform(f)),
|
|
13
12
|
recordsCount: () => _underlying.recordsCount(),
|
|
14
13
|
shard: () => wrapFeederBuilder(_underlying.shard())
|
|
15
14
|
});
|
|
@@ -19,7 +18,7 @@ const wrapFileBasedFeederBuilder = (_underlying) => ({
|
|
|
19
18
|
random: () => (0, exports.wrapFileBasedFeederBuilder)(_underlying.random()),
|
|
20
19
|
shuffle: () => (0, exports.wrapFileBasedFeederBuilder)(_underlying.shuffle()),
|
|
21
20
|
circular: () => (0, exports.wrapFileBasedFeederBuilder)(_underlying.circular()),
|
|
22
|
-
transform: (f) => wrapFeederBuilder(_underlying.transform(
|
|
21
|
+
transform: (f) => wrapFeederBuilder(_underlying.transform(f)),
|
|
23
22
|
recordsCount: () => _underlying.recordsCount(),
|
|
24
23
|
shard: () => (0, exports.wrapFileBasedFeederBuilder)(_underlying.shard()),
|
|
25
24
|
unzip: () => (0, exports.wrapFileBasedFeederBuilder)(_underlying.unzip())
|
|
@@ -31,7 +30,7 @@ const wrapBatchableFeederBuilder = (_underlying) => ({
|
|
|
31
30
|
random: () => wrapBatchableFeederBuilder(_underlying.random()),
|
|
32
31
|
shuffle: () => wrapBatchableFeederBuilder(_underlying.shuffle()),
|
|
33
32
|
circular: () => wrapBatchableFeederBuilder(_underlying.circular()),
|
|
34
|
-
transform: (f) => wrapFeederBuilder(_underlying.transform(
|
|
33
|
+
transform: (f) => wrapFeederBuilder(_underlying.transform(f)),
|
|
35
34
|
recordsCount: () => _underlying.recordsCount(),
|
|
36
35
|
shard: () => wrapBatchableFeederBuilder(_underlying.shard()),
|
|
37
36
|
unzip: () => wrapBatchableFeederBuilder(_underlying.unzip()),
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface GlobalStore {
|
|
2
|
+
/**
|
|
3
|
+
* Maps the specified key to the specified value in the global store. Neither the key nor the value can be null or
|
|
4
|
+
* undefined.
|
|
5
|
+
*
|
|
6
|
+
* @param key - key with which the specified value is to be associated
|
|
7
|
+
* @param value - value to be associated with the specified key
|
|
8
|
+
* @returns the previous value associated with key, or `null` if there was no mapping for key
|
|
9
|
+
*/
|
|
10
|
+
put<T>(key: string, value: T): T | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Attempts to compute a new value for the specified key and its currently mapped value (or `null` if there is no
|
|
13
|
+
* current value). The entire method invocation is performed atomically. The supplied function is invoked exactly once
|
|
14
|
+
* per invocation of this method. Some attempted update operations on this map by other threads may be blocked while
|
|
15
|
+
* computation is in progress, so the computation should be short and simple.
|
|
16
|
+
*
|
|
17
|
+
* The updateFunction function must not modify the global store during computation.
|
|
18
|
+
*
|
|
19
|
+
* @param key - key with which the specified value is to be associated
|
|
20
|
+
* @param updateFunction - the function to compute a new value to update the mapping; if it returns `null`, the
|
|
21
|
+
* mapping will be removed
|
|
22
|
+
* @returns the new value associated with the specified key, or `null` if none
|
|
23
|
+
*/
|
|
24
|
+
update<T>(key: string, updateFunction: (oldValue: T | undefined) => T | undefined): T | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the value to which the specified key is mapped, or `null` if the global store contains no mapping for the
|
|
27
|
+
* key.
|
|
28
|
+
*
|
|
29
|
+
* @param key - the key whose associated value is to be returned
|
|
30
|
+
* @returns the mapping for the key, if present; else `null`
|
|
31
|
+
*/
|
|
32
|
+
get<T>(key: string): T | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the value to which the specified key is mapped, or the given default value if the global store contains no
|
|
35
|
+
* mapping for the key.
|
|
36
|
+
*
|
|
37
|
+
* @param key - the key whose associated value is to be returned
|
|
38
|
+
* @param defaultValue - the value to return if the global store contains no mapping for the given key
|
|
39
|
+
* @returns the mapping for the key, if present; else the default value
|
|
40
|
+
*/
|
|
41
|
+
getOrDefault<T>(key: string, defaultValue: T): T;
|
|
42
|
+
/**
|
|
43
|
+
* Tests if the key is present in the global store.
|
|
44
|
+
*
|
|
45
|
+
* @param key - possible key
|
|
46
|
+
* @returns `true` if and only if the key is present in the global store; `false` otherwise
|
|
47
|
+
*/
|
|
48
|
+
containsKey(key: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Removes the mapping for a key from the global store if it is present.
|
|
51
|
+
*
|
|
52
|
+
* @param key - key whose mapping is to be removed from the map
|
|
53
|
+
* @returns the previous value associated with `key`, or `null` if there was no mapping for `key`.
|
|
54
|
+
*/
|
|
55
|
+
remove<T>(key: string): T;
|
|
56
|
+
/**
|
|
57
|
+
* Removes all of the mappings from the global store.
|
|
58
|
+
*/
|
|
59
|
+
clear(): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A global store which can be used to share data between different virtual users.
|
|
63
|
+
*/
|
|
64
|
+
export declare const GlobalStore: GlobalStore;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GlobalStore = void 0;
|
|
4
|
+
const ConcurrentHashMap = Java.type("java.util.concurrent.ConcurrentHashMap");
|
|
5
|
+
const javaStore = new ConcurrentHashMap();
|
|
6
|
+
/**
|
|
7
|
+
* A global store which can be used to share data between different virtual users.
|
|
8
|
+
*/
|
|
9
|
+
exports.GlobalStore = {
|
|
10
|
+
put: (key, value) => nullToUndefined(javaStore.put(key, value)),
|
|
11
|
+
update: (key, updateFunction) => nullToUndefined(javaStore.compute(key, (_, oldValue) => undefinedToNull(updateFunction(nullToUndefined(oldValue))))),
|
|
12
|
+
get: (key) => nullToUndefined(javaStore.get(key)),
|
|
13
|
+
getOrDefault: (key, defaultValue) => javaStore.getOrDefault(key, defaultValue),
|
|
14
|
+
containsKey: (key) => javaStore.containsKey(key),
|
|
15
|
+
remove: (key) => nullToUndefined(javaStore.remove(key)),
|
|
16
|
+
clear: () => javaStore.clear()
|
|
17
|
+
};
|
|
18
|
+
const nullToUndefined = (x) => (x === null ? undefined : x);
|
|
19
|
+
const undefinedToNull = (x) => (x === undefined ? null : x);
|
package/target/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { Assertion } from "./assertions";
|
|
|
7
7
|
import { PopulationBuilder } from "./population";
|
|
8
8
|
import { ProtocolBuilder } from "./protocol";
|
|
9
9
|
import { ThrottleStep } from "./throttling";
|
|
10
|
-
export * from "./gatlingJvm/callbacks";
|
|
11
10
|
export * from "./utils/duration";
|
|
12
11
|
export * from "./assertions";
|
|
13
12
|
export * from "./body";
|
|
@@ -16,6 +15,7 @@ export * from "./closedInjection";
|
|
|
16
15
|
export * from "./common";
|
|
17
16
|
export * from "./feeders";
|
|
18
17
|
export * from "./filters";
|
|
18
|
+
export { GlobalStore } from "./globalStore";
|
|
19
19
|
export * from "./openInjection";
|
|
20
20
|
export * from "./population";
|
|
21
21
|
export * from "./protocol";
|
package/target/index.js
CHANGED
|
@@ -14,14 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.simulation = void 0;
|
|
17
|
+
exports.simulation = exports.GlobalStore = void 0;
|
|
18
18
|
require("@gatling.io/jvm-types");
|
|
19
|
-
const callbacks_1 = require("./gatlingJvm/callbacks");
|
|
20
19
|
const pauses_1 = require("./structure/pauses");
|
|
21
20
|
const duration_1 = require("./utils/duration");
|
|
22
21
|
const session_1 = require("./session");
|
|
23
22
|
// FIXME no export *
|
|
24
|
-
__exportStar(require("./gatlingJvm/callbacks"), exports);
|
|
25
23
|
__exportStar(require("./utils/duration"), exports);
|
|
26
24
|
__exportStar(require("./assertions"), exports);
|
|
27
25
|
__exportStar(require("./body"), exports);
|
|
@@ -30,6 +28,8 @@ __exportStar(require("./closedInjection"), exports);
|
|
|
30
28
|
__exportStar(require("./common"), exports);
|
|
31
29
|
__exportStar(require("./feeders"), exports);
|
|
32
30
|
__exportStar(require("./filters"), exports);
|
|
31
|
+
var globalStore_1 = require("./globalStore");
|
|
32
|
+
Object.defineProperty(exports, "GlobalStore", { enumerable: true, get: function () { return globalStore_1.GlobalStore; } });
|
|
33
33
|
__exportStar(require("./openInjection"), exports);
|
|
34
34
|
__exportStar(require("./population"), exports);
|
|
35
35
|
__exportStar(require("./protocol"), exports);
|
|
@@ -45,7 +45,7 @@ const wrapSetUp = (jvmSetUp) => ({
|
|
|
45
45
|
disablePauses: () => wrapSetUp(jvmSetUp.disablePauses()),
|
|
46
46
|
constantPauses: () => wrapSetUp(jvmSetUp.constantPauses()),
|
|
47
47
|
exponentialPauses: () => wrapSetUp(jvmSetUp.exponentialPauses()),
|
|
48
|
-
customPauses: (f) => wrapSetUp(jvmSetUp.customPauses((0,
|
|
48
|
+
customPauses: (f) => wrapSetUp(jvmSetUp.customPauses((0, session_1.underlyingSessionTo)(f))),
|
|
49
49
|
uniformPauses: (plusOrMinus) => wrapSetUp(jvmSetUp.uniformPauses((0, duration_1.toJvmDuration)(plusOrMinus))),
|
|
50
50
|
normalPausesWithStdDevDuration: (stdDevDuration) => wrapSetUp(jvmSetUp.normalPausesWithStdDevDuration((0, duration_1.toJvmDuration)(stdDevDuration))),
|
|
51
51
|
normalPausesWithPercentageDuration: (stdDevPercent) => wrapSetUp(jvmSetUp.normalPausesWithPercentageDuration(stdDevPercent)),
|
package/target/population.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wrapPopulationBuilder = void 0;
|
|
4
|
-
const callbacks_1 = require("./gatlingJvm/callbacks");
|
|
5
4
|
const duration_1 = require("./utils/duration");
|
|
6
5
|
const pauses_1 = require("./structure/pauses");
|
|
7
6
|
const session_1 = require("./session");
|
|
@@ -12,7 +11,7 @@ const wrapPopulationBuilder = (_underlying) => ({
|
|
|
12
11
|
disablePauses: () => (0, exports.wrapPopulationBuilder)(_underlying.disablePauses()),
|
|
13
12
|
constantPauses: () => (0, exports.wrapPopulationBuilder)(_underlying.constantPauses()),
|
|
14
13
|
exponentialPauses: () => (0, exports.wrapPopulationBuilder)(_underlying.exponentialPauses()),
|
|
15
|
-
customPauses: (f) => (0, exports.wrapPopulationBuilder)(_underlying.customPauses((0,
|
|
14
|
+
customPauses: (f) => (0, exports.wrapPopulationBuilder)(_underlying.customPauses((0, session_1.underlyingSessionTo)(f))),
|
|
16
15
|
uniformPauses: (plusOrMinus) => (0, exports.wrapPopulationBuilder)(_underlying.uniformPauses((0, duration_1.toJvmDuration)(plusOrMinus))),
|
|
17
16
|
pauses: (pauseType) => (0, exports.wrapPopulationBuilder)(_underlying.pauses((0, pauses_1.toJvmPauseType)(pauseType))),
|
|
18
17
|
throttle: (...throttleSteps) => (0, exports.wrapPopulationBuilder)(_underlying.throttle(throttleSteps.map((t) => t._underlying))),
|
package/target/session.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.underlyingXWithSessionTo = exports.underlyingSessionToDuration = exports.underlyingSessionToJava = exports.underlyingSessionTo = exports.underlyingSessionTransform = exports.wrapSession = void 0;
|
|
4
|
-
const callbacks_1 = require("./gatlingJvm/callbacks");
|
|
5
4
|
const collections_1 = require("./gatlingJvm/collections");
|
|
6
5
|
const duration_1 = require("./utils/duration");
|
|
7
6
|
const wrapSession = (_underlying) => ({
|
|
@@ -10,7 +9,7 @@ const wrapSession = (_underlying) => ({
|
|
|
10
9
|
set: (key, value) => {
|
|
11
10
|
return (0, exports.wrapSession)(_underlying.set(key, (0, collections_1.asJava)(value)));
|
|
12
11
|
},
|
|
13
|
-
setByteArray: (key, value) => (0, exports.wrapSession)(_underlying.set(key,
|
|
12
|
+
setByteArray: (key, value) => (0, exports.wrapSession)(_underlying.set(key, value)),
|
|
14
13
|
setAll: (newAttributes) => {
|
|
15
14
|
let session = _underlying;
|
|
16
15
|
for (const key in newAttributes) {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asLongAsImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
6
|
const asLongAsImpl = (jvmAsLongAs, wrap) => (condition, arg1, arg2) => {
|
|
8
7
|
if (arg2 !== undefined && typeof arg1 === "string") {
|
|
9
8
|
// asLongAs(condition, counterName, exitASAP)
|
|
10
9
|
if (typeof condition === "function") {
|
|
11
|
-
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0,
|
|
10
|
+
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0, session_1.underlyingSessionTo)(condition), arg1, arg2), wrap);
|
|
12
11
|
}
|
|
13
12
|
else {
|
|
14
13
|
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs(condition, arg1, arg2), wrap);
|
|
@@ -17,7 +16,7 @@ const asLongAsImpl = (jvmAsLongAs, wrap) => (condition, arg1, arg2) => {
|
|
|
17
16
|
else if (typeof arg1 === "string") {
|
|
18
17
|
// asLongAs(condition, counterName)
|
|
19
18
|
if (typeof condition === "function") {
|
|
20
|
-
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0,
|
|
19
|
+
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0, session_1.underlyingSessionTo)(condition), arg1), wrap);
|
|
21
20
|
}
|
|
22
21
|
else {
|
|
23
22
|
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs(condition, arg1), wrap);
|
|
@@ -26,7 +25,7 @@ const asLongAsImpl = (jvmAsLongAs, wrap) => (condition, arg1, arg2) => {
|
|
|
26
25
|
else if (typeof arg1 === "boolean") {
|
|
27
26
|
// asLongAs(condition, exitASAP)
|
|
28
27
|
if (typeof condition === "function") {
|
|
29
|
-
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0,
|
|
28
|
+
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0, session_1.underlyingSessionTo)(condition), arg1), wrap);
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
31
|
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs(condition, arg1), wrap);
|
|
@@ -35,7 +34,7 @@ const asLongAsImpl = (jvmAsLongAs, wrap) => (condition, arg1, arg2) => {
|
|
|
35
34
|
else if (arg1 === undefined) {
|
|
36
35
|
// asLongAs(condition)
|
|
37
36
|
if (typeof condition === "function") {
|
|
38
|
-
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0,
|
|
37
|
+
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs((0, session_1.underlyingSessionTo)(condition)), wrap);
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
41
40
|
return (0, on_1.wrapOn)(jvmAsLongAs.asLongAs(condition), wrap);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.asLongAsDuringImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const duration_1 = require("../utils/duration");
|
|
6
5
|
const session_1 = require("../session");
|
|
7
6
|
const on_1 = require("./on");
|
|
@@ -9,12 +8,12 @@ const asLongAsDuringImpl = (jvmAsLongAsDuring, wrap) => (condition, duration, ar
|
|
|
9
8
|
if (arg3 !== undefined && typeof arg2 === "string") {
|
|
10
9
|
// asLongAsDuring(condition, duration, counterName, exitASAP)
|
|
11
10
|
if (typeof condition === "function") {
|
|
12
|
-
const wrappedCondition = (0,
|
|
11
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
13
12
|
if ((0, duration_1.isDuration)(duration)) {
|
|
14
13
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2, arg3), wrap);
|
|
15
14
|
}
|
|
16
15
|
else if (typeof duration === "function") {
|
|
17
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0,
|
|
16
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2, arg3), wrap);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
@@ -22,19 +21,19 @@ const asLongAsDuringImpl = (jvmAsLongAsDuring, wrap) => (condition, duration, ar
|
|
|
22
21
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2, arg3), wrap);
|
|
23
22
|
}
|
|
24
23
|
else if (typeof duration === "function") {
|
|
25
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0,
|
|
24
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2, arg3), wrap);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
else if (typeof arg2 === "string") {
|
|
30
29
|
// asLongAsDuring(condition, duration, counterName)
|
|
31
30
|
if (typeof condition === "function") {
|
|
32
|
-
const wrappedCondition = (0,
|
|
31
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
33
32
|
if ((0, duration_1.isDuration)(duration)) {
|
|
34
33
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
35
34
|
}
|
|
36
35
|
else if (typeof duration === "function") {
|
|
37
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0,
|
|
36
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
@@ -42,19 +41,19 @@ const asLongAsDuringImpl = (jvmAsLongAsDuring, wrap) => (condition, duration, ar
|
|
|
42
41
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
43
42
|
}
|
|
44
43
|
else if (typeof duration === "function") {
|
|
45
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0,
|
|
44
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
else if (typeof arg2 === "boolean") {
|
|
50
49
|
// asLongAsDuring(condition, duration, exitASAP)
|
|
51
50
|
if (typeof condition === "function") {
|
|
52
|
-
const wrappedCondition = (0,
|
|
51
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
53
52
|
if ((0, duration_1.isDuration)(duration)) {
|
|
54
53
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
55
54
|
}
|
|
56
55
|
else if (typeof duration === "function") {
|
|
57
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0,
|
|
56
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
else {
|
|
@@ -62,19 +61,19 @@ const asLongAsDuringImpl = (jvmAsLongAsDuring, wrap) => (condition, duration, ar
|
|
|
62
61
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
63
62
|
}
|
|
64
63
|
else if (typeof duration === "function") {
|
|
65
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0,
|
|
64
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
else if (arg2 === undefined) {
|
|
70
69
|
// asLongAsDuring(condition, duration)
|
|
71
70
|
if (typeof condition === "function") {
|
|
72
|
-
const wrappedCondition = (0,
|
|
71
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
73
72
|
if ((0, duration_1.isDuration)(duration)) {
|
|
74
73
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration)), wrap);
|
|
75
74
|
}
|
|
76
75
|
else if (typeof duration === "function") {
|
|
77
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0,
|
|
76
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration)), wrap);
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
else {
|
|
@@ -82,7 +81,7 @@ const asLongAsDuringImpl = (jvmAsLongAsDuring, wrap) => (condition, duration, ar
|
|
|
82
81
|
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, duration_1.toJvmDuration)(duration)), wrap);
|
|
83
82
|
}
|
|
84
83
|
else if (typeof duration === "function") {
|
|
85
|
-
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0,
|
|
84
|
+
return (0, on_1.wrapOn)(jvmAsLongAsDuring.asLongAsDuring(condition, (0, session_1.underlyingSessionToDuration)(duration)), wrap);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
}
|
package/target/structure/doIf.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doIfEqualsImpl = exports.doIfImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const wrapThen = (jvmThen, wrap) => ({
|
|
7
6
|
then: (executable, ...executables) => wrap(jvmThen.then(executable._underlying, ...executables.map((e) => e._underlying)))
|
|
8
7
|
});
|
|
9
|
-
const doIfImpl = (jvmDoIf, wrap) => (condition) => wrapThen(typeof condition === "function"
|
|
10
|
-
? jvmDoIf.doIf((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(condition)))
|
|
11
|
-
: jvmDoIf.doIf(condition), wrap);
|
|
8
|
+
const doIfImpl = (jvmDoIf, wrap) => (condition) => wrapThen(typeof condition === "function" ? jvmDoIf.doIf((0, session_1.underlyingSessionTo)(condition)) : jvmDoIf.doIf(condition), wrap);
|
|
12
9
|
exports.doIfImpl = doIfImpl;
|
|
13
10
|
const doIfEqualsImpl = (jvmDoIfEquals, wrap) => (actual, expected) => {
|
|
14
11
|
if (typeof actual === "function") {
|
|
15
|
-
const wrappedActual = (0,
|
|
12
|
+
const wrappedActual = (0, session_1.underlyingSessionTo)(actual);
|
|
16
13
|
if (typeof expected === "function") {
|
|
17
|
-
return wrapThen(jvmDoIfEquals.doIfEquals(wrappedActual, (0,
|
|
14
|
+
return wrapThen(jvmDoIfEquals.doIfEquals(wrappedActual, (0, session_1.underlyingSessionTo)(expected)), wrap);
|
|
18
15
|
}
|
|
19
16
|
else if (typeof expected === "string") {
|
|
20
17
|
return wrapThen(jvmDoIfEquals.doIfEquals(wrappedActual, expected), wrap);
|
|
@@ -25,7 +22,7 @@ const doIfEqualsImpl = (jvmDoIfEquals, wrap) => (actual, expected) => {
|
|
|
25
22
|
}
|
|
26
23
|
else {
|
|
27
24
|
if (typeof expected === "function") {
|
|
28
|
-
return wrapThen(jvmDoIfEquals.doIfEquals(actual, (0,
|
|
25
|
+
return wrapThen(jvmDoIfEquals.doIfEquals(actual, (0, session_1.underlyingSessionTo)(expected)), wrap);
|
|
29
26
|
}
|
|
30
27
|
else if (typeof expected === "string") {
|
|
31
28
|
return wrapThen(jvmDoIfEquals.doIfEquals(actual, expected), wrap);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doIfEqualsOrElseImpl = exports.doIfOrElseImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const wrapThen = (jvmThen, wrap) => ({
|
|
7
6
|
then: (executable, ...executables) => wrapOrElse(jvmThen.then(executable._underlying, ...executables.map((e) => e._underlying)), wrap)
|
|
@@ -10,14 +9,14 @@ const wrapOrElse = (jvmOrElse, wrap) => ({
|
|
|
10
9
|
orElse: (executable, ...executables) => wrap(jvmOrElse.orElse(executable._underlying, ...executables.map((e) => e._underlying)))
|
|
11
10
|
});
|
|
12
11
|
const doIfOrElseImpl = (jvmDoIfOrElse, wrap) => (condition) => wrapThen(typeof condition === "function"
|
|
13
|
-
? jvmDoIfOrElse.doIfOrElse((0,
|
|
12
|
+
? jvmDoIfOrElse.doIfOrElse((0, session_1.underlyingSessionTo)(condition))
|
|
14
13
|
: jvmDoIfOrElse.doIfOrElse(condition), wrap);
|
|
15
14
|
exports.doIfOrElseImpl = doIfOrElseImpl;
|
|
16
15
|
const doIfEqualsOrElseImpl = (jvmDoIfEqualsOrElse, wrap) => (actual, expected) => {
|
|
17
16
|
if (typeof actual === "function") {
|
|
18
|
-
const wrappedActual = (0,
|
|
17
|
+
const wrappedActual = (0, session_1.underlyingSessionTo)(actual);
|
|
19
18
|
if (typeof expected === "function") {
|
|
20
|
-
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(wrappedActual, (0,
|
|
19
|
+
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(wrappedActual, (0, session_1.underlyingSessionTo)(expected)), wrap);
|
|
21
20
|
}
|
|
22
21
|
else if (typeof expected === "string") {
|
|
23
22
|
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(wrappedActual, expected), wrap);
|
|
@@ -28,7 +27,7 @@ const doIfEqualsOrElseImpl = (jvmDoIfEqualsOrElse, wrap) => (actual, expected) =
|
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
29
|
if (typeof expected === "function") {
|
|
31
|
-
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(actual, (0,
|
|
30
|
+
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(actual, (0, session_1.underlyingSessionTo)(expected)), wrap);
|
|
32
31
|
}
|
|
33
32
|
else if (typeof expected === "string") {
|
|
34
33
|
return wrapThen(jvmDoIfEqualsOrElse.doIfEqualsOrElse(actual, expected), wrap);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSwitchImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const wrapOn = (jvmOn, wrap) => ({
|
|
7
6
|
on: (...choices) => wrap(jvmOn.on(choices.map((c) => c._underlying)))
|
|
8
7
|
});
|
|
9
|
-
const doSwitchImpl = (jvmDoSwitch, wrap) => (actual) => wrapOn(typeof actual === "function"
|
|
10
|
-
? jvmDoSwitch.doSwitch((0, callbacks_1.wrapCallback)((0, session_1.underlyingSessionTo)(actual)))
|
|
11
|
-
: jvmDoSwitch.doSwitch(actual), wrap);
|
|
8
|
+
const doSwitchImpl = (jvmDoSwitch, wrap) => (actual) => wrapOn(typeof actual === "function" ? jvmDoSwitch.doSwitch((0, session_1.underlyingSessionTo)(actual)) : jvmDoSwitch.doSwitch(actual), wrap);
|
|
12
9
|
exports.doSwitchImpl = doSwitchImpl;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doSwitchOrElseImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const wrapOn = (jvmOn, wrap) => ({
|
|
7
6
|
on: (...choices) => wrapOrElse(jvmOn.on(choices.map((c) => c._underlying)), wrap)
|
|
@@ -10,6 +9,6 @@ const wrapOrElse = (jvmOrElse, wrap) => ({
|
|
|
10
9
|
orElse: (executable, ...executables) => wrap(jvmOrElse.orElse(executable._underlying, ...executables.map((e) => e._underlying)))
|
|
11
10
|
});
|
|
12
11
|
const doSwitchOrElseImpl = (jvmDoSwitchOrElse, wrap) => (actual) => wrapOn(typeof actual === "function"
|
|
13
|
-
? jvmDoSwitchOrElse.doSwitchOrElse((0,
|
|
12
|
+
? jvmDoSwitchOrElse.doSwitchOrElse((0, session_1.underlyingSessionTo)(actual))
|
|
14
13
|
: jvmDoSwitchOrElse.doSwitchOrElse(actual), wrap);
|
|
15
14
|
exports.doSwitchOrElseImpl = doSwitchOrElseImpl;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doWhileImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
6
|
const doWhileImpl = (jvmDoWhile, wrap) => (condition, counterName) => {
|
|
8
7
|
if (counterName !== undefined) {
|
|
9
8
|
// doWhile(condition, counterName)
|
|
10
9
|
if (typeof condition === "function") {
|
|
11
|
-
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0,
|
|
10
|
+
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0, session_1.underlyingSessionTo)(condition), counterName), wrap);
|
|
12
11
|
}
|
|
13
12
|
else {
|
|
14
13
|
return (0, on_1.wrapOn)(jvmDoWhile.doWhile(condition, counterName), wrap);
|
|
@@ -17,7 +16,7 @@ const doWhileImpl = (jvmDoWhile, wrap) => (condition, counterName) => {
|
|
|
17
16
|
else {
|
|
18
17
|
// doWhile(condition)
|
|
19
18
|
if (typeof condition === "function") {
|
|
20
|
-
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0,
|
|
19
|
+
return (0, on_1.wrapOn)(jvmDoWhile.doWhile((0, session_1.underlyingSessionTo)(condition)), wrap);
|
|
21
20
|
}
|
|
22
21
|
else {
|
|
23
22
|
return (0, on_1.wrapOn)(jvmDoWhile.doWhile(condition), wrap);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doWhileDuringImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const duration_1 = require("../utils/duration");
|
|
6
5
|
const session_1 = require("../session");
|
|
7
6
|
const on_1 = require("./on");
|
|
@@ -9,12 +8,12 @@ const doWhileDuringImpl = (jvmDoWhileDuring, wrap) => (condition, duration, arg2
|
|
|
9
8
|
if (arg3 !== undefined && typeof arg2 === "string") {
|
|
10
9
|
// doWhileDuring(condition, duration, counterName, exitASAP)
|
|
11
10
|
if (typeof condition === "function") {
|
|
12
|
-
const wrappedCondition = (0,
|
|
11
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
13
12
|
if ((0, duration_1.isDuration)(duration)) {
|
|
14
13
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2, arg3), wrap);
|
|
15
14
|
}
|
|
16
15
|
else if (typeof duration === "function") {
|
|
17
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0,
|
|
16
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2, arg3), wrap);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
@@ -22,19 +21,19 @@ const doWhileDuringImpl = (jvmDoWhileDuring, wrap) => (condition, duration, arg2
|
|
|
22
21
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2, arg3), wrap);
|
|
23
22
|
}
|
|
24
23
|
else if (typeof duration === "function") {
|
|
25
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0,
|
|
24
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2, arg3), wrap);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
else if (typeof arg2 === "string") {
|
|
30
29
|
// doWhileDuring(condition, duration, counterName)
|
|
31
30
|
if (typeof condition === "function") {
|
|
32
|
-
const wrappedCondition = (0,
|
|
31
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
33
32
|
if ((0, duration_1.isDuration)(duration)) {
|
|
34
33
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
35
34
|
}
|
|
36
35
|
else if (typeof duration === "function") {
|
|
37
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0,
|
|
36
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
else {
|
|
@@ -42,19 +41,19 @@ const doWhileDuringImpl = (jvmDoWhileDuring, wrap) => (condition, duration, arg2
|
|
|
42
41
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
43
42
|
}
|
|
44
43
|
else if (typeof duration === "function") {
|
|
45
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0,
|
|
44
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
else if (typeof arg2 === "boolean") {
|
|
50
49
|
// doWhileDuring(condition, duration, exitASAP)
|
|
51
50
|
if (typeof condition === "function") {
|
|
52
|
-
const wrappedCondition = (0,
|
|
51
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
53
52
|
if ((0, duration_1.isDuration)(duration)) {
|
|
54
53
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
55
54
|
}
|
|
56
55
|
else if (typeof duration === "function") {
|
|
57
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0,
|
|
56
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
else {
|
|
@@ -62,19 +61,19 @@ const doWhileDuringImpl = (jvmDoWhileDuring, wrap) => (condition, duration, arg2
|
|
|
62
61
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, duration_1.toJvmDuration)(duration), arg2), wrap);
|
|
63
62
|
}
|
|
64
63
|
else if (typeof duration === "function") {
|
|
65
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0,
|
|
64
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, session_1.underlyingSessionToDuration)(duration), arg2), wrap);
|
|
66
65
|
}
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
else if (arg2 === undefined) {
|
|
70
69
|
// doWhileDuring(condition, duration)
|
|
71
70
|
if (typeof condition === "function") {
|
|
72
|
-
const wrappedCondition = (0,
|
|
71
|
+
const wrappedCondition = (0, session_1.underlyingSessionTo)(condition);
|
|
73
72
|
if ((0, duration_1.isDuration)(duration)) {
|
|
74
73
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, duration_1.toJvmDuration)(duration)), wrap);
|
|
75
74
|
}
|
|
76
75
|
else if (typeof duration === "function") {
|
|
77
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0,
|
|
76
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(wrappedCondition, (0, session_1.underlyingSessionToDuration)(duration)), wrap);
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
else {
|
|
@@ -82,7 +81,7 @@ const doWhileDuringImpl = (jvmDoWhileDuring, wrap) => (condition, duration, arg2
|
|
|
82
81
|
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, duration_1.toJvmDuration)(duration)), wrap);
|
|
83
82
|
}
|
|
84
83
|
else if (typeof duration === "function") {
|
|
85
|
-
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0,
|
|
84
|
+
return (0, on_1.wrapOn)(jvmDoWhileDuring.doWhileDuring(condition, (0, session_1.underlyingSessionToDuration)(duration)), wrap);
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.duringImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const duration_1 = require("../utils/duration");
|
|
6
5
|
const session_1 = require("../session");
|
|
7
6
|
const on_1 = require("./on");
|
|
@@ -12,7 +11,7 @@ const duringImpl = (jvmDuring, wrap) => (duration, arg1, arg2) => {
|
|
|
12
11
|
return (0, on_1.wrapOn)(jvmDuring.during((0, duration_1.toJvmDuration)(duration), arg1, arg2), wrap);
|
|
13
12
|
}
|
|
14
13
|
else if (typeof duration === "function") {
|
|
15
|
-
return (0, on_1.wrapOn)(jvmDuring.during((0,
|
|
14
|
+
return (0, on_1.wrapOn)(jvmDuring.during((0, session_1.underlyingSessionToDuration)(duration), arg1, arg2), wrap);
|
|
16
15
|
}
|
|
17
16
|
else {
|
|
18
17
|
return (0, on_1.wrapOn)(jvmDuring.during(duration, arg1, arg2), wrap);
|
|
@@ -24,7 +23,7 @@ const duringImpl = (jvmDuring, wrap) => (duration, arg1, arg2) => {
|
|
|
24
23
|
return (0, on_1.wrapOn)(jvmDuring.during((0, duration_1.toJvmDuration)(duration), arg1), wrap);
|
|
25
24
|
}
|
|
26
25
|
else if (typeof duration === "function") {
|
|
27
|
-
return (0, on_1.wrapOn)(jvmDuring.during((0,
|
|
26
|
+
return (0, on_1.wrapOn)(jvmDuring.during((0, session_1.underlyingSessionToDuration)(duration), arg1), wrap);
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
30
29
|
return (0, on_1.wrapOn)(jvmDuring.during(duration, arg1), wrap);
|
|
@@ -36,7 +35,7 @@ const duringImpl = (jvmDuring, wrap) => (duration, arg1, arg2) => {
|
|
|
36
35
|
return (0, on_1.wrapOn)(jvmDuring.during((0, duration_1.toJvmDuration)(duration), arg1), wrap);
|
|
37
36
|
}
|
|
38
37
|
else if (typeof duration === "function") {
|
|
39
|
-
return (0, on_1.wrapOn)(jvmDuring.during((0,
|
|
38
|
+
return (0, on_1.wrapOn)(jvmDuring.during((0, session_1.underlyingSessionToDuration)(duration), arg1), wrap);
|
|
40
39
|
}
|
|
41
40
|
else {
|
|
42
41
|
return (0, on_1.wrapOn)(jvmDuring.during(duration, arg1), wrap);
|
|
@@ -48,7 +47,7 @@ const duringImpl = (jvmDuring, wrap) => (duration, arg1, arg2) => {
|
|
|
48
47
|
return (0, on_1.wrapOn)(jvmDuring.during((0, duration_1.toJvmDuration)(duration)), wrap);
|
|
49
48
|
}
|
|
50
49
|
else if (typeof duration === "function") {
|
|
51
|
-
return (0, on_1.wrapOn)(jvmDuring.during((0,
|
|
50
|
+
return (0, on_1.wrapOn)(jvmDuring.during((0, session_1.underlyingSessionToDuration)(duration)), wrap);
|
|
52
51
|
}
|
|
53
52
|
else {
|
|
54
53
|
return (0, on_1.wrapOn)(jvmDuring.during(duration), wrap);
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.errorsImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
6
|
const errorsImpl = (jvmErrors, wrap) => ({
|
|
8
7
|
exitBlockOnFail: () => (0, on_1.wrapOn)(jvmErrors.exitBlockOnFail(), wrap),
|
|
9
8
|
tryMax: (times) => (0, on_1.wrapOn)(typeof times === "function"
|
|
10
|
-
? jvmErrors.tryMax((0,
|
|
9
|
+
? jvmErrors.tryMax((0, session_1.underlyingSessionTo)(times))
|
|
11
10
|
: typeof times === "string"
|
|
12
11
|
? jvmErrors.tryMax(times)
|
|
13
12
|
: jvmErrors.tryMax(times), wrap),
|
|
14
13
|
exitHereIf: (condition) => wrap(typeof condition === "function"
|
|
15
|
-
? jvmErrors.exitHereIf((0,
|
|
14
|
+
? jvmErrors.exitHereIf((0, session_1.underlyingSessionTo)(condition))
|
|
16
15
|
: jvmErrors.exitHereIf(condition)),
|
|
17
16
|
exitHere: () => wrap(jvmErrors.exitHere()),
|
|
18
17
|
exitHereIfFailed: () => wrap(jvmErrors.exitHereIfFailed()),
|
|
19
18
|
stopInjector: (message) => wrap(typeof message === "function"
|
|
20
|
-
? jvmErrors.stopInjector((0,
|
|
19
|
+
? jvmErrors.stopInjector((0, session_1.underlyingSessionTo)(message))
|
|
21
20
|
: jvmErrors.stopInjector(message)),
|
|
22
21
|
stopInjectorIf: (message, condition) => {
|
|
23
22
|
if (typeof message === "function") {
|
|
24
23
|
if (typeof condition === "function") {
|
|
25
|
-
return wrap(jvmErrors.stopInjectorIf((0,
|
|
24
|
+
return wrap(jvmErrors.stopInjectorIf((0, session_1.underlyingSessionTo)(message), (0, session_1.underlyingSessionTo)(condition)));
|
|
26
25
|
}
|
|
27
26
|
else {
|
|
28
|
-
return wrap(jvmErrors.stopInjectorIf((0,
|
|
27
|
+
return wrap(jvmErrors.stopInjectorIf((0, session_1.underlyingSessionTo)(message), condition));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
31
|
if (typeof condition === "function") {
|
|
33
|
-
return wrap(jvmErrors.stopInjectorIf(message, (0,
|
|
32
|
+
return wrap(jvmErrors.stopInjectorIf(message, (0, session_1.underlyingSessionTo)(condition)));
|
|
34
33
|
}
|
|
35
34
|
else {
|
|
36
35
|
return wrap(jvmErrors.stopInjectorIf(message, condition));
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.execImpl = exports.wrapActionBuilder = void 0;
|
|
4
4
|
const session_1 = require("../session");
|
|
5
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
6
5
|
const wrapActionBuilder = (_underlying) => ({
|
|
7
6
|
_underlying
|
|
8
7
|
});
|
|
9
8
|
exports.wrapActionBuilder = wrapActionBuilder;
|
|
10
9
|
const execImpl = (jvmExecs, wrap) => (arg0, ...arg1) => wrap(typeof arg0 === "function"
|
|
11
|
-
? jvmExecs.exec((0,
|
|
10
|
+
? jvmExecs.exec((0, session_1.underlyingSessionTransform)(arg0)) // arg0: SessionTransform
|
|
12
11
|
: jvmExecs.exec(arg0._underlying, ...arg1.map((e) => e._underlying)) // arg0: Executable, ...arg1: Executable[]
|
|
13
12
|
);
|
|
14
13
|
exports.execImpl = execImpl;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.feedImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const feedImpl = (jvmFeeds, wrap) => (feederBuilder, numberOfRecords) => {
|
|
7
6
|
if (typeof numberOfRecords === "number") {
|
|
@@ -11,7 +10,7 @@ const feedImpl = (jvmFeeds, wrap) => (feederBuilder, numberOfRecords) => {
|
|
|
11
10
|
return wrap(jvmFeeds.feed(feederBuilder._underlying, numberOfRecords));
|
|
12
11
|
}
|
|
13
12
|
else if (typeof numberOfRecords === "function") {
|
|
14
|
-
return wrap(jvmFeeds.feed(feederBuilder._underlying, (0,
|
|
13
|
+
return wrap(jvmFeeds.feed(feederBuilder._underlying, (0, session_1.underlyingSessionTo)(numberOfRecords)));
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
16
|
return wrap(jvmFeeds.feed(feederBuilder._underlying));
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.foreachImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
6
|
const foreachImpl = (jvmForEach, wrap) => (seq, attributeName, counterName) => {
|
|
8
7
|
if (typeof seq === "function") {
|
|
9
8
|
if (counterName !== undefined) {
|
|
10
|
-
return (0, on_1.wrapOn)(jvmForEach.foreach((0,
|
|
9
|
+
return (0, on_1.wrapOn)(jvmForEach.foreach((0, session_1.underlyingSessionTo)(seq), attributeName, counterName), wrap);
|
|
11
10
|
}
|
|
12
11
|
else {
|
|
13
|
-
return (0, on_1.wrapOn)(jvmForEach.foreach((0,
|
|
12
|
+
return (0, on_1.wrapOn)(jvmForEach.foreach((0, session_1.underlyingSessionTo)(seq), attributeName), wrap);
|
|
14
13
|
}
|
|
15
14
|
}
|
|
16
15
|
else if (typeof seq === "string") {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.groupImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
|
-
const groupImpl = (jvmGroups, wrap) => (group) => (0, on_1.wrapOn)(typeof group === "function" ? jvmGroups.group((0,
|
|
6
|
+
const groupImpl = (jvmGroups, wrap) => (group) => (0, on_1.wrapOn)(typeof group === "function" ? jvmGroups.group((0, session_1.underlyingSessionTo)(group)) : jvmGroups.group(group), wrap);
|
|
8
7
|
exports.groupImpl = groupImpl;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.paceImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const duration_1 = require("../utils/duration");
|
|
6
5
|
const session_1 = require("../session");
|
|
7
6
|
const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
@@ -11,7 +10,7 @@ const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
11
10
|
return wrap(jvmGroups.pace(arg0, arg1, arg2));
|
|
12
11
|
}
|
|
13
12
|
else if (typeof arg0 === "function" && typeof arg1 === "function") {
|
|
14
|
-
return wrap(jvmGroups.pace((0,
|
|
13
|
+
return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1), arg2));
|
|
15
14
|
}
|
|
16
15
|
else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
|
|
17
16
|
return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1), arg2));
|
|
@@ -24,7 +23,7 @@ const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
24
23
|
return wrap(jvmGroups.pace(arg0, arg1));
|
|
25
24
|
}
|
|
26
25
|
else if (typeof arg0 === "function") {
|
|
27
|
-
return wrap(jvmGroups.pace((0,
|
|
26
|
+
return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), arg1));
|
|
28
27
|
}
|
|
29
28
|
else if ((0, duration_1.isDuration)(arg0)) {
|
|
30
29
|
return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), arg1));
|
|
@@ -33,7 +32,7 @@ const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
33
32
|
else {
|
|
34
33
|
// pace(min, max)
|
|
35
34
|
if (typeof arg0 === "function" && typeof arg1 === "function") {
|
|
36
|
-
return wrap(jvmGroups.pace((0,
|
|
35
|
+
return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1)));
|
|
37
36
|
}
|
|
38
37
|
else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
|
|
39
38
|
return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1)));
|
|
@@ -46,7 +45,7 @@ const paceImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
46
45
|
return wrap(jvmGroups.pace(arg0));
|
|
47
46
|
}
|
|
48
47
|
else if (typeof arg0 === "function") {
|
|
49
|
-
return wrap(jvmGroups.pace((0,
|
|
48
|
+
return wrap(jvmGroups.pace((0, session_1.underlyingSessionToDuration)(arg0)));
|
|
50
49
|
}
|
|
51
50
|
else if ((0, duration_1.isDuration)(arg0)) {
|
|
52
51
|
return wrap(jvmGroups.pace((0, duration_1.toJvmDuration)(arg0)));
|
|
@@ -4,7 +4,6 @@ exports.pauseImpl = exports.toJvmPauseType = void 0;
|
|
|
4
4
|
const jvm_types_1 = require("@gatling.io/jvm-types");
|
|
5
5
|
const duration_1 = require("../utils/duration");
|
|
6
6
|
const session_1 = require("../session");
|
|
7
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
8
7
|
const isPauseType = (x) => x === "Disabled" || x === "Constant" || x === "Exponential" || typeof x.type === "string";
|
|
9
8
|
const toJvmPauseType = (pauseType) => {
|
|
10
9
|
if (pauseType === "Disabled") {
|
|
@@ -25,7 +24,7 @@ const toJvmPauseType = (pauseType) => {
|
|
|
25
24
|
return jvm_types_1.CoreDsl.normalPausesWithStdDevDuration((0, duration_1.toJvmDuration)(pauseType.stdDev));
|
|
26
25
|
}
|
|
27
26
|
else if (pauseType.type === "Custom") {
|
|
28
|
-
return jvm_types_1.CoreDsl.customPauses((0,
|
|
27
|
+
return jvm_types_1.CoreDsl.customPauses((0, session_1.underlyingSessionTo)(pauseType.f));
|
|
29
28
|
}
|
|
30
29
|
else if (pauseType.type === "UniformPercentage") {
|
|
31
30
|
return jvm_types_1.CoreDsl.uniformPausesPlusOrMinusPercentage(pauseType.plusOrMinus);
|
|
@@ -43,7 +42,7 @@ const pauseImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
43
42
|
return wrap(jvmGroups.pause(arg0, arg1, (0, exports.toJvmPauseType)(arg2)));
|
|
44
43
|
}
|
|
45
44
|
else if (typeof arg0 === "function" && typeof arg1 === "function") {
|
|
46
|
-
return wrap(jvmGroups.pause((0,
|
|
45
|
+
return wrap(jvmGroups.pause((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1), (0, exports.toJvmPauseType)(arg2)));
|
|
47
46
|
}
|
|
48
47
|
else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
|
|
49
48
|
return wrap(jvmGroups.pause((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1), (0, exports.toJvmPauseType)(arg2)));
|
|
@@ -56,7 +55,7 @@ const pauseImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
56
55
|
return wrap(jvmGroups.pause(arg0, (0, exports.toJvmPauseType)(arg1)));
|
|
57
56
|
}
|
|
58
57
|
else if (typeof arg0 === "function") {
|
|
59
|
-
return wrap(jvmGroups.pause((0,
|
|
58
|
+
return wrap(jvmGroups.pause((0, session_1.underlyingSessionToDuration)(arg0), (0, exports.toJvmPauseType)(arg1)));
|
|
60
59
|
}
|
|
61
60
|
else if ((0, duration_1.isDuration)(arg0)) {
|
|
62
61
|
return wrap(jvmGroups.pause((0, duration_1.toJvmDuration)(arg0), (0, exports.toJvmPauseType)(arg1)));
|
|
@@ -68,7 +67,7 @@ const pauseImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
68
67
|
return wrap(jvmGroups.pause(arg0, arg1));
|
|
69
68
|
}
|
|
70
69
|
else if (typeof arg0 === "function" && typeof arg1 === "function") {
|
|
71
|
-
return wrap(jvmGroups.pause((0,
|
|
70
|
+
return wrap(jvmGroups.pause((0, session_1.underlyingSessionToDuration)(arg0), (0, session_1.underlyingSessionToDuration)(arg1)));
|
|
72
71
|
}
|
|
73
72
|
else if ((0, duration_1.isDuration)(arg0) && (0, duration_1.isDuration)(arg1)) {
|
|
74
73
|
return wrap(jvmGroups.pause((0, duration_1.toJvmDuration)(arg0), (0, duration_1.toJvmDuration)(arg1)));
|
|
@@ -81,7 +80,7 @@ const pauseImpl = (jvmGroups, wrap) => (arg0, arg1, arg2) => {
|
|
|
81
80
|
return wrap(jvmGroups.pause(arg0));
|
|
82
81
|
}
|
|
83
82
|
else if (typeof arg0 === "function") {
|
|
84
|
-
return wrap(jvmGroups.pause((0,
|
|
83
|
+
return wrap(jvmGroups.pause((0, session_1.underlyingSessionToDuration)(arg0)));
|
|
85
84
|
}
|
|
86
85
|
else if ((0, duration_1.isDuration)(arg0)) {
|
|
87
86
|
return wrap(jvmGroups.pause((0, duration_1.toJvmDuration)(arg0)));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.repeatImpl = void 0;
|
|
4
|
-
const callbacks_1 = require("../gatlingJvm/callbacks");
|
|
5
4
|
const session_1 = require("../session");
|
|
6
5
|
const on_1 = require("./on");
|
|
7
6
|
const repeatImpl = (jvmRepeat, wrap) => (times, counterName) => {
|
|
@@ -14,7 +13,7 @@ const repeatImpl = (jvmRepeat, wrap) => (times, counterName) => {
|
|
|
14
13
|
return (0, on_1.wrapOn)(jvmRepeat.repeat(times, counterName), wrap);
|
|
15
14
|
}
|
|
16
15
|
else {
|
|
17
|
-
return (0, on_1.wrapOn)(jvmRepeat.repeat((0,
|
|
16
|
+
return (0, on_1.wrapOn)(jvmRepeat.repeat((0, session_1.underlyingSessionTo)(times), counterName), wrap);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
@@ -26,7 +25,7 @@ const repeatImpl = (jvmRepeat, wrap) => (times, counterName) => {
|
|
|
26
25
|
return (0, on_1.wrapOn)(jvmRepeat.repeat(times), wrap);
|
|
27
26
|
}
|
|
28
27
|
else {
|
|
29
|
-
return (0, on_1.wrapOn)(jvmRepeat.repeat((0,
|
|
28
|
+
return (0, on_1.wrapOn)(jvmRepeat.repeat((0, session_1.underlyingSessionTo)(times)), wrap);
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import JvmSession = io.gatling.javaapi.core.Session;
|
|
2
|
-
type JvmExpression<T> = (arg: JvmSession) => T;
|
|
3
|
-
type Callback<T, R> = (arg: T) => R;
|
|
4
|
-
type BiCallback<T, U, R> = (arg0: T, arg1: U) => R;
|
|
5
|
-
export declare const wrapByteArray: (v: number[]) => number[];
|
|
6
|
-
export declare const wrapByteArrayCallback: (f: JvmExpression<number[]>) => JvmExpression<number[]>;
|
|
7
|
-
export declare const wrapCallback: <T, R>(f: Callback<T, R>) => Callback<T, R>;
|
|
8
|
-
export declare const wrapBiCallback: <T, U, R>(f: BiCallback<T, U, R>) => BiCallback<T, U, R>;
|
|
9
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrapBiCallback = exports.wrapCallback = exports.wrapByteArrayCallback = exports.wrapByteArray = void 0;
|
|
4
|
-
const CallbackWrapper = Java.type("io.gatling.js.callbacks.CallbackWrapper");
|
|
5
|
-
// Byte arrays
|
|
6
|
-
const wrapByteArray = (v) => CallbackWrapper.wrapByteArray(v);
|
|
7
|
-
exports.wrapByteArray = wrapByteArray;
|
|
8
|
-
const wrapByteArrayCallback = (f) => CallbackWrapper.wrapByteArrayFunction(f);
|
|
9
|
-
exports.wrapByteArrayCallback = wrapByteArrayCallback;
|
|
10
|
-
// Generic functions
|
|
11
|
-
const wrapCallback = (f) => CallbackWrapper.wrapFunction(f);
|
|
12
|
-
exports.wrapCallback = wrapCallback;
|
|
13
|
-
const wrapBiCallback = (f) => CallbackWrapper.wrapBiFunction(f);
|
|
14
|
-
exports.wrapBiCallback = wrapBiCallback;
|