-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.proto
118 lines (99 loc) · 3.89 KB
/
util.proto
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
/*
* Copyright 2020-2020 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto3";
package util;
import "th2_grpc_common/common.proto";
option java_multiple_files = true;
option java_package = "com.exactpro.th2.util.grpc";
service MessageComparator {
// Compares a filter vs passed messages and returns comparison result for every pair.
rpc compareFilterVsMessages (CompareFilterVsMessagesRequest) returns (CompareFilterVsMessagesResponse);
// Compares a message vs another message and returns a comparison result.
rpc compareMessageVsMessage (CompareMessageVsMessageRequest) returns (CompareMessageVsMessageResponse);
}
//--// Settings //--//
message ComparisonSettings {
/*
* These fields will not be considered during comparison. It concerns fields with simple or collection types.
* Comparison result will have the NA status for them.
*/
repeated string ignore_fields = 1;
}
//--// Compare filter versus messages //--//
message CompareFilterVsMessagesRequest {
MessageFilter filter = 1;
repeated Message messages = 2;
ComparisonSettings settings = 3;
}
message CompareFilterVsMessagesResponse {
repeated CompareFilterVsMessageResult comparison_results = 1;
}
message CompareFilterVsMessageResult {
MessageID message_id = 1;
ComparisonEntry comparison_result = 2;
}
//--// Compare message versus message //--//
message CompareMessageVsMessageRequest {
repeated CompareMessageVsMessageTask comparison_tasks = 1;
}
message CompareMessageVsMessageResponse {
repeated CompareMessageVsMessageResult comparison_results = 1;
}
message CompareMessageVsMessageTask {
Message first = 1;
Message second = 2;
ComparisonSettings settings = 3;
}
message CompareMessageVsMessageResult {
MessageID first_message_id = 1;
MessageID second_message_id = 2;
ComparisonEntry comparison_result = 3;
}
//--// Common entry //--//
message ComparisonEntry {
/* The type field has default value for a root element and it should be skipped during analyse. It has real value for other fields. */
ComparisonEntryType type = 1;
/*
* The status field has default value for a element with collection type and it should be skipped during analyse.
* It has real value for other fields. Fields with nested elements have aggregated value.
*/
ComparisonEntryStatus status = 2;
/* The first field has default value for a root element and it should be skipped during analyse. It has value of the first message of filter in other cases. */
string first = 3;
/* The second field has default value for a root element and it should be skipped during analyse. It has value of the second message in other cases. */
string second = 4;
/*
* The operation field has default value for a root element and it should be skipped during analyse.
* This value is taken from filter in case filter vs message comparison or it is EQUAL in case message vs message comparison.
*/
FilterOperation operation = 5;
/*
* The is_key field has default value for a root element and it should be skipped during analyse.
* It is taken from filter in case filter versus message comparison otherwise it is false.
*/
bool is_key = 6;
/* The fields contains mapping name to ComparisonEntry for nested fields. */
map<string, ComparisonEntry> fields = 7;
}
enum ComparisonEntryType {
FIELD = 0;
COLLECTION = 1;
}
enum ComparisonEntryStatus {
NA = 0;
PASSED = 1;
FAILED = 2;
}