Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 1 | (* |
| 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 | |
| 20 | unit TestConstants; |
| 21 | |
| 22 | interface |
| 23 | |
Jens Geyer | 3b68653 | 2021-07-01 23:04:08 +0200 | [diff] [blame] | 24 | uses SysUtils, |
| 25 | Thrift.Protocol, Thrift.Protocol.Compact, Thrift.Protocol.JSON; |
Jens Geyer | fd1b358 | 2014-12-13 23:42:58 +0100 | [diff] [blame] | 26 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 27 | type |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 28 | 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 Geyer | 0223091 | 2019-04-03 01:12:51 +0200 | [diff] [blame] | 43 | trns_MsxmlHttp, |
| 44 | trns_WinHttp, |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 45 | trns_NamedPipes, |
| 46 | trns_AnonPipes, |
| 47 | trns_EvHttp // as listed on http://thrift.apache.org/test |
| 48 | ); |
| 49 | |
| 50 | TLayeredTransport = ( |
Jens Geyer | b342bd9 | 2019-06-03 20:27:00 +0200 | [diff] [blame] | 51 | trns_None, |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 52 | trns_Buffered, |
| 53 | trns_Framed |
| 54 | ); |
| 55 | |
| 56 | TLayeredTransports = set of TLayeredTransport; |
| 57 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 58 | const |
Jens Geyer | 3b68653 | 2021-07-01 23:04:08 +0200 | [diff] [blame] | 59 | PROTOCOL_CLASSES : array[TKnownProtocol] of TProtocolImplClass = ( |
| 60 | TBinaryProtocolImpl, |
| 61 | TJSONProtocolImpl, |
| 62 | TCompactProtocolImpl |
| 63 | ); |
| 64 | |
| 65 | const |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 66 | 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 Geyer | b342bd9 | 2019-06-03 20:27:00 +0200 | [diff] [blame] | 73 | = ('None', 'Buffered', 'Framed'); |
Jens Geyer | f8a1b7a | 2014-09-24 00:26:46 +0200 | [diff] [blame] | 74 | |
| 75 | ENDPOINT_TRANSPORTS : array[TEndpointTransport] of string |
Jens Geyer | 0223091 | 2019-04-03 01:12:51 +0200 | [diff] [blame] | 76 | = ('Sockets', 'Http', 'WinHttp', 'Named Pipes','Anon Pipes', 'EvHttp'); |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 77 | |
Jens Geyer | 06045cf | 2013-03-27 20:26:25 +0200 | [diff] [blame] | 78 | 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 Geyer | fd1b358 | 2014-12-13 23:42:58 +0100 | [diff] [blame] | 151 | |
| 152 | function BytesToHex( const bytes : TBytes) : string; |
| 153 | |
| 154 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 155 | implementation |
| 156 | |
Jens Geyer | fd1b358 | 2014-12-13 23:42:58 +0100 | [diff] [blame] | 157 | |
| 158 | function BytesToHex( const bytes : TBytes) : string; |
| 159 | var i : Integer; |
| 160 | begin |
| 161 | result := ''; |
| 162 | for i := Low(bytes) to High(bytes) do begin |
| 163 | result := result + IntToHex(bytes[i],2); |
| 164 | end; |
| 165 | end; |
| 166 | |
Jake Farrell | 2727422 | 2011-11-10 20:32:44 +0000 | [diff] [blame] | 167 | |
| 168 | end. |