Skip to content

Commit 0f3ec7b

Browse files
authored
Merge pull request #668 from ackleymi/add-missing-test-defs
Adds NextExpectedSeqNum setting
2 parents 5ec1219 + fdcb6a1 commit 0f3ec7b

30 files changed

+490
-30
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -241,32 +241,32 @@ jobs:
241241
ACCEPTANCE_SET: lastseqnumprocessed
242242
run: make generate-ci && make build && make $FIX_TEST
243243

244-
# nextexpectedseqnum:
245-
# name: NextExpectedSeqNum Suite
246-
# runs-on: ubuntu-latest
247-
# strategy:
248-
# matrix:
249-
# go: [1.21]
250-
# fix-version:
251-
# - fix44
252-
# - fix50
253-
# - fix50sp1
254-
# - fix50sp2
255-
# steps:
256-
# - name: Setup
257-
# uses: actions/setup-go@v2
258-
# with:
259-
# go-version: ${{ matrix.go }}
260-
# - name: Check out source
261-
# uses: actions/checkout@v2
262-
# - name: Install ruby
263-
# uses: ruby/setup-ruby@v1
264-
# with:
265-
# ruby-version: '3.0'
266-
# - name: Acceptance test
267-
# env:
268-
# GO111MODULE: on
269-
# FIX_TEST: ${{ matrix.fix-version }}
270-
# STORE_TYPE: memory
271-
# ACCEPTANCE_SET: nextexpectedseqnum
272-
# run: make generate-ci && make build && make $FIX_TEST
244+
nextexpectedseqnum:
245+
name: NextExpectedSeqNum Suite
246+
runs-on: ubuntu-latest
247+
strategy:
248+
matrix:
249+
go: [1.21]
250+
fix-version:
251+
- fix44
252+
- fix50
253+
- fix50sp1
254+
- fix50sp2
255+
steps:
256+
- name: Setup
257+
uses: actions/setup-go@v2
258+
with:
259+
go-version: ${{ matrix.go }}
260+
- name: Check out source
261+
uses: actions/checkout@v2
262+
- name: Install ruby
263+
uses: ruby/setup-ruby@v1
264+
with:
265+
ruby-version: '3.0'
266+
- name: Acceptance test
267+
env:
268+
GO111MODULE: on
269+
FIX_TEST: ${{ matrix.fix-version }}
270+
STORE_TYPE: memory
271+
ACCEPTANCE_SET: nextexpectedseqnum
272+
run: make generate-ci && make build && make $FIX_TEST

_test/Reflector.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def processLine(lineNum, line, body, cid)
6161
connectAction(cid)
6262
elsif body == "DISCONNECT"
6363
disconnectAction(cid)
64+
elsif body.index("SET_SESSION") == 0
65+
setSeqnum(body)
6466
else
6567
raise "Syntax error: " + body
6668
end

_test/ReflectorClient.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
require 'Reflector'
2020
require 'FixParser'
2121
require "socket"
22+
require 'uri'
23+
require 'net/http'
2224

2325
class ReflectorClient
2426

@@ -62,6 +64,12 @@ def @reflector.disconnectAction(cid)
6264
@sockets.delete(cid)
6365
@parsers.delete(cid)
6466
end
67+
68+
def @reflector.setSeqnum(body)
69+
left_array = body.split(" ")
70+
uri = URI('http://localhost:8095/seqnum?SESSION='+left_array[1]+'&'+left_array[2])
71+
Net::HTTP.get_response(uri)
72+
end
6573

