quickfix_ruby 1.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/ext/quickfix/Acceptor.cpp +248 -0
  3. data/ext/quickfix/Acceptor.h +127 -0
  4. data/ext/quickfix/Allocator.h +9 -0
  5. data/ext/quickfix/Application.h +127 -0
  6. data/ext/quickfix/AtomicCount.h +109 -0
  7. data/ext/quickfix/DOMDocument.h +74 -0
  8. data/ext/quickfix/DataDictionary.cpp +618 -0
  9. data/ext/quickfix/DataDictionary.h +539 -0
  10. data/ext/quickfix/DataDictionaryProvider.cpp +71 -0
  11. data/ext/quickfix/DataDictionaryProvider.h +70 -0
  12. data/ext/quickfix/DatabaseConnectionID.h +105 -0
  13. data/ext/quickfix/DatabaseConnectionPool.h +91 -0
  14. data/ext/quickfix/Dictionary.cpp +162 -0
  15. data/ext/quickfix/Dictionary.h +94 -0
  16. data/ext/quickfix/Event.h +95 -0
  17. data/ext/quickfix/Exceptions.h +299 -0
  18. data/ext/quickfix/Field.h +672 -0
  19. data/ext/quickfix/FieldConvertors.h +863 -0
  20. data/ext/quickfix/FieldMap.cpp +238 -0
  21. data/ext/quickfix/FieldMap.h +244 -0
  22. data/ext/quickfix/FieldNumbers.h +46 -0
  23. data/ext/quickfix/FieldTypes.cpp +64 -0
  24. data/ext/quickfix/FieldTypes.h +698 -0
  25. data/ext/quickfix/Fields.h +31 -0
  26. data/ext/quickfix/FileLog.cpp +200 -0
  27. data/ext/quickfix/FileLog.h +112 -0
  28. data/ext/quickfix/FileStore.cpp +332 -0
  29. data/ext/quickfix/FileStore.h +129 -0
  30. data/ext/quickfix/FixFieldNumbers.h +1537 -0
  31. data/ext/quickfix/FixFields.h +1538 -0
  32. data/ext/quickfix/FixValues.h +3281 -0
  33. data/ext/quickfix/FlexLexer.h +188 -0
  34. data/ext/quickfix/Group.cpp +64 -0
  35. data/ext/quickfix/Group.h +73 -0
  36. data/ext/quickfix/HtmlBuilder.h +186 -0
  37. data/ext/quickfix/HttpConnection.cpp +739 -0
  38. data/ext/quickfix/HttpConnection.h +78 -0
  39. data/ext/quickfix/HttpMessage.cpp +149 -0
  40. data/ext/quickfix/HttpMessage.h +133 -0
  41. data/ext/quickfix/HttpParser.cpp +49 -0
  42. data/ext/quickfix/HttpParser.h +54 -0
  43. data/ext/quickfix/HttpServer.cpp +169 -0
  44. data/ext/quickfix/HttpServer.h +78 -0
  45. data/ext/quickfix/Initiator.cpp +289 -0
  46. data/ext/quickfix/Initiator.h +149 -0
  47. data/ext/quickfix/Log.cpp +77 -0
  48. data/ext/quickfix/Log.h +179 -0
  49. data/ext/quickfix/Message.cpp +580 -0
  50. data/ext/quickfix/Message.h +370 -0
  51. data/ext/quickfix/MessageCracker.h +188 -0
  52. data/ext/quickfix/MessageSorters.cpp +105 -0
  53. data/ext/quickfix/MessageSorters.h +156 -0
  54. data/ext/quickfix/MessageStore.cpp +146 -0
  55. data/ext/quickfix/MessageStore.h +174 -0
  56. data/ext/quickfix/Mutex.h +131 -0
  57. data/ext/quickfix/MySQLConnection.h +194 -0
  58. data/ext/quickfix/MySQLLog.cpp +275 -0
  59. data/ext/quickfix/MySQLLog.h +145 -0
  60. data/ext/quickfix/MySQLStore.cpp +331 -0
  61. data/ext/quickfix/MySQLStore.h +142 -0
  62. data/ext/quickfix/NullStore.cpp +54 -0
  63. data/ext/quickfix/NullStore.h +99 -0
  64. data/ext/quickfix/OdbcConnection.h +266 -0
  65. data/ext/quickfix/OdbcLog.cpp +252 -0
  66. data/ext/quickfix/OdbcLog.h +117 -0
  67. data/ext/quickfix/OdbcStore.cpp +338 -0
  68. data/ext/quickfix/OdbcStore.h +113 -0
  69. data/ext/quickfix/PUGIXML_DOMDocument.cpp +112 -0
  70. data/ext/quickfix/PUGIXML_DOMDocument.h +81 -0
  71. data/ext/quickfix/Parser.cpp +103 -0
  72. data/ext/quickfix/Parser.h +57 -0
  73. data/ext/quickfix/PostgreSQLConnection.h +176 -0
  74. data/ext/quickfix/PostgreSQLLog.cpp +276 -0
  75. data/ext/quickfix/PostgreSQLLog.h +144 -0
  76. data/ext/quickfix/PostgreSQLStore.cpp +334 -0
  77. data/ext/quickfix/PostgreSQLStore.h +141 -0
  78. data/ext/quickfix/Queue.h +75 -0
  79. data/ext/quickfix/QuickfixRuby.cpp +252066 -0
  80. data/ext/quickfix/QuickfixRuby.h +34 -0
  81. data/ext/quickfix/Responder.h +43 -0
  82. data/ext/quickfix/Session.cpp +1487 -0
  83. data/ext/quickfix/Session.h +335 -0
  84. data/ext/quickfix/SessionFactory.cpp +274 -0
  85. data/ext/quickfix/SessionFactory.h +86 -0
  86. data/ext/quickfix/SessionID.h +170 -0
  87. data/ext/quickfix/SessionSettings.cpp +189 -0
  88. data/ext/quickfix/SessionSettings.h +171 -0
  89. data/ext/quickfix/SessionState.h +231 -0
  90. data/ext/quickfix/Settings.cpp +100 -0
  91. data/ext/quickfix/Settings.h +53 -0
  92. data/ext/quickfix/SharedArray.h +150 -0
  93. data/ext/quickfix/SocketAcceptor.cpp +222 -0
  94. data/ext/quickfix/SocketAcceptor.h +75 -0
  95. data/ext/quickfix/SocketConnection.cpp +238 -0
  96. data/ext/quickfix/SocketConnection.h +103 -0
  97. data/ext/quickfix/SocketConnector.cpp +116 -0
  98. data/ext/quickfix/SocketConnector.h +67 -0
  99. data/ext/quickfix/SocketInitiator.cpp +260 -0
  100. data/ext/quickfix/SocketInitiator.h +81 -0
  101. data/ext/quickfix/SocketMonitor.cpp +335 -0
  102. data/ext/quickfix/SocketMonitor.h +111 -0
  103. data/ext/quickfix/SocketServer.cpp +177 -0
  104. data/ext/quickfix/SocketServer.h +100 -0
  105. data/ext/quickfix/ThreadedSocketAcceptor.cpp +258 -0
  106. data/ext/quickfix/ThreadedSocketAcceptor.h +98 -0
  107. data/ext/quickfix/ThreadedSocketConnection.cpp +209 -0
  108. data/ext/quickfix/ThreadedSocketConnection.h +82 -0
  109. data/ext/quickfix/ThreadedSocketInitiator.cpp +268 -0
  110. data/ext/quickfix/ThreadedSocketInitiator.h +84 -0
  111. data/ext/quickfix/TimeRange.cpp +173 -0
  112. data/ext/quickfix/TimeRange.h +258 -0
  113. data/ext/quickfix/Utility.cpp +537 -0
  114. data/ext/quickfix/Utility.h +219 -0
  115. data/ext/quickfix/Values.h +62 -0
  116. data/ext/quickfix/config.h +0 -0
  117. data/ext/quickfix/config_windows.h +0 -0
  118. data/ext/quickfix/extconf.rb +12 -0
  119. data/ext/quickfix/index.h +37 -0
  120. data/ext/quickfix/pugiconfig.hpp +72 -0
  121. data/ext/quickfix/pugixml.cpp +10765 -0
  122. data/ext/quickfix/pugixml.hpp +1341 -0
  123. data/ext/quickfix/strptime.h +7 -0
  124. data/lib/quickfix40.rb +274 -0
  125. data/lib/quickfix41.rb +351 -0
  126. data/lib/quickfix42.rb +1184 -0
  127. data/lib/quickfix43.rb +3504 -0
  128. data/lib/quickfix44.rb +10721 -0
  129. data/lib/quickfix50.rb +13426 -0
  130. data/lib/quickfix50sp1.rb +15629 -0
  131. data/lib/quickfix50sp2.rb +17068 -0
  132. data/lib/quickfix_fields.rb +19853 -0
  133. data/lib/quickfix_ruby.rb +82 -0
  134. data/lib/quickfixt11.rb +70 -0
  135. data/spec/FIX40.xml +862 -0
  136. data/spec/FIX41.xml +1285 -0
  137. data/spec/FIX42.xml +2746 -0
  138. data/spec/FIX43.xml +4229 -0
  139. data/spec/FIX44.xml +6596 -0
  140. data/spec/FIX50.xml +8137 -0
  141. data/spec/FIX50SP1.xml +9496 -0
  142. data/spec/FIX50SP2.xml +10011 -0
  143. data/spec/FIXT11.xml +313 -0
  144. data/test/test_DataDictionaryTestCase.rb +268 -0
  145. data/test/test_DictionaryTestCase.rb +112 -0
  146. data/test/test_FieldBaseTestCase.rb +24 -0
  147. data/test/test_MessageTestCase.rb +368 -0
  148. data/test/test_SessionSettingsTestCase.rb +41 -0
  149. metadata +193 -0
