/** * 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: '🎛️' }, };