6674
def @reflector.waitConnectAction(cid)
6775
end
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[DEFAULT]
2+
SocketAcceptPort=5005
3+
SenderCompID=ISLD
4+
TargetCompID=TW
5+
FileLogPath=tmp
6+
7+
[SESSION]
8+
BeginString=FIX.4.4
9+
DataDictionary=../spec/FIX44.xml
10+
EnableNextExpectedMsgSeqNum=Y
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[DEFAULT]
2+
SocketAcceptPort=5006
3+
SenderCompID=ISLD
4+
TargetCompID=TW
5+
FileLogPath=tmp
6+
7+
[SESSION]
8+
BeginString=FIXT.1.1
9+
DefaultApplVerID=FIX.5.0
10+
TransportDataDictionary=../spec/FIXT11.xml
11+
AppDataDictionary=../spec/FIX50.xml
12+
EnableNextExpectedMsgSeqNum=Y
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[DEFAULT]
2+
SocketAcceptPort=5007
3+
SenderCompID=ISLD
4+
TargetCompID=TW
5+
FileLogPath=tmp
6+
7+
[SESSION]
8+
BeginString=FIXT.1.1
9+
DefaultApplVerID=FIX.5.0SP1
10+
TransportDataDictionary=../spec/FIXT11.xml
11+
AppDataDictionary=../spec/FIX50SP1.xml
12+
EnableNextExpectedMsgSeqNum=Y
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[DEFAULT]
2+
SocketAcceptPort=5008
3+
SenderCompID=ISLD
4+
TargetCompID=TW
5+
FileLogPath=tmp
6+
7+
[SESSION]
8+
BeginString=FIXT.1.1
9+
DefaultApplVerID=FIX.5.0SP2
10+
TransportDataDictionary=../spec/FIXT11.xml
11+
AppDataDictionary=../spec/FIX50SP2.xml
12+
EnableNextExpectedMsgSeqNum=Y
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
iCONNECT
2+
3+
#------------------------
4+
# logon message and response
5+
# send logon with sequence number equals to 1
6+
# expect for a logon response with NextExpectedMsgSeqNum field equals to 2
7+
#------------------------
8+
9+
I8=FIX.4.435=A34=149=TW52=<TIME>56=ISLD98=0789=1108=2
10+
E8=FIX.4.49=6635=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=2789=210=0
11+
12+
# logout message and response
13+
I8=FIX.4.435=534=249=TW52=<TIME>56=ISLD
14+
E8=FIX.4.49=4935=534=249=ISLD52=00000000-00:00:00.00056=TW10=0
15+
16+
eDISCONNECT
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# If message NextExpectedMsgSeqNum field is too high, we must disconnect
2+
3+
iCONNECT
4+
iSET_SESSION FIX.4.4:ISLD->TW NEXTSENDERSEQNUM=1
5+
iSET_SESSION FIX.4.4:ISLD->TW NEXTTARGETSEQNUM=1
6+
7+
I8=FIX.4.435=A34=100049=TW52=<TIME>56=ISLD98=0789=1200108=30
8+
9+
E8=FIX.4.49=13535=534=149=ISLD52=00000000-00:00:00.00056=TW58=Tag 789 (NextExpectedMsgSeqNum) is higher than expected. Expected 1, Received 120010=0
10+
eDISCONNECT
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
iCONNECT
2+
iSET_SESSION FIX.4.4:ISLD->TW NEXTSENDERSEQNUM=2000
3+
iSET_SESSION FIX.4.4:ISLD->TW NEXTTARGETSEQNUM=1
4+
5+
I8=FIX.4.435=A34=149=TW52=<TIME>56=ISLD98=0789=1108=30
6+
7+
E8=FIX.4.49=7035=A34=200049=ISLD52=00000000-00:00:00.00056=TW98=0108=30789=210=0
8+
E8=FIX.4.49=9435=434=143=Y49=ISLD52=<TIME>56=TW122=<TIME>36=2001123=Y
9+
10+
# logout message and response
11+
I8=FIX.4.435=534=249=TW52=<TIME>56=ISLD
12+
E8=FIX.4.49=5235=534=200149=ISLD52=00000000-00:00:00.00056=TW10=0
13+
14+
eDISCONNECT

0 commit comments

Comments
 (0)