blob: 9ac4808c056ba98be09c7341e1cb521165e7c832 [file] [log] [blame]
Jake Farrell27274222011-11-10 20:32:44 +00001(*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *)
19
20unit TestConstants;
21
22interface
23
Jens Geyer3b686532021-07-01 23:04:08 +020024uses SysUtils,
25 Thrift.Protocol, Thrift.Protocol.Compact, Thrift.Protocol.JSON;
Jens Geyerfd1b3582014-12-13 23:42:58 +010026
Jake Farrell27274222011-11-10 20:32:44 +000027type
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020028 TKnownProtocol = (
29 prot_Binary, // default binary protocol
30 prot_JSON, // JSON protocol
31 prot_Compact
32 );
33
34 TServerType = (
35 srv_Simple,
36 srv_Nonblocking,
37 srv_Threadpool,
38 srv_Threaded
39 );
40
41 TEndpointTransport = (
42 trns_Sockets,
Jens Geyer02230912019-04-03 01:12:51 +020043 trns_MsxmlHttp,
44 trns_WinHttp,
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020045 trns_NamedPipes,
46 trns_AnonPipes,
47 trns_EvHttp // as listed on http://thrift.apache.org/test
48 );
49
50 TLayeredTransport = (
Jens Geyerb342bd92019-06-03 20:27:00 +020051 trns_None,
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020052 trns_Buffered,
53 trns_Framed
54 );
55
56 TLayeredTransports = set of TLayeredTransport;
57
Jake Farrell27274222011-11-10 20:32:44 +000058const
Jens Geyer3b686532021-07-01 23:04:08 +020059 PROTOCOL_CLASSES : array[TKnownProtocol] of TProtocolImplClass = (
60 TBinaryProtocolImpl,
61 TJSONProtocolImpl,
62 TCompactProtocolImpl
63 );
64
65const
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020066 SERVER_TYPES : array[TServerType] of string
67 = ('Simple', 'Nonblocking', 'Threadpool', 'Threaded');
68
69 THRIFT_PROTOCOLS : array[TKnownProtocol] of string
70 = ('Binary', 'JSON', 'Compact');
71
72 LAYERED_TRANSPORTS : array[TLayeredTransport] of string
Jens Geyerb342bd92019-06-03 20:27:00 +020073 = ('None', 'Buffered', 'Framed');
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020074
75 ENDPOINT_TRANSPORTS : array[TEndpointTransport] of string
Jens Geyer02230912019-04-03 01:12:51 +020076 = ('Sockets', 'Http', 'WinHttp', 'Named Pipes','Anon Pipes', 'EvHttp');
Jake Farrell27274222011-11-10 20:32:44 +000077
Jens Geyer06045cf2013-03-27 20:26:25 +020078 HUGE_TEST_STRING = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
79 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
80 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
81 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
82 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
83 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
84 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
85 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
86 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
87 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
88 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
89 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
90 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
91 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
92 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
93 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
94 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
95 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
96 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
97 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
98 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
99 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
100 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
101 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
102 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
103 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
104 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
105 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
106 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
107 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
108 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
109 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
110 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
111 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
112 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
113 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
114 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
115 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
116 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
117 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
118 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
119 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
120 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
121 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
122 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
123 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
124 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
125 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
126 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
127 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
128 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
129 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
130 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
131 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
132 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
133 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
134 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
135 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
136 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
137 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
138 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
139 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
140 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
141 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
142 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
143 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
144 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
145 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
146 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
147 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
148 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
149 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ';
150
Jens Geyerfd1b3582014-12-13 23:42:58 +0100151
152function BytesToHex( const bytes : TBytes) : string;
153
154
Jake Farrell27274222011-11-10 20:32:44 +0000155implementation
156
Jens Geyerfd1b3582014-12-13 23:42:58 +0100157
158function BytesToHex( const bytes : TBytes) : string;
159var i : Integer;
160begin
161 result := '';
162 for i := Low(bytes) to High(bytes) do begin
163 result := result + IntToHex(bytes[i],2);
164 end;
165end;
166
Jake Farrell27274222011-11-10 20:32:44 +0000167
168end.