chen.lin
23 小时以前 9f724c61dfa4dc4c0eea66253ea0780b023622ae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
/**
 * RCS测试组件类型定义
 * 完整实现测试计划的所有核心功能
 */
 
// ==================== 测试计划 ====================
export const TEST_PLAN = 'test_plan';
 
// ==================== 线程组 ====================
export const THREAD_GROUP = 'thread_group';
export const SETUP_THREAD_GROUP = 'setup_thread_group';
export const TEARDOWN_THREAD_GROUP = 'teardown_thread_group';
 
// ==================== 采样器 (Sampler) ====================
export const HTTP_REQUEST = 'http_request';
export const HTTP_REQUEST_DEFAULT = 'http_request_default';
export const JDBC_REQUEST = 'jdbc_request';
export const FTP_REQUEST = 'ftp_request';
export const SOAP_REQUEST = 'soap_request';
export const TCP_REQUEST = 'tcp_request';
export const LDAP_REQUEST = 'ldap_request';
export const SMTP_REQUEST = 'smtp_request';
export const PALLETIZE_TASK = 'palletize_task'; // RCS特定 - 组托
export const INBOUND_TASK = 'inbound_task'; // RCS特定 - 入库
export const OUTBOUND_TASK = 'outbound_task'; // RCS特定 - 出库
 
// ==================== 监听器 (Listener) ====================
export const VIEW_RESULTS_TREE = 'view_results_tree';
export const SUMMARY_REPORT = 'summary_report';
export const AGGREGATE_REPORT = 'aggregate_report';
export const GRAPH_RESULTS = 'graph_results';
export const RESPONSE_TIME_GRAPH = 'response_time_graph';
export const RESULT_STATUS_ACTION_HANDLER = 'result_status_action_handler';
export const SAVE_RESPONSES_TO_A_FILE = 'save_responses_to_a_file';
export const SIMPLE_DATA_WRITER = 'simple_data_writer';
export const BACKEND_LISTENER = 'backend_listener';
 
// ==================== 断言 (Assertion) ====================
export const RESPONSE_ASSERTION = 'response_assertion';
export const JSON_ASSERTION = 'json_assertion';
export const XPATH_ASSERTION = 'xpath_assertion';
export const BEANSHELL_ASSERTION = 'beanshell_assertion';
export const DURATION_ASSERTION = 'duration_assertion';
export const SIZE_ASSERTION = 'size_assertion';
export const HTML_ASSERTION = 'html_assertion';
export const XML_ASSERTION = 'xml_assertion';
 
// ==================== 配置元件 (Config Element) ====================
export const HTTP_REQUEST_DEFAULT_CONFIG = 'http_request_default_config';
export const HTTP_COOKIE_MANAGER = 'http_cookie_manager';
export const HTTP_HEADER_MANAGER = 'http_header_manager';
export const HTTP_CACHE_MANAGER = 'http_cache_manager';
export const USER_DEFINED_VARIABLES = 'user_defined_variables';
export const CSV_DATA_SET_CONFIG = 'csv_data_set_config';
export const COUNTER_CONFIG = 'counter_config';
export const RANDOM_VARIABLE = 'random_variable';
export const JDBC_CONNECTION_CONFIGURATION = 'jdbc_connection_configuration';
 
// ==================== 前置处理器 (Pre Processor) ====================
export const USER_PARAMETERS = 'user_parameters';
export const BEANSHELL_PRE_PROCESSOR = 'beanshell_pre_processor';
export const JSR223_PRE_PROCESSOR = 'jsr223_pre_processor';
export const HTTP_URL_REWRITING_MODIFIER = 'http_url_rewriting_modifier';
export const HTML_LINK_PARSER = 'html_link_parser';
export const REGEX_USER_PARAMETERS = 'regex_user_parameters';
 
