blob: ae3b3e8a355dda006635da2331a1f15a456199d7 [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 Geyerfd1b3582014-12-13 23:42:58 +010024uses SysUtils;
25
Jake Farrell27274222011-11-10 20:32:44 +000026type
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020027 TKnownProtocol = (
28 prot_Binary, // default binary protocol
29 prot_JSON, // JSON protocol
30 prot_Compact
31 );
32
33 TServerType = (
34 srv_Simple,
35 srv_Nonblocking,
36 srv_Threadpool,
37 srv_Threaded
38 );
39
40 TEndpointTransport = (
41 trns_Sockets,
Jens Geyer02230912019-04-03 01:12:51 +020042 trns_MsxmlHttp,
43 trns_WinHttp,
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020044 trns_NamedPipes,
45 trns_AnonPipes,
46 trns_EvHttp // as listed on http://thrift.apache.org/test
47 );
48
49 TLayeredTransport = (
Jens Geyerb342bd92019-06-03 20:27:00 +020050 trns_None,
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020051 trns_Buffered,
52 trns_Framed
53 );
54
55 TLayeredTransports = set of TLayeredTransport;
56
Jake Farrell27274222011-11-10 20:32:44 +000057const
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020058 SERVER_TYPES : array[TServerType] of string
59 = ('Simple', 'Nonblocking', 'Threadpool', 'Threaded');
60
61 THRIFT_PROTOCOLS : array[TKnownProtocol] of string
62 = ('Binary', 'JSON', 'Compact');
63
64 LAYERED_TRANSPORTS : array[TLayeredTransport] of string
Jens Geyerb342bd92019-06-03 20:27:00 +020065 = ('None', 'Buffered', 'Framed');
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020066
67 ENDPOINT_TRANSPORTS : array[TEndpointTransport] of string
Jens Geyer02230912019-04-03 01:12:51 +020068 = ('Sockets', 'Http', 'WinHttp', 'Named Pipes','Anon Pipes', 'EvHttp');
Jake Farrell27274222011-11-10 20:32:44 +000069
Jens Geyer0b20cc82013-03-07 20:47:01 +010070 // defaults are: read=false, write=true
71 BINARY_STRICT_READ = FALSE;
72 BINARY_STRICT_WRITE = FALSE;
73
Jens Geyer06045cf2013-03-27 20:26:25 +020074 HUGE_TEST_STRING = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
75 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
76 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
77 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
78 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
79 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
80 + 'diam 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 amet. '
82 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
83 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
84 + '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 '
86 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
87 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
88 + 'diam 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 amet. '
90 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
91 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
92 + '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 '
94 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
95 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
96 + 'diam 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 amet. '
98 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
99 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
100 + '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 '
102 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
103 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
104 + 'diam 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 amet. '
106 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
107 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
108 + '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 '
110 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
111 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
112 + 'diam 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 amet. '
114 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
115 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
116 + '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 '
118 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
119 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
120 + 'diam 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 amet. '
122 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
123 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
124 + '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 '
126 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
127 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
128 + 'diam 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 amet. '
130 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
131 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
132 + '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 '
134 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
135 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
136 + 'diam 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 amet. '
138 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
139 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
140 + '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 '
142 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
143 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
144 + 'diam 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 amet. ';
146
Jens Geyerfd1b3582014-12-13 23:42:58 +0100147
148function BytesToHex( const bytes : TBytes) : string;
149
150
Jake Farrell27274222011-11-10 20:32:44 +0000151implementation
152
Jens Geyerfd1b3582014-12-13 23:42:58 +0100153
154function BytesToHex( const bytes : TBytes) : string;
155var i : Integer;
156begin
157 result := '';
158 for i := Low(bytes) to High(bytes) do begin
159 result := result + IntToHex(bytes[i],2);
160 end;
161end;
162
Jake Farrell27274222011-11-10 20:32:44 +0000163
164end.