diff options
Diffstat (limited to 'lib/doorman/src/test/resources')
-rw-r--r-- | lib/doorman/src/test/resources/it/tc1/result.json | 31 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc1/test.json | 67 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/request_entity1.txt | 4 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/request_entity2.txt | 4 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/request_other.txt | 4 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/response.txt | 3 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/result.json | 94 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/result2.json | 76 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/it/tc2/test.json | 202 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/schema.sql | 58 | ||||
-rw-r--r-- | lib/doorman/src/test/resources/test1.json | 36 |
11 files changed, 579 insertions, 0 deletions
diff --git a/lib/doorman/src/test/resources/it/tc1/result.json b/lib/doorman/src/test/resources/it/tc1/result.json new file mode 100644 index 000000000..3b048827c --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc1/result.json @@ -0,0 +1,31 @@ +{ + "queue_list": [ + { + "queue_type": "QQ", + "queue_id": "ALL", + "check_sequence_list": [ + [ + "STATUS | req-1 | ARRIVED", + "ACTION | req-1 | PROCESS", + "STATUS | req-1 | PROCESSING_SYNC", + "STATUS | req-2 | ARRIVED", + "ACTION | req-2 | HOLD | 60", + "STATUS | req-2 | IN_QUEUE", + "STATUS | req-3 | ARRIVED", + "ACTION | req-3 | HOLD | 60", + "STATUS | req-3 | IN_QUEUE", + "ACTION | req-1 | RETURN_COMPLETE | PROCESSED", + "ACTION | req-2 | PROCESS", + "STATUS | req-1 | COMPLETED", + "STATUS | req-2 | PROCESSING_SYNC", + "ACTION | req-2 | RETURN_COMPLETE | PROCESSED", + "ACTION | req-3 | PROCESS", + "STATUS | req-2 | COMPLETED", + "STATUS | req-3 | PROCESSING_SYNC", + "ACTION | req-3 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-3 | COMPLETED" + ] + ] + } + ] +} diff --git a/lib/doorman/src/test/resources/it/tc1/test.json b/lib/doorman/src/test/resources/it/tc1/test.json new file mode 100644 index 000000000..0d96ce8dd --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc1/test.json @@ -0,0 +1,67 @@ +{ + "handler_list": [ + { + "queue_type": "QQ", + "handler_class": "Handler" + } + ], + "request_list": [ + { + "request_param": { + "request_id": "req-1", + "queue_type": "QQ", + "queue_id": "ALL", + "http_method": "POST" + }, + "request_body": { + "siid": "test-siid-1" + }, + "response_param": { + "http_code": 200 + }, + "response_body": { + "status": "success" + }, + "start_time": 100, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-2", + "queue_type": "QQ", + "queue_id": "ALL", + "http_method": "POST" + }, + "request_body": { + "siid": "test-siid-2" + }, + "response_param": { + "http_code": 200 + }, + "response_body": { + "status": "success" + }, + "start_time": 500, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-3", + "queue_type": "QQ", + "queue_id": "ALL", + "http_method": "POST" + }, + "request_body": { + "siid": "test-siid-3" + }, + "response_param": { + "http_code": 200 + }, + "response_body": { + "status": "success" + }, + "start_time": 900, + "process_time": 5000 + } + ] +} diff --git a/lib/doorman/src/test/resources/it/tc2/request_entity1.txt b/lib/doorman/src/test/resources/it/tc2/request_entity1.txt new file mode 100644 index 000000000..abda4f381 --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/request_entity1.txt @@ -0,0 +1,4 @@ +{ + "operation": "update", + "entity_id": "entity1" +} diff --git a/lib/doorman/src/test/resources/it/tc2/request_entity2.txt b/lib/doorman/src/test/resources/it/tc2/request_entity2.txt new file mode 100644 index 000000000..eb6ef6d92 --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/request_entity2.txt @@ -0,0 +1,4 @@ +{ + "operation": "update", + "entity_id": "entity2" +} diff --git a/lib/doorman/src/test/resources/it/tc2/request_other.txt b/lib/doorman/src/test/resources/it/tc2/request_other.txt new file mode 100644 index 000000000..7763aeb7d --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/request_other.txt @@ -0,0 +1,4 @@ +{ + "operation": "add", + "entity_id": "entity5" +} diff --git a/lib/doorman/src/test/resources/it/tc2/response.txt b/lib/doorman/src/test/resources/it/tc2/response.txt new file mode 100644 index 000000000..21aad5aed --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/response.txt @@ -0,0 +1,3 @@ +{ + "status": "success", +} diff --git a/lib/doorman/src/test/resources/it/tc2/result.json b/lib/doorman/src/test/resources/it/tc2/result.json new file mode 100644 index 000000000..d2df2ea7b --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/result.json @@ -0,0 +1,94 @@ +{ + "queue_list": [ + { + "queue_type": "Cluster", + "queue_id": "Cluster", + "check_sequence_list": [ + [ + "STATUS | req-entity1-1 | ARRIVED", + "ACTION | req-entity1-1 | HOLD | 20", + "STATUS | req-entity1-1 | IN_QUEUE", + "STATUS | req-entity1-2 | ARRIVED", + "ACTION | req-entity1-1 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-2 | HOLD | 20", + "STATUS | req-entity1-2 | IN_QUEUE", + "STATUS | req-entity1-3 | ARRIVED", + "ACTION | req-entity1-2 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-3 | HOLD | 20", + "STATUS | req-entity1-3 | IN_QUEUE", + "STATUS | req-entity1-4 | ARRIVED", + "ACTION | req-entity1-3 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-4 | HOLD | 20", + "STATUS | req-entity1-4 | IN_QUEUE", + "ACTION | req-entity1-4 | PROCESS", + "STATUS | req-entity1-4 | PROCESSING_SYNC", + "ACTION | req-entity1-4 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-entity1-4 | COMPLETED" + ], + [ + "STATUS | req-entity2-1 | ARRIVED", + "ACTION | req-entity2-1 | HOLD | 20", + "STATUS | req-entity2-1 | IN_QUEUE", + "STATUS | req-entity2-2 | ARRIVED", + "ACTION | req-entity2-1 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-2 | HOLD | 20", + "STATUS | req-entity2-2 | IN_QUEUE", + "STATUS | req-entity2-3 | ARRIVED", + "ACTION | req-entity2-2 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-3 | HOLD | 20", + "STATUS | req-entity2-3 | IN_QUEUE", + "STATUS | req-entity2-4 | ARRIVED", + "ACTION | req-entity2-3 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-4 | HOLD | 20", + "STATUS | req-entity2-4 | IN_QUEUE", + "ACTION | req-entity2-4 | PROCESS", + "STATUS | req-entity2-4 | PROCESSING_SYNC", + "ACTION | req-entity2-4 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-entity2-4 | COMPLETED" + ], + [ + "STATUS | req-entity1-1 | ARRIVED", + "ACTION | req-entity1-1 | HOLD | 20", + "STATUS | req-entity1-1 | IN_QUEUE", + "ACTION | req-entity1-1 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity1-1 | COMPLETED" + ], + [ + "STATUS | req-entity1-2 | ARRIVED", + "ACTION | req-entity1-2 | HOLD | 20", + "STATUS | req-entity1-2 | IN_QUEUE", + "ACTION | req-entity1-2 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity1-2 | COMPLETED" + ], + [ + "STATUS | req-entity1-3 | ARRIVED", + "ACTION | req-entity1-3 | HOLD | 20", + "STATUS | req-entity1-3 | IN_QUEUE", + "ACTION | req-entity1-3 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity1-3 | COMPLETED" + ], + [ + "STATUS | req-entity2-1 | ARRIVED", + "ACTION | req-entity2-1 | HOLD | 20", + "STATUS | req-entity2-1 | IN_QUEUE", + "ACTION | req-entity2-1 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity2-1 | COMPLETED" + ], + [ + "STATUS | req-entity2-2 | ARRIVED", + "ACTION | req-entity2-2 | HOLD | 20", + "STATUS | req-entity2-2 | IN_QUEUE", + "ACTION | req-entity2-2 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity2-2 | COMPLETED" + ], + [ + "STATUS | req-entity2-3 | ARRIVED", + "ACTION | req-entity2-3 | HOLD | 20", + "STATUS | req-entity2-3 | IN_QUEUE", + "ACTION | req-entity2-3 | RETURN_COMPLETE | SKIPPED", + "STATUS | req-entity2-3 | COMPLETED" + ] + ] + } + ] +} diff --git a/lib/doorman/src/test/resources/it/tc2/result2.json b/lib/doorman/src/test/resources/it/tc2/result2.json new file mode 100644 index 000000000..551f1ae17 --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/result2.json @@ -0,0 +1,76 @@ +{ + "queue_list": [ + { + "queue_type": "Cluster", + "queue_id": "Cluster", + "check_sequence_list": [ + [ + "STATUS | req-entity1-1 | ARRIVED", + "ACTION | req-entity1-1 | HOLD | 20", + "STATUS | req-entity1-1 | IN_QUEUE", + "STATUS | req-other-1 | ARRIVED", + "ACTION | req-other-1 | PROCESS", + "STATUS | req-other-1 | PROCESSING_SYNC", + "STATUS | req-entity2-1 | ARRIVED", + "ACTION | req-entity2-1 | HOLD | 20", + "STATUS | req-entity2-1 | IN_QUEUE", + "STATUS | req-other-2 | ARRIVED", + "ACTION | req-other-2 | PROCESS", + "STATUS | req-other-2 | PROCESSING_SYNC", + "STATUS | req-entity1-2 | ARRIVED", + "ACTION | req-entity1-1 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-2 | HOLD | 20", + "STATUS | req-entity1-2 | IN_QUEUE", + "STATUS | req-entity2-2 | ARRIVED", + "ACTION | req-entity2-1 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-2 | HOLD | 20", + "STATUS | req-entity2-2 | IN_QUEUE", + "STATUS | req-entity1-3 | ARRIVED", + "ACTION | req-entity1-2 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-3 | HOLD | 20", + "STATUS | req-entity1-3 | IN_QUEUE", + "STATUS | req-other-3 | ARRIVED", + "ACTION | req-other-3 | PROCESS", + "STATUS | req-other-3 | PROCESSING_SYNC", + "STATUS | req-entity2-3 | ARRIVED", + "ACTION | req-entity2-2 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-3 | HOLD | 20", + "STATUS | req-entity2-3 | IN_QUEUE", + "STATUS | req-entity1-4 | ARRIVED", + "ACTION | req-entity1-3 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity1-4 | HOLD | 20", + "STATUS | req-entity1-4 | IN_QUEUE", + "STATUS | req-entity2-4 | ARRIVED", + "ACTION | req-entity2-3 | RETURN_COMPLETE | SKIPPED", + "ACTION | req-entity2-4 | HOLD | 20", + "STATUS | req-entity2-4 | IN_QUEUE", + "STATUS | req-other-4 | ARRIVED", + "ACTION | req-other-4 | PROCESS", + "STATUS | req-other-4 | PROCESSING_SYNC", + "STATUS | req-entity1-1 | COMPLETED", + "ACTION | req-other-1 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-other-1 | COMPLETED", + "STATUS | req-entity2-1 | COMPLETED", + "ACTION | req-other-2 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-other-2 | COMPLETED", + "STATUS | req-entity1-2 | COMPLETED", + "STATUS | req-entity2-2 | COMPLETED", + "STATUS | req-entity1-3 | COMPLETED", + "ACTION | req-other-3 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-other-3 | COMPLETED", + "STATUS | req-entity2-3 | COMPLETED", + "ACTION | req-other-4 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-other-4 | COMPLETED", + "ACTION | req-entity1-4 | PROCESS", + "ACTION | req-entity2-4 | PROCESS", + "STATUS | req-entity1-4 | PROCESSING_SYNC", + "STATUS | req-entity2-4 | PROCESSING_SYNC", + "ACTION | req-entity1-4 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-entity1-4 | COMPLETED", + "ACTION | req-entity2-4 | RETURN_COMPLETE | PROCESSED", + "STATUS | req-entity2-4 | COMPLETED" + ] + ] + } + ] +} diff --git a/lib/doorman/src/test/resources/it/tc2/test.json b/lib/doorman/src/test/resources/it/tc2/test.json new file mode 100644 index 000000000..82a0546ac --- /dev/null +++ b/lib/doorman/src/test/resources/it/tc2/test.json @@ -0,0 +1,202 @@ +{ + "handler_list": [ + { + "queue_type": "Cluster", + "handler_class": "Handler" + } + ], + "request_list": [ + { + "request_param": { + "request_id": "req-entity1-1", + "sequence_number": 1, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity1.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 100, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-other-1", + "sequence_number": 2, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_other.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 200, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity2-1", + "sequence_number": 3, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity2.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 300, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-other-2", + "sequence_number": 4, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_other.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 400, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity1-2", + "sequence_number": 5, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity1.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 500, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity2-2", + "sequence_number": 6, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity2.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 600, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity1-3", + "sequence_number": 7, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity1.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 700, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-other-3", + "sequence_number": 8, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_other.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 800, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity2-3", + "sequence_number": 9, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity2.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 900, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity1-4", + "sequence_number": 10, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity1.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 3100, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-entity2-4", + "sequence_number": 11, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_entity2.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 3200, + "process_time": 5000 + }, + { + "request_param": { + "request_id": "req-other-4", + "sequence_number": 12, + "queue_type": "Cluster", + "queue_id": "Cluster", + "http_method": "POST" + }, + "request_body_file": "request_other.txt", + "response_param": { + "http_code": 200 + }, + "response_body_file": "response.txt", + "start_time": 3300, + "process_time": 5000 + } + ] +} diff --git a/lib/doorman/src/test/resources/schema.sql b/lib/doorman/src/test/resources/schema.sql new file mode 100644 index 000000000..d110e64ca --- /dev/null +++ b/lib/doorman/src/test/resources/schema.sql @@ -0,0 +1,58 @@ +CREATE TABLE IF NOT EXISTS `resource_lock` ( + `resource_lock_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `resource_name` varchar(256), + `lock_holder` varchar(100) NOT NULL, + `lock_count` smallint(6) NOT NULL, + `lock_time` datetime NOT NULL, + `expiration_time` datetime NOT NULL, + PRIMARY KEY (`resource_lock_id`), + UNIQUE KEY `IX1_RESOURCE_LOCK` (`resource_name`) +); + +CREATE TABLE IF NOT EXISTS `message` ( + `message_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `ext_message_id` varchar(64), + `request_param` TEXT NOT NULL, + `request_body` TEXT NOT NULL, + `arrived_timestamp` datetime NOT NULL, + `started_timestamp` datetime, + `completed_timestamp` datetime, + `response_timestamp` datetime, + `response_param` TEXT, + `response_body` TEXT, + `resolution` varchar(20), + `queue_type` varchar(64), + `queue_id` varchar(256), + PRIMARY KEY (`message_id`) +); + +CREATE INDEX IF NOT EXISTS `ix1_message` +ON message(queue_type, queue_id); + +CREATE TABLE IF NOT EXISTS `message_status` ( + `message_status_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `message_id` bigint(20) unsigned NOT NULL REFERENCES message(message_id), + `status` varchar(20) NOT NULL, + `status_timestamp` datetime NOT NULL, + PRIMARY KEY (`message_status_id`) +); + +CREATE INDEX IF NOT EXISTS `ix1_message_status` +ON message_status(message_id); + +CREATE TABLE IF NOT EXISTS `message_action` ( + `message_action_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `message_id` bigint(20) unsigned NOT NULL REFERENCES message(message_id), + `action` varchar(20) NOT NULL, + `action_status` varchar(20) NOT NULL, + `resolution` varchar(20), + `action_timestamp` datetime NOT NULL, + `done_timestamp` datetime, + `hold_time` int, + `response_param` TEXT, + `response_body` TEXT, + PRIMARY KEY (`message_action_id`) +); + +CREATE INDEX IF NOT EXISTS `ix1_message_action` +ON message_action(message_id); diff --git a/lib/doorman/src/test/resources/test1.json b/lib/doorman/src/test/resources/test1.json new file mode 100644 index 000000000..820675c7e --- /dev/null +++ b/lib/doorman/src/test/resources/test1.json @@ -0,0 +1,36 @@ +{ + "struct": { + "simple-list": [ + "val1", + "val2", + null, + false, + true, + 123, + 0.123, + 1.2334e-5 + ], + "list": [ + { + "name1": "val1", + "name2": "val2" + }, + { + "name1": "val1", + "name2": "val2" + }, + { + "integer": 34, + "fraction": 0.2145, + "exponent": 6.61789e+0, + "boolean": true + }, + [ "val1", "val2", "blah \"string\" \t\t\t\n" ] ] + }, + "types": { + "integer": 34, + "fraction": 0.2145, + "exponent": 6.61789e+0, + "boolean": true + } +} |