blob: 6bb20e96f3f8ff1fb4f017d3fe17ff11b06c60d8 [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 = (
50 trns_Buffered,
51 trns_Framed
52 );
53
54 TLayeredTransports = set of TLayeredTransport;
55
Jake Farrell27274222011-11-10 20:32:44 +000056const
Jens Geyerf8a1b7a2014-09-24 00:26:46 +020057 SERVER_TYPES : array[TServerType] of string
58 = ('Simple', 'Nonblocking', 'Threadpool', 'Threaded');
59
60 THRIFT_PROTOCOLS : array[TKnownProtocol] of string
61 = ('Binary', 'JSON', 'Compact');
62
63 LAYERED_TRANSPORTS : array[TLayeredTransport] of string
64 = ('Buffered', 'Framed');
65
66 ENDPOINT_TRANSPORTS : array[TEndpointTransport] of string
Jens Geyer02230912019-04-03 01:12:51 +020067 = ('Sockets', 'Http', 'WinHttp', 'Named Pipes','Anon Pipes', 'EvHttp');
Jake Farrell27274222011-11-10 20:32:44 +000068
Jens Geyer0b20cc82013-03-07 20:47:01 +010069 // defaults are: read=false, write=true
70 BINARY_STRICT_READ = FALSE;
71 BINARY_STRICT_WRITE = FALSE;
72
Jens Geyer06045cf2013-03-27 20:26:25 +020073 HUGE_TEST_STRING = 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
74 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
75 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
76 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
77 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
78 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
79 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
80 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
81 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
82 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
83 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
84 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
85 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
86 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
87 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
88 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
89 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
90 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
91 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
92 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
93 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
94 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
95 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
96 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
97 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
98 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
99 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
100 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
101 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
102 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
103 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
104 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
105 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
106 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
107 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
108 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
109 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
110 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
111 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
112 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
113 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
114 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
115 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
116 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
117 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
118 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
119 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
120 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
121 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
122 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
123 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
124 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
125 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
126 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
127 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
128 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
129 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
130 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
131 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
132 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
133 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
134 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
135 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
136 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. '
137 + 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy '
138 + 'eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam '
139 + 'voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
140 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit '
141 + 'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam '
142 + 'nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed '
143 + 'diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet '
144 + 'clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ';
145
Jens Geyerfd1b3582014-12-13 23:42:58 +0100146
147function BytesToHex( const bytes : TBytes) : string;
148
149
Jake Farrell27274222011-11-10 20:32:44 +0000150implementation
151
Jens Geyerfd1b3582014-12-13 23:42:58 +0100152
153function BytesToHex( const bytes : TBytes) : string;
154var i : Integer;
155begin
156 result := '';
157 for i := Low(bytes) to High(bytes) do begin
158 result := result + IntToHex(bytes[i],2);
159 end;
160end;
161
Jake Farrell27274222011-11-10 20:32:44 +0000162
163end.