@gatling.io/core 3.13.2 → 3.13.104-M10
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 +19 -4
- package/jest.config.js +0 -5
- package/src/assertions.ts +0 -305
- package/src/body.ts +0 -211
- package/src/checks/builder.ts +0 -14
- package/src/checks/captureGroup.ts +0 -22
- package/src/checks/condition.ts +0 -24
- package/src/checks/final.ts +0 -31
- package/src/checks/find.ts +0 -23
- package/src/checks/index.ts +0 -540
- package/src/checks/jsonOfTypeFind.ts +0 -81
- package/src/checks/jsonOfTypeMultipleFind.ts +0 -84
- package/src/checks/multipleFind.ts +0 -87
- package/src/checks/validate.ts +0 -336
- package/src/closedInjection.ts +0 -182
- package/src/common.ts +0 -3
- package/src/feeders.ts +0 -279
- package/src/filters.ts +0 -49
- package/src/gatlingJvm/app.ts +0 -5
- package/src/gatlingJvm/byteArrays.ts +0 -14
- package/src/gatlingJvm/collections.ts +0 -28
- package/src/gatlingJvm/resources.ts +0 -11
- package/src/globalStore.ts +0 -104
- package/src/index.test.ts +0 -543
- package/src/index.ts +0 -160
- package/src/openInjection.ts +0 -286
- package/src/parameters.ts +0 -38
- package/src/population.ts +0 -105
- package/src/protocol.ts +0 -5
- package/src/scenario.ts +0 -37
- package/src/session.ts +0 -182
- package/src/structure/asLongAs.ts +0 -121
- package/src/structure/asLongAsDuring.ts +0 -337
- package/src/structure/choices.ts +0 -41
- package/src/structure/doIf.ts +0 -140
- package/src/structure/doIfOrElse.ts +0 -160
- package/src/structure/doSwitch.ts +0 -46
- package/src/structure/doSwitchOrElse.ts +0 -61
- package/src/structure/doWhile.ts +0 -53
- package/src/structure/doWhileDuring.ts +0 -337
- package/src/structure/during.ts +0 -182
- package/src/structure/errors.ts +0 -266
- package/src/structure/execs.ts +0 -66
- package/src/structure/feeds.ts +0 -62
- package/src/structure/forEach.ts +0 -68
- package/src/structure/forever.ts +0 -25
- package/src/structure/groups.ts +0 -23
- package/src/structure/index.ts +0 -130
- package/src/structure/jvmStructureBuilder.ts +0 -52
- package/src/structure/on.ts +0 -20
- package/src/structure/paces.ts +0 -156
- package/src/structure/pauses.ts +0 -211
- package/src/structure/randomSwitch.ts +0 -34
- package/src/structure/randomSwitchOrElse.ts +0 -45
- package/src/structure/rendezVous.ts +0 -23
- package/src/structure/repeat.ts +0 -64
- package/src/structure/roundRobinSwitch.ts +0 -34
- package/src/structure/uniformRandomSwitch.ts +0 -34
- package/src/throttling.ts +0 -67
- package/src/utils/duration.ts +0 -28
- package/tsconfig.json +0 -18
package/package.json
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/core",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.104-M10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"homepage": "https://gatling.io",
|
|
6
|
+
"repository": "github:gatling/gatling-js",
|
|
7
|
+
"bugs": "https://github.com/gatling/gatling/issues",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"gatling",
|
|
10
|
+
"typescript",
|
|
11
|
+
"test",
|
|
12
|
+
"testing",
|
|
13
|
+
"loadtest",
|
|
14
|
+
"loadtesting",
|
|
15
|
+
"load test",
|
|
16
|
+
"load testing",
|
|
17
|
+
"performance test",
|
|
18
|
+
"performance testing"
|
|
19
|
+
],
|
|
5
20
|
"main": "target/index.js",
|
|
6
21
|
"types": "target/index.d.ts",
|
|
7
22
|
"dependencies": {
|
|
8
|
-
"@gatling.io/jvm-types": "3.13.
|
|
23
|
+
"@gatling.io/jvm-types": "3.13.104-M10"
|
|
9
24
|
},
|
|
10
25
|
"devDependencies": {
|
|
11
26
|
"@types/jest": "29.5.14",
|
|
12
27
|
"jest": "29.7.0",
|
|
13
|
-
"prettier": "3.
|
|
28
|
+
"prettier": "3.4.1",
|
|
14
29
|
"rimraf": "6.0.1",
|
|
15
30
|
"ts-jest": "29.2.5",
|
|
16
31
|
"ts-node": "10.9.2",
|
|
17
|
-
"typescript": "5.
|
|
32
|
+
"typescript": "5.7.2"
|
|
18
33
|
},
|
|
19
34
|
"scripts": {
|
|
20
35
|
"clean": "rimraf target",
|
package/jest.config.js
DELETED
package/src/assertions.ts
DELETED
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { CoreDsl as JvmCoreDsl } from "@gatling.io/jvm-types";
|
|
2
|
-
|
|
3
|
-
import { Wrapper } from "./common";
|
|
4
|
-
|
|
5
|
-
import JvmAssertion = io.gatling.javaapi.core.Assertion;
|
|
6
|
-
import JvmAssertionWithPath = io.gatling.javaapi.core.Assertion$WithPath;
|
|
7
|
-
import JvmAssertionWithPathAndTarget = io.gatling.javaapi.core.Assertion$WithPathAndTarget;
|
|
8
|
-
import JvmAssertionWithPathAndCountMetric = io.gatling.javaapi.core.Assertion$WithPathAndCountMetric;
|
|
9
|
-
import JvmAssertionWithPathAndTimeMetric = io.gatling.javaapi.core.Assertion$WithPathAndTimeMetric;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Bootstrap a new global assertion that targets stats aggregated on all requests
|
|
13
|
-
*
|
|
14
|
-
* @returns the next DSL step
|
|
15
|
-
*/
|
|
16
|
-
export const global = (): AssertionWithPath => wrapAssertionWithPath(JvmCoreDsl.global());
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Bootstrap a new forAll assertion that targets stats on each individual request type
|
|
20
|
-
*
|
|
21
|
-
* @returns the next DSL step
|
|
22
|
-
*/
|
|
23
|
-
export const forAll = (): AssertionWithPath => wrapAssertionWithPath(JvmCoreDsl.forAll());
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Bootstrap a new details assertion that targets stats on a specific request type
|
|
27
|
-
*
|
|
28
|
-
* @returns the next DSL step
|
|
29
|
-
*/
|
|
30
|
-
export const details = (...parts: string[]): AssertionWithPath => wrapAssertionWithPath(JvmCoreDsl.details(...parts));
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Step 2 of the Assertion DSL (path defined). Immutable, so all methods return a new occurrence
|
|
34
|
-
* and leave the original unmodified.
|
|
35
|
-
*/
|
|
36
|
-
export interface AssertionWithPath {
|
|
37
|
-
/**
|
|
38
|
-
* Specify the Assertion targets the response time metric
|
|
39
|
-
*
|
|
40
|
-
* @returns the next Assertion DSL step
|
|
41
|
-
*/
|
|
42
|
-
responseTime(): AssertionWithPathAndTimeMetric;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Specify the Assertion targets the all requests count metric
|
|
46
|
-
*
|
|
47
|
-
* @returns the next Assertion DSL step
|
|
48
|
-
*/
|
|
49
|
-
allRequests(): AssertionWithPathAndCountMetric;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Specify the Assertion targets the failed requests count metric
|
|
53
|
-
*
|
|
54
|
-
* @returns the next Assertion DSL step
|
|
55
|
-
*/
|
|
56
|
-
failedRequests(): AssertionWithPathAndCountMetric;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Specify the Assertion targets the successful requests count metric
|
|
60
|
-
*
|
|
61
|
-
* @returns the next Assertion DSL step
|
|
62
|
-
*/
|
|
63
|
-
successfulRequests(): AssertionWithPathAndCountMetric;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Specify the Assertion targets the requests/s metric
|
|
67
|
-
*
|
|
68
|
-
* @returns the next Assertion DSL step
|
|
69
|
-
*/
|
|
70
|
-
requestsPerSec(): AssertionWithPathAndTarget;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const wrapAssertionWithPath = (_underlying: JvmAssertionWithPath): AssertionWithPath => ({
|
|
74
|
-
responseTime: () => wrapAssertionWithPathAndTimeMetric(_underlying.responseTime()),
|
|
75
|
-
allRequests: () => wrapAssertionWithPathAndCountMetric(_underlying.allRequests()),
|
|
76
|
-
failedRequests: () => wrapAssertionWithPathAndCountMetric(_underlying.failedRequests()),
|
|
77
|
-
successfulRequests: () => wrapAssertionWithPathAndCountMetric(_underlying.successfulRequests()),
|
|
78
|
-
requestsPerSec: () => wrapAssertionWithPathAndTarget(_underlying.requestsPerSec())
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Step 3 of the Assertion DSL (path and time metric defined). Immutable, so all methods return a
|
|
83
|
-
* new occurrence and leave the original unmodified.
|
|
84
|
-
*/
|
|
85
|
-
export interface AssertionWithPathAndTimeMetric {
|
|
86
|
-
/**
|
|
87
|
-
* Specify the Assertion targets the min value metric
|
|
88
|
-
*
|
|
89
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
90
|
-
*/
|
|
91
|
-
min(): AssertionWithPathAndTarget;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Specify the Assertion targets the max value metric
|
|
95
|
-
*
|
|
96
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
97
|
-
*/
|
|
98
|
-
max(): AssertionWithPathAndTarget;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Specify the Assertion targets the mean value metric
|
|
102
|
-
*
|
|
103
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
104
|
-
*/
|
|
105
|
-
mean(): AssertionWithPathAndTarget;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Specify the Assertion targets the standard deviation metric
|
|
109
|
-
*
|
|
110
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
111
|
-
*/
|
|
112
|
-
stdDev(): AssertionWithPathAndTarget;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Specify the Assertion targets the percentile1 metric, as defined in gatling.conf
|
|
116
|
-
*
|
|
117
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
118
|
-
*/
|
|
119
|
-
percentile1(): AssertionWithPathAndTarget;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Specify the Assertion targets the percentile2 metric, as defined in gatling.conf
|
|
123
|
-
*
|
|
124
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
125
|
-
*/
|
|
126
|
-
percentile2(): AssertionWithPathAndTarget;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Specify the Assertion targets the percentile3 metric, as defined in gatling.conf
|
|
130
|
-
*
|
|
131
|
-
* @returns the next Assertion DSL step
|
|
132
|
-
*/
|
|
133
|
-
percentile3(): AssertionWithPathAndTarget;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Specify the Assertion targets the percentile4 metric, as defined in gatling.conf
|
|
137
|
-
*
|
|
138
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
139
|
-
*/
|
|
140
|
-
percentile4(): AssertionWithPathAndTarget;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Specify the Assertion targets the given percentile metric
|
|
144
|
-
*
|
|
145
|
-
* @param value - the value of targeted percentile, between 0 and 100)
|
|
146
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
147
|
-
*/
|
|
148
|
-
percentile(value: number): AssertionWithPathAndTarget;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const wrapAssertionWithPathAndTimeMetric = (
|
|
152
|
-
_underlying: JvmAssertionWithPathAndTimeMetric
|
|
153
|
-
): AssertionWithPathAndTimeMetric => ({
|
|
154
|
-
min: () => wrapAssertionWithPathAndTarget(_underlying.min()),
|
|
155
|
-
max: () => wrapAssertionWithPathAndTarget(_underlying.max()),
|
|
156
|
-
mean: () => wrapAssertionWithPathAndTarget(_underlying.mean()),
|
|
157
|
-
stdDev: () => wrapAssertionWithPathAndTarget(_underlying.stdDev()),
|
|
158
|
-
percentile1: () => wrapAssertionWithPathAndTarget(_underlying.percentile1()),
|
|
159
|
-
percentile2: () => wrapAssertionWithPathAndTarget(_underlying.percentile2()),
|
|
160
|
-
percentile3: () => wrapAssertionWithPathAndTarget(_underlying.percentile3()),
|
|
161
|
-
percentile4: () => wrapAssertionWithPathAndTarget(_underlying.percentile4()),
|
|
162
|
-
percentile: (value: number) => wrapAssertionWithPathAndTarget(_underlying.percentile(value))
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Step 3 of the Assertion DSL (path and count metric defined). Immutable, so all methods return a
|
|
167
|
-
* new occurrence and leave the original unmodified.
|
|
168
|
-
*/
|
|
169
|
-
export interface AssertionWithPathAndCountMetric {
|
|
170
|
-
/**
|
|
171
|
-
* Specify the Assertion targets the count metric
|
|
172
|
-
*
|
|
173
|
-
* @returns the next Assertion DSL step (condition in the next step must be specified with integer values only)
|
|
174
|
-
*/
|
|
175
|
-
count(): AssertionWithPathAndTarget;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Specify the Assertion targets the percentage of total executions metric
|
|
179
|
-
*
|
|
180
|
-
* @returns the next Assertion DSL step (condition in the next step can be specified with a floating point value)
|
|
181
|
-
*/
|
|
182
|
-
percent(): AssertionWithPathAndTarget;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const wrapAssertionWithPathAndCountMetric = (
|
|
186
|
-
_underlying: JvmAssertionWithPathAndCountMetric
|
|
187
|
-
): AssertionWithPathAndCountMetric => ({
|
|
188
|
-
count: () => wrapAssertionWithPathAndTarget(_underlying.count()),
|
|
189
|
-
percent: () => wrapAssertionWithPathAndTarget(_underlying.percent())
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Step 4 of the Assertion DSL (path and target defined). Immutable, so all methods return a new
|
|
194
|
-
* occurrence and leave the original unmodified.
|
|
195
|
-
*/
|
|
196
|
-
export interface AssertionWithPathAndTarget {
|
|
197
|
-
/**
|
|
198
|
-
* Specify the metric must be strictly less than the expected value
|
|
199
|
-
*
|
|
200
|
-
* @param value - the value
|
|
201
|
-
* @returns a complete Assertion
|
|
202
|
-
*/
|
|
203
|
-
lt(value: number): Assertion;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* Specify the metric must be less than or equal to the expected value
|
|
207
|
-
*
|
|
208
|
-
* @param value - the value
|
|
209
|
-
* @returns a complete Assertion
|
|
210
|
-
*/
|
|
211
|
-
lte(value: number): Assertion;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Specify the metric must be strictly greater than the expected value
|
|
215
|
-
*
|
|
216
|
-
* @param value - the value
|
|
217
|
-
* @returns a complete Assertion
|
|
218
|
-
*/
|
|
219
|
-
gt(value: number): Assertion;
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Specify the metric must be greater than or equal to the expected value
|
|
223
|
-
*
|
|
224
|
-
* @param value - the value
|
|
225
|
-
* @returns a complete Assertion
|
|
226
|
-
*/
|
|
227
|
-
gte(value: number): Assertion;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Specify the metric must be included in the given range
|
|
231
|
-
*
|
|
232
|
-
* @param min - the min, included
|
|
233
|
-
* @param max - the max, included
|
|
234
|
-
* @param inclusive - if bounds must be included in the range
|
|
235
|
-
* @returns a complete Assertion
|
|
236
|
-
*/
|
|
237
|
-
between(min: number, max: number, inclusive?: boolean): Assertion;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Specify the metric must be included in a range defined around a mean value with a half range
|
|
241
|
-
* expressed as an absolute value
|
|
242
|
-
*
|
|
243
|
-
* @param mean - the mean of the range
|
|
244
|
-
* @param plusOrMinus - the range half width
|
|
245
|
-
* @param inclusive - if bounds must be included in the range
|
|
246
|
-
* @returns a complete Assertion
|
|
247
|
-
*/
|
|
248
|
-
around(mean: number, plusOrMinus: number, inclusive?: boolean): Assertion;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Specify the metric must be included in a range defined around a mean value with a half range
|
|
252
|
-
* expressed as an percentage of the mean value
|
|
253
|
-
*
|
|
254
|
-
* @param mean - the mean of the range
|
|
255
|
-
* @param percentDeviation - the range half width expressed as a percent of the mean
|
|
256
|
-
* @param inclusive - if bounds must be included in the range
|
|
257
|
-
* @returns a complete Assertion
|
|
258
|
-
*/
|
|
259
|
-
deviatesAround(mean: number, percentDeviation: number, inclusive?: boolean): Assertion;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Specify the metric must be equal to an expected value
|
|
263
|
-
*
|
|
264
|
-
* @param value - the expected value
|
|
265
|
-
* @returns a complete Assertion
|
|
266
|
-
*/
|
|
267
|
-
is(value: number): Assertion;
|
|
268
|
-
|
|
269
|
-
/**
|
|
270
|
-
* Specify the metric must be included in a set of values
|
|
271
|
-
*
|
|
272
|
-
* @param values - the expected values
|
|
273
|
-
* @returns a complete Assertion
|
|
274
|
-
*/
|
|
275
|
-
in(...values: number[]): Assertion;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
const wrapAssertionWithPathAndTarget = (
|
|
279
|
-
_underlying: JvmAssertionWithPathAndTarget<unknown>
|
|
280
|
-
): AssertionWithPathAndTarget => ({
|
|
281
|
-
lt: (value) => wrapAssertion(_underlying.lt(value)),
|
|
282
|
-
lte: (value) => wrapAssertion(_underlying.lte(value)),
|
|
283
|
-
gt: (value) => wrapAssertion(_underlying.gt(value)),
|
|
284
|
-
gte: (value) => wrapAssertion(_underlying.gte(value)),
|
|
285
|
-
between: (min, max, inclusive) =>
|
|
286
|
-
wrapAssertion(inclusive !== undefined ? _underlying.between(min, max, inclusive) : _underlying.between(min, max)),
|
|
287
|
-
around: (mean, plusOrMinus, inclusive) =>
|
|
288
|
-
wrapAssertion(
|
|
289
|
-
inclusive !== undefined ? _underlying.around(mean, plusOrMinus, inclusive) : _underlying.around(mean, plusOrMinus)
|
|
290
|
-
),
|
|
291
|
-
deviatesAround: (mean, percentDeviation, inclusive) =>
|
|
292
|
-
wrapAssertion(
|
|
293
|
-
inclusive !== undefined
|
|
294
|
-
? _underlying.deviatesAround(mean, percentDeviation, inclusive)
|
|
295
|
-
: _underlying.deviatesAround(mean, percentDeviation)
|
|
296
|
-
),
|
|
297
|
-
is: (value) => wrapAssertion(_underlying.is(value)),
|
|
298
|
-
in: (...values) => wrapAssertion(_underlying.in(values))
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
export interface Assertion extends Wrapper<JvmAssertion> {}
|
|
302
|
-
|
|
303
|
-
const wrapAssertion = (_underlying: JvmAssertion): Assertion => ({
|
|
304
|
-
_underlying
|
|
305
|
-
});
|
package/src/body.ts
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { CoreDsl as JvmCoreDsl } from "@gatling.io/jvm-types";
|
|
2
|
-
|
|
3
|
-
import { Wrapper } from "./common";
|
|
4
|
-
import { asByteArrayFunction } from "./gatlingJvm/byteArrays";
|
|
5
|
-
import { Expression, Session, underlyingSessionTo } from "./session";
|
|
6
|
-
|
|
7
|
-
import JvmBody = io.gatling.javaapi.core.Body;
|
|
8
|
-
import JvmBodyWithBytes = io.gatling.javaapi.core.Body$WithBytes;
|
|
9
|
-
import JvmBodyWithString = io.gatling.javaapi.core.Body$WithString;
|
|
10
|
-
|
|
11
|
-
export interface Body extends Wrapper<JvmBody> {}
|
|
12
|
-
|
|
13
|
-
export namespace Body {
|
|
14
|
-
export interface WithBytes extends Body {
|
|
15
|
-
(session: Session): number[];
|
|
16
|
-
}
|
|
17
|
-
export interface WithString extends Body {
|
|
18
|
-
(session: Session): string;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const wrapBodyWithBytes = (_underlying: JvmBodyWithBytes): Body.WithBytes =>
|
|
23
|
-
Object.assign((session: Session): number[] => _underlying.apply(session._underlying), { _underlying });
|
|
24
|
-
|
|
25
|
-
const wrapBodyWithString = (_underlying: JvmBodyWithString): Body.WithString =>
|
|
26
|
-
Object.assign((session: Session): string => _underlying.apply(session._underlying), { _underlying });
|
|
27
|
-
|
|
28
|
-
// TODO gzipBody
|
|
29
|
-
|
|
30
|
-
export interface StringBodyFunction {
|
|
31
|
-
/**
|
|
32
|
-
* Create a body from a String.
|
|
33
|
-
*
|
|
34
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
35
|
-
*
|
|
36
|
-
* @param string - the body expressed as a gatling Expression Language String
|
|
37
|
-
* @returns a body
|
|
38
|
-
*/
|
|
39
|
-
(string: string): Body.WithString;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Create a body from a String.
|
|
43
|
-
*
|
|
44
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
45
|
-
*
|
|
46
|
-
* @param f - the body expressed as a function
|
|
47
|
-
* @returns a body
|
|
48
|
-
*/
|
|
49
|
-
(f: (session: Session) => string): Body.WithString;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const StringBody: StringBodyFunction = (string: Expression<string>): Body.WithString =>
|
|
53
|
-
wrapBodyWithString(
|
|
54
|
-
typeof string === "function" ? JvmCoreDsl.StringBody(underlyingSessionTo(string)) : JvmCoreDsl.StringBody(string)
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
export interface RawFileBodyFunction {
|
|
58
|
-
/**
|
|
59
|
-
* Create a body from a file. Bytes will be sent without any transformation.
|
|
60
|
-
*
|
|
61
|
-
* <p>Can also be used as a Function<Session, byte[]> to define the expected value in a check.
|
|
62
|
-
*
|
|
63
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
64
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
65
|
-
* @returns a body
|
|
66
|
-
*/
|
|
67
|
-
(filePath: string): Body.WithBytes;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Create a body from a file. Bytes will be sent without any transformation.
|
|
71
|
-
*
|
|
72
|
-
* <p>Can also be used as a Function<Session, byte[]> to define the expected value in a check.
|
|
73
|
-
*
|
|
74
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
75
|
-
* absolute, expressed as a function
|
|
76
|
-
* @returns a body
|
|
77
|
-
*/
|
|
78
|
-
(filePath: (session: Session) => string): Body.WithBytes;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const RawFileBody: RawFileBodyFunction = (filePath: Expression<string>): Body.WithBytes =>
|
|
82
|
-
wrapBodyWithBytes(
|
|
83
|
-
typeof filePath === "function"
|
|
84
|
-
? JvmCoreDsl.RawFileBody(underlyingSessionTo(filePath))
|
|
85
|
-
: JvmCoreDsl.RawFileBody(filePath)
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
export interface ElFileBodyFunction {
|
|
89
|
-
/**
|
|
90
|
-
* Create a body from a file. File text content will be processed as a Gatling Expression Language
|
|
91
|
-
* String.
|
|
92
|
-
*
|
|
93
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
94
|
-
*
|
|
95
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
96
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
97
|
-
* @returns a body
|
|
98
|
-
*/
|
|
99
|
-
(filePath: string): Body.WithString;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Create a body from a file. File text content will be processed as a Gatling Expression Language
|
|
103
|
-
* String.
|
|
104
|
-
*
|
|
105
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
106
|
-
*
|
|
107
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
108
|
-
* absolute, expressed as a function
|
|
109
|
-
* @returns a body
|
|
110
|
-
*/
|
|
111
|
-
(filePath: (session: Session) => string): Body.WithString;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export const ElFileBody: ElFileBodyFunction = (filePath: Expression<string>): Body.WithString =>
|
|
115
|
-
wrapBodyWithString(
|
|
116
|
-
typeof filePath === "function"
|
|
117
|
-
? JvmCoreDsl.ElFileBody(underlyingSessionTo(filePath))
|
|
118
|
-
: JvmCoreDsl.ElFileBody(filePath)
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
export interface PebbleStringBodyFunction {
|
|
122
|
-
/**
|
|
123
|
-
* Create a body from String processed as a <a href="https://pebbletemplates.io/">Pebble
|
|
124
|
-
* template</a>.
|
|
125
|
-
*
|
|
126
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
127
|
-
*
|
|
128
|
-
* @param string - the Pebble string
|
|
129
|
-
* @returns a body
|
|
130
|
-
*/
|
|
131
|
-
(string: string): Body.WithString;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export const PebbleStringBody: PebbleStringBodyFunction = (string: string): Body.WithString =>
|
|
135
|
-
wrapBodyWithString(JvmCoreDsl.PebbleStringBody(string));
|
|
136
|
-
|
|
137
|
-
export interface PebbleFileBodyFunction {
|
|
138
|
-
/**
|
|
139
|
-
* Create a body from a file. File text content will be processed as a <a
|
|
140
|
-
* href="https://pebbletemplates.io/">Pebble template</a>.
|
|
141
|
-
*
|
|
142
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
143
|
-
*
|
|
144
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
145
|
-
* absolute, expressed as a Gatling Expression Language String
|
|
146
|
-
* @returns a body
|
|
147
|
-
*/
|
|
148
|
-
(filePath: string): Body.WithString;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Create a body from a file. File text content will be processed as a <a
|
|
152
|
-
* href="https://pebbletemplates.io/">Pebble template</a>.
|
|
153
|
-
*
|
|
154
|
-
* <p>Can also be used as a Function<Session, String> to define the expected value in a check.
|
|
155
|
-
*
|
|
156
|
-
* @param filePath - the path of the file, either relative to the root of the classpath, or
|
|
157
|
-
* absolute, expressed as a function
|
|
158
|
-
* @returns a body
|
|
159
|
-
*/
|
|
160
|
-
(filePath: (session: Session) => string): Body.WithString;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export const PebbleFileBody: PebbleFileBodyFunction = (filePath: Expression<string>): Body.WithString =>
|
|
164
|
-
wrapBodyWithString(
|
|
165
|
-
typeof filePath === "function"
|
|
166
|
-
? JvmCoreDsl.PebbleFileBody(underlyingSessionTo(filePath))
|
|
167
|
-
: JvmCoreDsl.PebbleFileBody(filePath)
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
export interface ByteArrayBodyFunction {
|
|
171
|
-
/**
|
|
172
|
-
* Create a body from a byte array. Bytes will be sent as is.
|
|
173
|
-
*
|
|
174
|
-
* <p>Can also be used as a Function<Session, byte[]> to define the expected value in a check.
|
|
175
|
-
*
|
|
176
|
-
* @param bytes - the bytes, expressed as a Gatling Expression Language String
|
|
177
|
-
* @returns a body
|
|
178
|
-
*/
|
|
179
|
-
(bytes: string): Body.WithBytes;
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Create a body from a byte array. Bytes will be sent as is.
|
|
183
|
-
*
|
|
184
|
-
* <p>Can also be used as a Function<Session, byte[]> to define the expected value in a check.
|
|
185
|
-
*
|
|
186
|
-
* @param bytes - the bytes
|
|
187
|
-
* @returns a body
|
|
188
|
-
*/
|
|
189
|
-
(bytes: number[]): Body.WithBytes;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Create a body from a byte array. Bytes will be sent as is.
|
|
193
|
-
*
|
|
194
|
-
* <p>Can also be used as a Function<Session, byte[]> to define the expected value in a check.
|
|
195
|
-
*
|
|
196
|
-
* @param bytes - the bytes, expressed as a function
|
|
197
|
-
* @returns a body
|
|
198
|
-
*/
|
|
199
|
-
(bytes: (session: Session) => number[]): Body.WithBytes;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export const ByteArrayBody: ByteArrayBodyFunction = (bytes: string | Expression<number[]>): Body.WithBytes =>
|
|
203
|
-
wrapBodyWithBytes(
|
|
204
|
-
typeof bytes === "function"
|
|
205
|
-
? JvmCoreDsl.ByteArrayBody(asByteArrayFunction(underlyingSessionTo(bytes)))
|
|
206
|
-
: typeof bytes === "string"
|
|
207
|
-
? JvmCoreDsl.ByteArrayBody(bytes)
|
|
208
|
-
: JvmCoreDsl.ByteArrayBody(bytes)
|
|
209
|
-
);
|
|
210
|
-
|
|
211
|
-
// TODO registerPebbleExtensions
|
package/src/checks/builder.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Wrapper } from "../common";
|
|
2
|
-
|
|
3
|
-
import JvmCheckBuilder = io.gatling.javaapi.core.CheckBuilder;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Java wrapper of a Scala CheckBuilder. Builder of an Action in a Gatling scenario.
|
|
7
|
-
*
|
|
8
|
-
* <p>Immutable, so all methods return a new occurrence and leave the original unmodified.
|
|
9
|
-
*/
|
|
10
|
-
export interface CheckBuilder extends Wrapper<JvmCheckBuilder> {}
|
|
11
|
-
|
|
12
|
-
export const wrapCheckBuilder = (_underlying: JvmCheckBuilder): CheckBuilder => ({
|
|
13
|
-
_underlying
|
|
14
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CheckBuilderMultipleFind, wrapCheckBuilderMultipleFind } from "./multipleFind";
|
|
2
|
-
|
|
3
|
-
import JvmCheckBuilderCaptureGroup = io.gatling.javaapi.core.CheckBuilder$CaptureGroupCheckBuilder;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A special {@link CheckBuilderMultipleFind<string>} that can define regex capture groups
|
|
7
|
-
*/
|
|
8
|
-
export interface CheckBuilderCaptureGroup extends CheckBuilderMultipleFind<string> {
|
|
9
|
-
/**
|
|
10
|
-
* Define that the check extracts an expected number of values from capture groups
|
|
11
|
-
*
|
|
12
|
-
* @param count - the number of capture groups in the regular expression pattern
|
|
13
|
-
* @returns a new MultipleFind
|
|
14
|
-
*/
|
|
15
|
-
captureGroups(count: number): CheckBuilderMultipleFind<string[]>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const wrapCheckBuilderCaptureGroup = (_underlying: JvmCheckBuilderCaptureGroup): CheckBuilderCaptureGroup => ({
|
|
19
|
-
...wrapCheckBuilderMultipleFind<string>(_underlying),
|
|
20
|
-
captureGroups: (count: number): CheckBuilderMultipleFind<string[]> =>
|
|
21
|
-
wrapCheckBuilderMultipleFind(_underlying.captureGroups(count))
|
|
22
|
-
});
|
package/src/checks/condition.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CheckBuilder } from "../checks";
|
|
2
|
-
|
|
3
|
-
import JvmCheckBuilder = io.gatling.javaapi.core.CheckBuilder;
|
|
4
|
-
|
|
5
|
-
interface JvmCondition<T> {
|
|
6
|
-
equals(arg0: any /*java.lang.Object*/): boolean;
|
|
7
|
-
then(...arg0: JvmCheckBuilder[]): T;
|
|
8
|
-
then(arg0: java.util.List<JvmCheckBuilder>): T;
|
|
9
|
-
toString(): string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Condition<T> {
|
|
13
|
-
/**
|
|
14
|
-
* Define the checks to apply when the condition holds true.
|
|
15
|
-
*
|
|
16
|
-
* @param thenChecks - the checks
|
|
17
|
-
* @returns a new HttpProtocolBuilder instance
|
|
18
|
-
*/
|
|
19
|
-
then(...thenChecks: CheckBuilder[]): T;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const wrapCondition = <J, T>(jvmCondition: JvmCondition<J>, wrap: (underlying: J) => T): Condition<T> => ({
|
|
23
|
-
then: (...thenChecks: CheckBuilder[]): T => wrap(jvmCondition.then(thenChecks.map((c) => c._underlying)))
|
|
24
|
-
});
|
package/src/checks/final.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { CheckBuilder, wrapCheckBuilder } from "./builder";
|
|
2
|
-
|
|
3
|
-
import JvmCheckBuilderFinal = io.gatling.javaapi.core.CheckBuilder$Final;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Last step of the Check DSL Immutable, so all methods return a new occurrence and leave the
|
|
7
|
-
* original unmodified.
|
|
8
|
-
*/
|
|
9
|
-
export interface CheckBuilderFinal extends CheckBuilder {
|
|
10
|
-
/**
|
|
11
|
-
* Provide a custom name for the check, to be used in case of a failure
|
|
12
|
-
*
|
|
13
|
-
* @param n - the name
|
|
14
|
-
* @returns a new CheckBuilderFinal
|
|
15
|
-
*/
|
|
16
|
-
name(n: string): CheckBuilderFinal;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Save the extracted value in the virtual user's Session
|
|
20
|
-
*
|
|
21
|
-
* @param key - the key to store the extracted value in the Session
|
|
22
|
-
* @returns a new CheckBuilderFinal
|
|
23
|
-
*/
|
|
24
|
-
saveAs(key: string): CheckBuilderFinal;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const wrapCheckBuilderFinal = (_underlying: JvmCheckBuilderFinal): CheckBuilderFinal => ({
|
|
28
|
-
...wrapCheckBuilder(_underlying),
|
|
29
|
-
name: (n: string) => wrapCheckBuilderFinal(_underlying.name(n)),
|
|
30
|
-
saveAs: (key: string) => wrapCheckBuilderFinal(_underlying.saveAs(key))
|
|
31
|
-
});
|
package/src/checks/find.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CheckBuilderValidate, wrapCheckBuilderValidate } from "./validate";
|
|
2
|
-
|
|
3
|
-
import JvmCheckBuilderFind = io.gatling.javaapi.core.CheckBuilder$Find;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Step 1 of the Check DSL when the check can only return one single value Immutable, so all
|
|
7
|
-
* methods return a new occurrence and leave the original unmodified.
|
|
8
|
-
*
|
|
9
|
-
* @typeParam X - the type of Java values the check can extract
|
|
10
|
-
*/
|
|
11
|
-
export interface CheckBuilderFind<X> extends CheckBuilderValidate<X> {
|
|
12
|
-
/**
|
|
13
|
-
* Target a single/first value
|
|
14
|
-
*
|
|
15
|
-
* @returns the next Check DSL step
|
|
16
|
-
*/
|
|
17
|
-
find(): CheckBuilderValidate<X>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const wrapCheckBuilderFind = <X>(_underlying: JvmCheckBuilderFind<X>): CheckBuilderFind<X> => ({
|
|
21
|
-
...wrapCheckBuilderValidate<X>(_underlying),
|
|
22
|
-
find: () => wrapCheckBuilderValidate(_underlying.find())
|
|
23
|
-
});
|