data/spec/FIXT11.xml ADDED
@@ -0,0 +1,313 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <fix type='FIXT' major='1' minor='1' servicepack='0'>
3
+ <header>
4
+ <field name='BeginString' required='Y'/>
5
+ <field name='BodyLength' required='Y'/>
6
+ <field name='MsgType' required='Y'/>
7
+ <field name='SenderCompID' required='Y'/>
8
+ <field name='TargetCompID' required='Y'/>
9
+ <field name='OnBehalfOfCompID' required='N'/>
10
+ <field name='DeliverToCompID' required='N'/>
11
+ <field name='SecureDataLen' required='N'/>
12
+ <field name='SecureData' required='N'/>
13
+ <field name='MsgSeqNum' required='Y'/>
14
+ <field name='SenderSubID' required='N'/>
15
+ <field name='SenderLocationID' required='N'/>
16
+ <field name='TargetSubID' required='N'/>
17
+ <field name='TargetLocationID' required='N'/>
18
+ <field name='OnBehalfOfSubID' required='N'/>
19
+ <field name='OnBehalfOfLocationID' required='N'/>
20
+ <field name='DeliverToSubID' required='N'/>
21
+ <field name='DeliverToLocationID' required='N'/>
22
+ <field name='PossDupFlag' required='N'/>
23
+ <field name='PossResend' required='N'/>
24
+ <field name='SendingTime' required='Y'/>
25
+ <field name='OrigSendingTime' required='N'/>
26
+ <field name='XmlDataLen' required='N'/>
27
+ <field name='XmlData' required='N'/>
28
+ <field name='MessageEncoding' required='N'/>
29
+ <field name='LastMsgSeqNumProcessed' required='N'/>
30
+ <component name='HopGrp' required='N'/>
31
+ <field name='ApplVerID' required='N'/>
32
+ <field name='CstmApplVerID' required='N'/>
33
+ </header>
34
+ <trailer>
35
+ <field name='SignatureLength' required='N'/>
36
+ <field name='Signature' required='N'/>
37
+ <field name='CheckSum' required='Y'/>
38
+ </trailer>
39
+ <messages>
40
+ <message msgcat='admin' msgtype='0' name='Heartbeat'>
41
+ <field name='TestReqID' required='N'/>
42
+ </message>
43
+ <message msgcat='admin' msgtype='1' name='TestRequest'>
44
+ <field name='TestReqID' required='Y'/>
45
+ </message>
46
+ <message msgcat='admin' msgtype='2' name='ResendRequest'>
47
+ <field name='BeginSeqNo' required='Y'/>
48
+ <field name='EndSeqNo' required='Y'/>
49
+ </message>
50
+ <message msgcat='admin' msgtype='3' name='Reject'>
51
+ <field name='RefSeqNum' required='Y'/>
52
+ <field name='RefTagID' required='N'/>
53
+ <field name='RefMsgType' required='N'/>
54
+ <field name='SessionRejectReason' required='N'/>
55
+ <field name='Text' required='N'/>
56
+ <field name='EncodedTextLen' required='N'/>
57
+ <field name='EncodedText' required='N'/>
58
+ </message>
59
+ <message msgcat='admin' msgtype='4' name='SequenceReset'>
60
+ <field name='GapFillFlag' required='N'/>
61
+ <field name='NewSeqNo' required='Y'/>
62
+ </message>
63
+ <message msgcat='admin' msgtype='5' name='Logout'>
64
+ <field name='Text' required='N'/>
65
+ <field name='EncodedTextLen' required='N'/>
66
+ <field name='EncodedText' required='N'/>
67
+ </message>
68
+ <message msgcat='admin' msgtype='A' name='Logon'>
69
+ <field name='EncryptMethod' required='Y'/>
70
+ <field name='HeartBtInt' required='Y'/>
71
+ <field name='RawDataLength' required='N'/>
72
+ <field name='RawData' required='N'/>
73
+ <field name='ResetSeqNumFlag' required='N'/>
74
+ <field name='NextExpectedMsgSeqNum' required='N'/>
75
+ <field name='MaxMessageSize' required='N'/>
76
+ <field name='TestMessageIndicator' required='N'/>
77
+ <field name='Username' required='N'/>
78
+ <field name='Password' required='N'/>
79
+ <field name='DefaultApplVerID' required='Y'/>
80
+ <component name='MsgTypeGrp' required='N'/>
81
+ </message>
82
+ </messages>
83
+ <components>
84
+ <component name='HopGrp'>
85
+ <group name='NoHops' required='N'>
86
+ <field name='HopCompID' required='N'/>
87
+ <field name='HopSendingTime' required='N'/>
88
+ <field name='HopRefID' required='N'/>
89
+ </group>
90
+ </component>
91
+ <component name='MsgTypeGrp'>
92
+ <group name='NoMsgTypes' required='N'>
93
+ <field name='RefMsgType' required='N'/>
94
+ <field name='MsgDirection' required='N'/>
95
+ <field name='RefApplVerID' required='N'/>
96
+ <field name='RefCstmApplVerID' required='N'/>
97
+ </group>
98
+ </component>
99
+ </components>
100
+ <fields>
101
+ <field name='BeginSeqNo' number='7' type='SEQNUM'/>
102
+ <field name='BeginString' number='8' type='STRING'/>
103
+ <field name='BodyLength' number='9' type='LENGTH'/>
104
+ <field name='CheckSum' number='10' type='STRING'/>
105
+ <field name='EndSeqNo' number='16' type='SEQNUM'/>
106
+ <field name='MsgSeqNum' number='34' type='SEQNUM'/>
107
+ <field number='35' name='MsgType' type='STRING'>
108
+ <value enum='0' description='HEARTBEAT'/>
109
+ <value enum='1' description='TEST_REQUEST'/>
110
+ <value enum='2' description='RESEND_REQUEST'/>
111
+ <value enum='3' description='REJECT'/>
112
+ <value enum='4' description='SEQUENCE_RESET'/>
113
+ <value enum='5' description='LOGOUT'/>
114
+ <value enum='6' description='INDICATION_OF_INTEREST'/>
115
+ <value enum='7' description='ADVERTISEMENT'/>
116
+ <value enum='8' description='EXECUTION_REPORT'/>
117
+ <value enum='9' description='ORDER_CANCEL_REJECT'/>
118
+ <value enum='A' description='LOGON'/>
119
+ <value enum='B' description='NEWS'/>
120
+ <value enum='C' description='EMAIL'/>
121
+ <value enum='D' description='ORDER_SINGLE'/>
122
+ <value enum='E' description='ORDER_LIST'/>
123
+ <value enum='F' description='ORDER_CANCEL_REQUEST'/>
124
+ <value enum='G' description='ORDER_CANCEL_REPLACE_REQUEST'/>
125
+ <value enum='H' description='ORDER_STATUS_REQUEST'/>
126
+ <value enum='J' description='ALLOCATION_INSTRUCTION'/>
127
+ <value enum='K' description='LIST_CANCEL_REQUEST'/>
128
+ <value enum='L' description='LIST_EXECUTE'/>
129
+ <value enum='M' description='LIST_STATUS_REQUEST'/>
130
+ <value enum='N' description='LIST_STATUS'/>
131
+ <value enum='P' description='ALLOCATION_INSTRUCTION_ACK'/>
132
+ <value enum='Q' description='DONT_KNOW_TRADE'/>
133
+ <value enum='R' description='QUOTE_REQUEST'/>
134
+ <value enum='S' description='QUOTE'/>
135
+ <value enum='T' description='SETTLEMENT_INSTRUCTIONS'/>
136
+ <value enum='V' description='MARKET_DATA_REQUEST'/>
137
+ <value enum='W' description='MARKET_DATA_SNAPSHOT_FULL_REFRESH'/>
138
+ <value enum='X' description='MARKET_DATA_INCREMENTAL_REFRESH'/>
139
+ <value enum='Y' description='MARKET_DATA_REQUEST_REJECT'/>
140
+ <value enum='Z' description='QUOTE_CANCEL'/>
141
+ <value enum='a' description='QUOTE_STATUS_REQUEST'/>
142
+ <value enum='b' description='MASS_QUOTE_ACKNOWLEDGEMENT'/>
143
+ <value enum='c' description='SECURITY_DEFINITION_REQUEST'/>
144
+ <value enum='d' description='SECURITY_DEFINITION'/>
145
+ <value enum='e' description='SECURITY_STATUS_REQUEST'/>
146
+ <value enum='f' description='SECURITY_STATUS'/>
147
+ <value enum='g' description='TRADING_SESSION_STATUS_REQUEST'/>
148
+ <value enum='h' description='TRADING_SESSION_STATUS'/>
149
+ <value enum='i' description='MASS_QUOTE'/>
150
+ <value enum='j' description='BUSINESS_MESSAGE_REJECT'/>
151
+ <value enum='k' description='BID_REQUEST'/>
152
+ <value enum='l' description='BID_RESPONSE'/>
153
+ <value enum='m' description='LIST_STRIKE_PRICE'/>
154
+ <value enum='n' description='XML_MESSAGE'/>
155
+ <value enum='o' description='REGISTRATION_INSTRUCTIONS'/>
156
+ <value enum='p' description='REGISTRATION_INSTRUCTIONS_RESPONSE'/>
157
+ <value enum='q' description='ORDER_MASS_CANCEL_REQUEST'/>
158
+ <value enum='r' description='ORDER_MASS_CANCEL_REPORT'/>
159
+ <value enum='s' description='NEW_ORDER_CROSS'/>
160
+ <value enum='t' description='CROSS_ORDER_CANCEL_REPLACE_REQUEST'/>
161
+ <value enum='u' description='CROSS_ORDER_CANCEL_REQUEST'/>
162
+ <value enum='v' description='SECURITY_TYPE_REQUEST'/>
163
+ <value enum='w' description='SECURITY_TYPES'/>
164
+ <value enum='x' description='SECURITY_LIST_REQUEST'/>
165
+ <value enum='y' description='SECURITY_LIST'/>
166
+ <value enum='z' description='DERIVATIVE_SECURITY_LIST_REQUEST'/>
167
+ <value enum='AA' description='DERIVATIVE_SECURITY_LIST'/>
168
+ <value enum='AB' description='NEW_ORDER_MULTILEG'/>
169
+ <value enum='AC' description='MULTILEG_ORDER_CANCEL_REPLACE'/>
170
+ <value enum='AD' description='TRADE_CAPTURE_REPORT_REQUEST'/>
171
+ <value enum='AE' description='TRADE_CAPTURE_REPORT'/>
172
+ <value enum='AF' description='ORDER_MASS_STATUS_REQUEST'/>
173
+ <value enum='AG' description='QUOTE_REQUEST_REJECT'/>
174
+ <value enum='AH' description='RFQ_REQUEST'/>
175
+ <value enum='AI' description='QUOTE_STATUS_REPORT'/>
176
+ <value enum='AJ' description='QUOTE_RESPONSE'/>
177
+ <value enum='AK' description='CONFIRMATION'/>
178
+ <value enum='AL' description='POSITION_MAINTENANCE_REQUEST'/>
179
+ <value enum='AM' description='POSITION_MAINTENANCE_REPORT'/>
180
+ <value enum='AN' description='REQUEST_FOR_POSITIONS'/>
181
+ <value enum='AO' description='REQUEST_FOR_POSITIONS_ACK'/>
182
+ <value enum='AP' description='POSITION_REPORT'/>
183
+ <value enum='AQ' description='TRADE_CAPTURE_REPORT_REQUEST_ACK'/>
184
+ <value enum='AR' description='TRADE_CAPTURE_REPORT_ACK'/>
185
+ <value enum='AS' description='ALLOCATION_REPORT'/>
186
+ <value enum='AT' description='ALLOCATION_REPORT_ACK'/>
187
+ <value enum='AU' description='CONFIRMATION_ACK'/>
188
+ <value enum='AV' description='SETTLEMENT_INSTRUCTION_REQUEST'/>
189
+ <value enum='AW' description='ASSIGNMENT_REPORT'/>
190
+ <value enum='AX' description='COLLATERAL_REQUEST'/>
191
+ <value enum='AY' description='COLLATERAL_ASSIGNMENT'/>
192
+ <value enum='AZ' description='COLLATERAL_RESPONSE'/>
193
+ <value enum='BA' description='COLLATERAL_REPORT'/>
194
+ <value enum='BB' description='COLLATERAL_INQUIRY'/>
195
+ <value enum='BC' description='NETWORK_STATUS_REQUEST'/>
196
+ <value enum='BD' description='NETWORK_STATUS_RESPONSE'/>
197
+ <value enum='BE' description='USER_REQUEST'/>
198
+ <value enum='BF' description='USER_RESPONSE'/>
199
+ <value enum='BG' description='COLLATERAL_INQUIRY_ACK'/>
200
+ <value enum='BH' description='CONFIRMATION_REQUEST'/>
201
+ <value enum='BI' description='TRADING_SESSION_LIST_REQUEST'/>
202
+ <value enum='BJ' description='TRADING_SESSION_LIST'/>
203
+ <value enum='BK' description='SECURITY_LIST_UPDATE_REPORT'/>
204
+ <value enum='BL' description='ADJUSTED_POSITION_REPORT'/>
205
+ <value enum='BM' description='ALLOCATION_INSTRUCTION_ALERT'/>
206
+ <value enum='BN' description='EXECUTION_ACKNOWLEDGEMENT'/>
207
+ <value enum='BO' description='CONTRARY_INTENTION_REPORT'/>
208
+ <value enum='BP' description='SECURITY_DEFINITION_UPDATE_REPORT'/>
209
+ </field>
210
+ <field name='NewSeqNo' number='36' type='SEQNUM'/>
211
+ <field name='PossDupFlag' number='43' type='BOOLEAN'/>
212
+ <field name='RefSeqNum' number='45' type='SEQNUM'/>
213
+ <field name='SenderCompID' number='49' type='STRING'/>
214
+ <field name='SenderSubID' number='50' type='STRING'/>
215
+ <field name='SendingTime' number='52' type='UTCTIMESTAMP'/>
216
+ <field name='TargetCompID' number='56' type='STRING'/>
217
+ <field name='TargetSubID' number='57' type='STRING'/>
218
+ <field name='Text' number='58' type='STRING'/>
219
+ <field name='Signature' number='89' type='DATA'/>
220
+ <field name='SecureDataLen' number='90' type='LENGTH'/>
221
+ <field name='SecureData' number='91' type='DATA'/>
222
+ <field name='SignatureLength' number='93' type='LENGTH'/>
223
+ <field name='RawDataLength' number='95' type='LENGTH'/>
224
+ <field name='RawData' number='96' type='DATA'/>
225
+ <field name='PossResend' number='97' type='BOOLEAN'/>
226
+ <field name='EncryptMethod' number='98' type='INT'>
227
+ <value description='NONE_OTHER' enum='0'/>
228
+ <value description='PKCS' enum='1'/>
229
+ <value description='DES' enum='2'/>
230
+ <value description='PKCS_DES' enum='3'/>
231
+ <value description='PGP_DES' enum='4'/>
232
+ <value description='PGP_DES_MD5' enum='5'/>
233
+ <value description='PEM_DES_MD5' enum='6'/>
234
+ </field>
235
+ <field name='HeartBtInt' number='108' type='INT'/>
236
+ <field name='TestReqID' number='112' type='STRING'/>
237
+ <field name='OnBehalfOfCompID' number='115' type='STRING'/>
238
+ <field name='OnBehalfOfSubID' number='116' type='STRING'/>
239
+ <field name='OrigSendingTime' number='122' type='UTCTIMESTAMP'/>
240
+ <field name='GapFillFlag' number='123' type='BOOLEAN'/>
241
+ <field name='DeliverToCompID' number='128' type='STRING'/>
242
+ <field name='DeliverToSubID' number='129' type='STRING'/>
243
+ <field name='ResetSeqNumFlag' number='141' type='BOOLEAN'/>
244
+ <field name='SenderLocationID' number='142' type='STRING'/>
245
+ <field name='TargetLocationID' number='143' type='STRING'/>
246
+ <field name='OnBehalfOfLocationID' number='144' type='STRING'/>
247
+ <field name='DeliverToLocationID' number='145' type='STRING'/>
248
+ <field name='XmlDataLen' number='212' type='LENGTH'/>
249
+ <field name='XmlData' number='213' type='DATA'/>
250
+ <field number='347' name='MessageEncoding' type='STRING'>
251
+ <value enum='ISO-2022-JP' description='ISO_2022_JP'/>
252
+ <value enum='EUC-JP' description='EUC_JP'/>
253
+ <value enum='SHIFT_JIS' description='SHIFT_JIS'/>
254
+ <value enum='UTF-8' description='UTF_8'/>
255
+ </field>
256
+ <field name='EncodedTextLen' number='354' type='LENGTH'/>
257
+ <field name='EncodedText' number='355' type='DATA'/>
258
+ <field name='LastMsgSeqNumProcessed' number='369' type='SEQNUM'/>
259
+ <field name='RefTagID' number='371' type='INT'/>
260
+ <field name='RefMsgType' number='372' type='STRING'/>
261
+ <field name='SessionRejectReason' number='373' type='INT'>
262
+ <value description='INVALID_TAG_NUMBER' enum='0'/>
263
+ <value description='REQUIRED_TAG_MISSING' enum='1'/>
264
+ <value description='SENDINGTIME_ACCURACY_PROBLEM' enum='10'/>
265
+ <value description='INVALID_MSGTYPE' enum='11'/>
266
+ <value description='XML_VALIDATION_ERROR' enum='12'/>
267
+ <value description='TAG_APPEARS_MORE_THAN_ONCE' enum='13'/>
268
+ <value description='TAG_SPECIFIED_OUT_OF_REQUIRED_ORDER' enum='14'/>
269
+ <value description='REPEATING_GROUP_FIELDS_OUT_OF_ORDER' enum='15'/>
270
+ <value description='INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP' enum='16'/>
271
+ <value description='NON_DATA_VALUE_INCLUDES_FIELD_DELIMITER' enum='17'/>
272
+ <value description='TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE' enum='2'/>
273
+ <value description='UNDEFINED_TAG' enum='3'/>
274
+ <value description='TAG_SPECIFIED_WITHOUT_A_VALUE' enum='4'/>
275
+ <value description='VALUE_IS_INCORRECT' enum='5'/>
276
+ <value description='INCORRECT_DATA_FORMAT_FOR_VALUE' enum='6'/>
277
+ <value description='DECRYPTION_PROBLEM' enum='7'/>
278
+ <value description='SIGNATURE_PROBLEM' enum='8'/>
279
+ <value description='COMPID_PROBLEM' enum='9'/>
280
+ <value description='OTHER' enum='99'/>
281
+ </field>
282
+ <field name='MaxMessageSize' number='383' type='LENGTH'/>
283
+ <field name='NoMsgTypes' number='384' type='NUMINGROUP'/>
284
+ <field name='MsgDirection' number='385' type='CHAR'>
285
+ <value description='RECEIVE' enum='R'/>
286
+ <value description='SEND' enum='S'/>
287
+ </field>
288
+ <field name='TestMessageIndicator' number='464' type='BOOLEAN'/>
289
+ <field name='Username' number='553' type='STRING'/>
290
+ <field name='Password' number='554' type='STRING'/>
291
+ <field name='NoHops' number='627' type='NUMINGROUP'/>
292
+ <field name='HopCompID' number='628' type='STRING'/>
293
+ <field name='HopSendingTime' number='629' type='UTCTIMESTAMP'/>
294
+ <field name='HopRefID' number='630' type='SEQNUM'/>
295
+ <field name='NextExpectedMsgSeqNum' number='789' type='SEQNUM'/>
296
+ <field name='ApplVerID' number='1128' type='STRING'>
297
+ <value description='FIX27' enum='0'/>
298
+ <value description='FIX30' enum='1'/>
299
+ <value description='FIX40' enum='2'/>
300
+ <value description='FIX41' enum='3'/>
301
+ <value description='FIX42' enum='4'/>
302
+ <value description='FIX43' enum='5'/>
303
+ <value description='FIX44' enum='6'/>
304
+ <value description='FIX50' enum='7'/>
305
+ <value description='FIX50SP1' enum='8'/>
306
+ <value description='FIX50SP2' enum='9'/>
307
+ </field>
308
+ <field name='CstmApplVerID' number='1129' type='STRING'/>
309
+ <field name='RefApplVerID' number='1130' type='STRING'/>
310
+ <field name='RefCstmApplVerID' number='1131' type='STRING'/>
311
+ <field name='DefaultApplVerID' number='1137' type='STRING'/>
312
+ </fields>
313
+ </fix>
@@ -0,0 +1,268 @@
1
+ require 'quickfix_ruby'
2
+ require 'test/unit'
3
+
4
+ class TooHigh < Quickfix::StringField
5
+ def initialize(data = nil)
6
+ if( data == nil )
7
+ super(501)
8
+ else
9
+ super(501, data)
10
+ end
11
+ end
12
+ end
13
+
14
+ class DataDictionaryTestCase < Test::Unit::TestCase
15
+
16
+ def setup
17
+ @object = Quickfix::DataDictionary.new()
18
+ assert_not_nil( @object )
19
+ end
20
+
21
+ def test_addMsgType
22
+ assert( !@object.isMsgType("A") )
23
+ @object.addMsgType("A")
24
+ assert( @object.isMsgType("A") )
25
+ end
26
+
27
+ def test_addMsgField
28
+ assert( !@object.isMsgField( "A", 10 ) )
29
+ assert( !@object.isMsgField( "Z", 50 ) )
30
+ @object.addMsgField( "A", 10 )
31
+ @object.addMsgField( "Z", 50 )
32
+ assert( @object.isMsgField( "A", 10 ) )
33
+ assert( @object.isMsgField( "Z", 50 ) )
34
+ assert( !@object.isMsgField( "A", 50 ) )
35
+ assert( !@object.isMsgField( "Z", 10 ) )
36
+ end
37
+
38
+ def test_addHeaderField
39
+ assert( !@object.isHeaderField( 56 ) )
40
+ assert( !@object.isHeaderField( 49 ) )
41
+ @object.addHeaderField( 56, true )
42
+ @object.addHeaderField( 49, true )
43
+ assert( @object.isHeaderField( 56 ) )
44
+ assert( @object.isHeaderField( 49 ) )
45
+ end
46
+
47
+ def test_addTrailerField
48
+ assert( !@object.isTrailerField( 10 ) )
49
+ @object.addTrailerField( 10, true )
50
+ assert( @object.isTrailerField( 10 ) )
51
+ end
52
+
53
+ def test_addRequiredField
54
+ assert( !@object.isRequiredField( "A", 10 ) )
55
+ assert( !@object.isRequiredField( "Z", 50 ) )
56
+ @object.addRequiredField( "A", 10 )
57
+ @object.addRequiredField( "Z", 50 )
58
+ assert( @object.isRequiredField( "A", 10 ) )
59
+ assert( @object.isRequiredField( "Z", 50 ) )
60
+ assert( !@object.isRequiredField( "A", 50 ) )
61
+ assert( !@object.isRequiredField( "Z", 10 ) )
62
+ end
63
+
64
+ def test_addFieldValue
65
+ assert( !@object.isFieldValue( 12, "f" ) )
66
+ assert( !@object.isFieldValue( 12, "g" ) )
67
+ assert( !@object.isFieldValue( 15, "1" ) )
68
+ assert( !@object.isFieldValue( 18, "2" ) )
69
+ assert( !@object.isFieldValue( 167, "FUT" ) )
70
+
71
+ @object.addFieldValue( 12, "f" )
72
+ @object.addFieldValue( 12, "g" )
73
+ @object.addFieldValue( 15, "1" )
74
+ @object.addFieldValue( 18, "2" )
75
+ @object.addFieldValue( 167, "FUT" )
76
+
77
+ assert( @object.isFieldValue( 12, "f" ) )
78
+ assert( @object.isFieldValue( 12, "g" ) )
79
+ assert( @object.isFieldValue( 15, "1" ) )
80
+ assert( @object.isFieldValue( 18, "2" ) )
81
+ assert( @object.isFieldValue( 167, "FUT" ) )
82
+ end
83
+
84
+ def test_addGroup
85
+ @object.setVersion( "FIX.4.2" )
86
+
87
+ group1 = Quickfix::DataDictionary.new
88
+ group1.addMsgType( "1" )
89
+ group2 = Quickfix::DataDictionary.new
90
+ group2.addMsgType( "2" )
91
+ group3 = Quickfix::DataDictionary.new
92
+ group3.addMsgType( "3" )
93
+
94
+ @object.addGroup( "A", 100, 101, group1 )
95
+ @object.addGroup( "A", 200, 201, group2 )
96
+ @object.addGroup( "A", 300, 301, group3 )
97
+
98
+ result = @object.getGroup( "A", 100 )
99
+ assert_equal( 101, result[0] )
100
+ assert( result[1].isMsgType( "1" ) )
101
+
102
+ result = @object.getGroup( "A", 200 )
103
+ assert_equal( 201, result[0] )
104
+ assert( result[1].isMsgType( "2" ) )
105
+
106
+ result = @object.getGroup( "A", 300 )
107
+ assert_equal( 301, result[0] )
108
+ assert( result[1].isMsgType( "3" ) )
109
+ end
110
+
111
+ def test_addFieldName
112
+ @object.setVersion( "FIX.4.2" )
113
+
114
+ @object.addFieldName( 1, "Account" )
115
+ @object.addFieldName( 11, "ClOrdID" )
116
+ @object.addFieldName( 8, "BeginString" )
117
+
118
+ s = String.new
119
+ @object.getFieldName(1)
120
+ assert_equal( "Account", @object.getFieldName(1) )
121
+ assert_equal( 1, @object.getFieldTag("Account") )
122
+ assert_equal( "ClOrdID", @object.getFieldName(11) )
123
+ assert_equal( 11, @object.getFieldTag("ClOrdID") )
124
+ assert_equal( "BeginString", @object.getFieldName(8) )
125
+ assert_equal( 8, @object.getFieldTag("BeginString") )
126
+ end
127
+
128
+ def test_addValueName
129
+ @object.setVersion( "FIX.4.2" )
130
+
131
+ @object.addValueName( 12, "0", "VALUE_12_0" )
132
+ @object.addValueName( 12, "B", "VALUE_12_B" )
133
+ @object.addValueName( 23, "BOO", "VALUE_23_BOO" )
134
+
135
+ assert_equal( "VALUE_12_0", @object.getValueName(12, "0") )
136
+ assert_equal( "VALUE_12_B", @object.getValueName(12, "B") )
137
+ assert_equal( "VALUE_23_BOO", @object.getValueName(23, "BOO") )
138
+ end
139
+
140
+ def test_checkValidTagNumber
141
+ @object.setVersion( Quickfix::BeginString_FIX40() )
142
+ @object.addField( Quickfix::BeginString.field )
143
+ @object.addField( Quickfix::BodyLength.field )
144
+ @object.addField( Quickfix::MsgType.field )
145
+ @object.addField( Quickfix::CheckSum.field )
146
+ @object.addField( Quickfix::TestReqID.field )
147
+ @object.addMsgType( Quickfix::MsgType_TestRequest() )
148
+ @object.addMsgField( Quickfix::MsgType_TestRequest(), Quickfix::TestReqID.field )
149
+
150
+ testReqID = Quickfix::TestReqID.new( "1" )
151
+ message = Quickfix40::TestRequest.new()
152
+ message.setField( testReqID )
153
+ message.setField( TooHigh.new( "value" ) )
154
+
155
+ begin
156
+ @object.validate( message )
157
+ assert( false )
158
+ rescue Quickfix::Exception
159
+ end
160
+
161
+ @object.addField( 501 )
162
+ @object.addMsgField( Quickfix::MsgType_TestRequest(), 501 )
163
+ begin
164
+ @object.validate( message )
165
+ rescue Quickfix::Exception
166
+ assert( false )
167
+ end
168
+
169
+ message.setField( 5000, "value" )
170
+ begin
171
+ @object.validate( message )
172
+ assert( false )
173
+ rescue Quickfix::Exception
174
+ end
175
+
176
+ @object.checkUserDefinedFields( false )
177
+ begin
178
+ @object.validate( message )
179
+ rescue Quickfix::Exception
180
+ assert( false )
181
+ end
182
+ end
183
+
184
+ def test_checkHasValue
185
+ message = Quickfix40::TestRequest.new
186
+ message.setField( Quickfix::TestReqID.new )
187
+
188
+ begin
189
+ @object.validate( message )
190
+ assert( false )
191
+ rescue Quickfix::Exception
192
+ end
193
+ end
194
+
195
+ def test_checkIsInMessage
196
+ @object.setVersion( Quickfix::BeginString_FIX40() )
197
+ @object.addField( Quickfix::BeginString.field )
198
+ @object.addField( Quickfix::BodyLength.field )
199
+ @object.addField( Quickfix::MsgType.field )
200
+ @object.addField( Quickfix::CheckSum.field )
201
+ @object.addField( Quickfix::TestReqID.field )
202
+ @object.addField( Quickfix::Symbol.field )
203
+ @object.addMsgType( Quickfix::MsgType_TestRequest() )
204
+ @object.addMsgField( Quickfix::MsgType_TestRequest(), Quickfix::TestReqID.field )
205
+
206
+ testReqID = Quickfix::TestReqID.new( "1" )
207
+
208
+ message = Quickfix40::TestRequest.new
209
+ message.setField( testReqID )
210
+ begin
211
+ @object.validate( message )
212
+ rescue Quickfix::Exception
213
+ assert( false )
214
+ end
215
+
216
+ message.setField( Quickfix::Symbol.new("MSFT") )
217
+ begin
218
+ @object.validate( message )
219
+ assert( false )
220
+ rescue Quickfix::Exception
221
+ end
222
+ end
223
+
224
+ def test_checkHasRequired
225
+ @object.setVersion( Quickfix::BeginString_FIX40() )
226
+ @object.addField( Quickfix::BeginString.field )
227
+ @object.addField( Quickfix::BodyLength.field )
228
+ @object.addField( Quickfix::MsgType.field )
229
+ @object.addField( Quickfix::SenderCompID.field )
230
+ @object.addField( Quickfix::TargetCompID.field )
231
+ @object.addHeaderField( Quickfix::SenderCompID.field, true )
232
+ @object.addHeaderField( Quickfix::TargetCompID.field, false )
233
+ @object.addField( Quickfix::CheckSum.field )
234
+ @object.addField( Quickfix::TestReqID.field )
235
+ @object.addMsgType( Quickfix::MsgType_TestRequest() )
236
+ @object.addMsgField( Quickfix::MsgType_TestRequest(), Quickfix::TestReqID.field )
237
+ @object.addRequiredField( Quickfix::MsgType_TestRequest(), Quickfix::TestReqID.field )
238
+
239
+ message = Quickfix40::TestRequest.new
240
+ begin
241
+ @object.validate( message )
242
+ assert( false )
243
+ rescue Quickfix::Exception
244
+ end
245
+
246
+ message.getHeader().setField( Quickfix::SenderCompID.new("SENDER") )
247
+ begin
248
+ @object.validate( message )
249
+ assert( false )
250
+ rescue Quickfix::Exception
251
+ end
252
+
253
+ message.setField( Quickfix::TestReqID.new( "1" ) )
254
+ begin
255
+ @object.validate( message )
256
+ rescue Quickfix::Exception
257
+ assert( false )
258
+ end
259
+
260
+ message.getHeader().removeField( Quickfix::SenderCompID.field )
261
+ message.setField( Quickfix::SenderCompID.new("SENDER") )
262
+ begin
263
+ @object.validate( message )
264
+ assert( false )
265
+ rescue Quickfix::Exception
266
+ end
267
+ end
268
+ end