// ==================== 后置处理器 (Post Processor) ====================
export const REGULAR_EXPRESSION_EXTRACTOR = 'regular_expression_extractor';
export const JSON_EXTRACTOR = 'json_extractor';
export const XPATH_EXTRACTOR = 'xpath_extractor';
export const CSS_SELECTOR_EXTRACTOR = 'css_selector_extractor';
export const BEANSHELL_POST_PROCESSOR = 'beanshell_post_processor';
export const JSR223_POST_PROCESSOR = 'jsr223_post_processor';
export const RESULT_STATUS_ACTION_HANDLER_POST = 'result_status_action_handler_post';
 
// ==================== 定时器 (Timer) ====================
export const CONSTANT_TIMER = 'constant_timer';
export const GAUSSIAN_RANDOM_TIMER = 'gaussian_random_timer';
export const UNIFORM_RANDOM_TIMER = 'uniform_random_timer';
export const SYNCHRONIZING_TIMER = 'synchronizing_timer';
export const CONSTANT_THROUGHPUT_TIMER = 'constant_throughput_timer';
export const BEAST_THREADS_TIMER = 'beast_threads_timer';
export const POISSON_RANDOM_TIMER = 'poisson_random_timer';
 
// ==================== 逻辑控制器 (Logic Controller) ====================
export const SIMPLE_CONTROLLER = 'simple_controller';
export const LOOP_CONTROLLER = 'loop_controller';
export const ONCE_ONLY_CONTROLLER = 'once_only_controller';
export const IF_CONTROLLER = 'if_controller';
export const WHILE_CONTROLLER = 'while_controller';
export const SWITCH_CONTROLLER = 'switch_controller';
export const FOR_EACH_CONTROLLER = 'for_each_controller';
export const RANDOM_CONTROLLER = 'random_controller';
export const RANDOM_ORDER_CONTROLLER = 'random_order_controller';
export const TRANSACTION_CONTROLLER = 'transaction_controller';
export const MODULE_CONTROLLER = 'module_controller';
export const INCLUDE_CONTROLLER = 'include_controller';
export const EXCLUDE_CONTROLLER = 'exclude_controller';
export const RECORDING_CONTROLLER = 'recording_controller';
 
