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