// ==================== 组件配置 ====================
export const COMPONENT_CONFIGS = {
    // 线程组
    [THREAD_GROUP]: {
        label: '线程组',
        icon: '👥',
        category: 'thread_group',
        defaultConfig: {
            numThreads: 1,
            rampUp: 1,
            loops: 1,
            sameUserOnNextIteration: true,
            scheduler: false,
            duration: 60,
            delay: 0,
        },
    },
    [SETUP_THREAD_GROUP]: {
        label: 'setUp线程组',
        icon: '⬆️',
        category: 'thread_group',
        defaultConfig: {
            numThreads: 1,
            rampUp: 1,
            loops: 1,
        },
    },
    [TEARDOWN_THREAD_GROUP]: {
        label: 'tearDown线程组',
        icon: '⬇️',
        category: 'thread_group',
        defaultConfig: {
            numThreads: 1,
            rampUp: 1,
            loops: 1,
        },
    },
    
    // HTTP请求
    [HTTP_REQUEST]: {
        label: 'HTTP请求',
        icon: '🌐',
        category: 'sampler',
        defaultConfig: {
            method: 'GET',
            protocol: 'http',
            serverName: '',
            portNumber: '',
            path: '',
            contentEncoding: 'UTF-8',
            followRedirects: true,
            autoRedirects: false,
            useKeepAlive: true,
            doMultipartPost: false,
            browserCompatibleMultipart: false,
            parameters: [],
            body: '',
            files: [],
            headers: [],
        },
    },
    [HTTP_REQUEST_DEFAULT]: {
        label: 'HTTP请求默认值',
        icon: '🌐',
        category: 'config',
        defaultConfig: {
            protocol: 'http',
            serverName: '',
            portNumber: '',
            path: '',
        },
    },
    
    // 监听器
    [VIEW_RESULTS_TREE]: {
        label: '查看结果树',
        icon: '🌳',
        category: 'listener',
        defaultConfig: {
            filename: '',
            logErrors: true,
            logSuccess: true,
            showOnlyLogErrors: false,
        },
    },
    [SUMMARY_REPORT]: {
        label: '汇总报告',
        icon: '📊',
        category: 'listener',
        defaultConfig: {
            filename: '',
            includeResponseTime: true,
            includeLatency: true,
            includeConnectTime: true,
        },
    },
    [AGGREGATE_REPORT]: {
        label: '聚合报告',
        icon: '📈',
        category: 'listener',
        defaultConfig: {
            filename: '',
            includeResponseTime: true,
            includeLatency: true,
            includeConnectTime: true,
        },
    },
    [GRAPH_RESULTS]: {
        label: '图形结果',
        icon: '📉',
        category: 'listener',
        defaultConfig: {
            filename: '',
            graphType: 'line',
        },
    },
    
    // 断言
    [RESPONSE_ASSERTION]: {
        label: '响应断言',
        icon: '✓',
        category: 'assertion',
        defaultConfig: {
            testField: 'response_code',
            testType: 'equals',
            testString: '200',
            not: false,
            or: false,
        },
    },
    [JSON_ASSERTION]: {
        label: 'JSON断言',
        icon: '📋',
        category: 'assertion',
        defaultConfig: {
            jsonPath: '',
            expectedValue: '',
            validateJsonPath: true,
            expectNull: false,
            invert: false,
        },
    },
    [DURATION_ASSERTION]: {
        label: '持续时间断言',
        icon: '⏱️',
        category: 'assertion',
        defaultConfig: {
            duration: 2000,
        },
    },
    
    // 配置元件
    [USER_DEFINED_VARIABLES]: {
        label: '用户定义的变量',
        icon: '📝',
        category: 'config',
        defaultConfig: {
            variables: [],
        },
    },
    [CSV_DATA_SET_CONFIG]: {
        label: 'CSV数据集配置',
        icon: '📄',
        category: 'config',
        defaultConfig: {
            filename: '',
            fileEncoding: 'UTF-8',
            variableNames: '',
            delimiter: ',',
            allowQuotedData: false,
            recycle: true,
            stopThread: false,
            sharingMode: 'All threads',
        },
    },
    [COUNTER_CONFIG]: {
        label: '计数器',
        icon: '🔢',
        category: 'config',
        defaultConfig: {
            start: 1,
            end: 100,
            increment: 1,
            format: '',
            perUser: false,
        },
    },
    [RANDOM_VARIABLE]: {
        label: '随机变量',
        icon: '🎲',
        category: 'config',
        defaultConfig: {
            variableName: '',
            outputFormat: '',
            minimumValue: 0,
            maximumValue: 100,
            randomSeed: '',
        },
    },
    
    // 前置处理器
    [USER_PARAMETERS]: {
        label: '用户参数',
        icon: '👤',
        category: 'pre_processor',
        defaultConfig: {
            parameters: [],
            updateOncePerIteration: false,
        },
    },
    
    // 后置处理器
    [REGULAR_EXPRESSION_EXTRACTOR]: {
        label: '正则表达式提取器',
        icon: '🔍',
        category: 'post_processor',
        defaultConfig: {
            variableName: '',
            regex: '',
            template: '$1$',
            matchNumber: 1,
            defaultValue: '',
            useField: 'body',
        },
    },
    [JSON_EXTRACTOR]: {
        label: 'JSON提取器',
        icon: '📋',
        category: 'post_processor',
        defaultConfig: {
            variableName: '',
            jsonPath: '',
            matchNumber: 1,
            defaultValue: '',
            computeConcatenation: false,
        },
    },
    
    // 定时器
    [CONSTANT_TIMER]: {
        label: '固定定时器',
        icon: '⏱️',
        category: 'timer',
        defaultConfig: {
            delay: 1000,
        },
    },
    [GAUSSIAN_RANDOM_TIMER]: {
        label: '高斯随机定时器',
        icon: '📊',
        category: 'timer',
        defaultConfig: {
            delay: 0,
            range: 100,
        },
    },
    [UNIFORM_RANDOM_TIMER]: {
        label: '统一随机定时器',
        icon: '🎲',
        category: 'timer',
        defaultConfig: {
            delay: 0,
            range: 100,
        },
    },
    [SYNCHRONIZING_TIMER]: {
        label: '同步定时器',
        icon: '🔗',
        category: 'timer',
        defaultConfig: {
            numThreads: 0,
            timeout: 0,
        },
    },
    [CONSTANT_THROUGHPUT_TIMER]: {
        label: '常数吞吐量定时器',
        icon: '📈',
        category: 'timer',
        defaultConfig: {
            throughput: 60,
            calculateThroughputBasedOn: 'this thread only',
        },
    },
    
    // 逻辑控制器
    [SIMPLE_CONTROLLER]: {
        label: '简单控制器',
        icon: '📦',
        category: 'logic_controller',
        defaultConfig: {},
    },
    [LOOP_CONTROLLER]: {
        label: '循环控制器',
        icon: '🔄',
        category: 'logic_controller',
        defaultConfig: {
            loops: 1,
            continueForever: false,
        },
    },
    [IF_CONTROLLER]: {
        label: '如果(If)控制器',
        icon: '❓',
        category: 'logic_controller',
        defaultConfig: {
            condition: '',
            evaluateAll: false,
            useExpression: true,
        },
    },
    [WHILE_CONTROLLER]: {
        label: 'While控制器',
        icon: '🔁',
        category: 'logic_controller',
        defaultConfig: {
            condition: '',
        },
    },
    [FOR_EACH_CONTROLLER]: {
        label: 'ForEach控制器',
        icon: '🔂',
        category: 'logic_controller',
        defaultConfig: {
            inputVariable: '',
            outputVariable: '',
            startIndex: '',
            endIndex: '',
            addSeparator: false,
        },
    },
    [RANDOM_CONTROLLER]: {
        label: '随机控制器',
        icon: '🎲',
        category: 'logic_controller',
        defaultConfig: {},
    },
    [RANDOM_ORDER_CONTROLLER]: {
        label: '随机顺序控制器',
        icon: '🔀',
        category: 'logic_controller',
        defaultConfig: {},
    },
    [TRANSACTION_CONTROLLER]: {
        label: '事务控制器',
        icon: '📦',
        category: 'logic_controller',
        defaultConfig: {
            generateParentSample: false,
            includeTimers: true,
        },
    },
    
    // RCS特定
    [PALLETIZE_TASK]: {
        label: '组托任务',
        icon: '📦',
        category: 'sampler',
        defaultConfig: {
            matnrCodes: [],
            barcode: '',
            randomMaterialCount: 1,
            receiptQty: 10,
        },
    },
    [INBOUND_TASK]: {
        label: '入库任务',
        icon: '📥',
        category: 'sampler',
        defaultConfig: {
            apiType: 'create_in_task',
            barcode: '',
            staNo: '',
            type: 1,
            inboundLocNos: [],
        },
    },
    [OUTBOUND_TASK]: {
        label: '出库任务',
        icon: '📤',
        category: 'sampler',
        defaultConfig: {
            staNo: '',
            checkStock: true,
            outboundLocNos: [],
        },
    },
};
 
// 组件分类
export const COMPONENT_CATEGORIES = {
    thread_group: { label: '线程组', icon: '👥' },
    sampler: { label: '采样器', icon: '📡' },
    listener: { label: '监听器', icon: '👂' },
    assertion: { label: '断言', icon: '✓' },
    config: { label: '配置元件', icon: '⚙️' },
    pre_processor: { label: '前置处理器', icon: '⬆️' },
    post_processor: { label: '后置处理器', icon: '⬇️' },
    timer: { label: '定时器', icon: '⏱️' },
    logic_controller: { label: '逻辑控制器', icon: '🎛️' },
};