Skip to content

Commit

Permalink
Do not change acceptance test definition
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Thibault <[email protected]>
  • Loading branch information
alexppxela committed Aug 9, 2023
1 parent 9ce948f commit 216c3e3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 26 deletions.
4 changes: 1 addition & 3 deletions _test/Reflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def processLine(lineNum, line, body, cid)
if body == "CONNECT"
waitConnectAction(cid)
elsif body == "DISCONNECT"
waitDisconnectAction(cid, false)
elsif body == "DISCONNECT_OR_ALREADY_DISCONNECTED"
waitDisconnectAction(cid, true)
waitDisconnectAction(cid)
else
raise "Syntax error: " + body
end
Expand Down
4 changes: 2 additions & 2 deletions _test/ReflectorClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def @reflector.disconnectAction(cid)
def @reflector.waitConnectAction(cid)
end

def @reflector.waitDisconnectAction(cid, canBeDisconnectedByPeer)
def @reflector.waitDisconnectAction(cid)
begin
socket = @sockets[cid]
if IO.select([socket], nil, nil, 10) == nil then
Expand All @@ -75,7 +75,7 @@ def @reflector.waitDisconnectAction(cid, canBeDisconnectedByPeer)
raise "Expected disconnection, got data"
end
rescue Errno::ECONNRESET
raise unless canBeDisconnectedByPeer
# Ignore, server has already disconnected the socket
end
end

Expand Down
9 changes: 4 additions & 5 deletions _test/ReflectorServer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,20 @@ def @reflector.waitConnectAction(cid)
@server.waitConnectAction
end

def @reflector.waitDisconnectAction(cid, canBeDisconnectedByPeer)
def @reflector.waitDisconnectAction(cid)
begin
if IO.select([@socket], nil, nil, 10) == nil then
raise "Connection hangs after five seconds."
elsif !@socket.eof? then
raise "Expected disconnection, got data"
end
rescue Errno::ECONNRESET => e
unless canBeDisconnectedByPeer
raise
end
rescue Errno::ECONNRESET
# Ignore, client has already disconnected the socket
end
end

end

def connectAction(s)
if @socket == nil
@socket = s
Expand Down
11 changes: 3 additions & 8 deletions _test/ReflectorTestCase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,9 @@ def reflector.waitConnectAction(cid)
@econ += cid.to_s + "," + "eCONNECT" + "|"
end

def reflector.waitDisconnectAction(cid, canBeDisconnectedByPeer)
if canBeDisconnectedByPeer then
@cum += cid.to_s + "," + "eDISCONNECT_OR_ALREADY_DISCONNECTED" + "|"
@edis += cid.to_s + "," + "eDISCONNECT_OR_ALREADY_DISCONNECTED" + "|"
else
@cum += cid.to_s + "," + "eDISCONNECT" + "|"
@edis += cid.to_s + "," + "eDISCONNECT" + "|"
end
def reflector.waitDisconnectAction(cid)
@cum += cid.to_s + "," + "eDISCONNECT" + "|"
@edis += cid.to_s + "," + "eDISCONNECT" + "|"
end

def reflector.errorAction(lineNum, msg)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ E8=FIXT.1.19=9935=334=449=ISLD52=00000000-00:00:00.00056=TW45=258=Sendin
# logout message
E8=FIXT.1.19=4935=534=549=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=449=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ E8=FIXT.1.19=6835=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3011
I8=FIX.4.135=134=249=TW52=<TIME>56=ISLD112=id
E8=FIXT.1.19=7435=534=249=ISLD52=00000000-00:00:00.00056=TW58=Incorrect BeginString10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT

iCONNECT
I8=FIXT.1.135=A34=149=TW52=<TIME>56=ISLD98=0108=301137=9
Expand All @@ -17,4 +17,4 @@ E8=FIXT.1.19=6835=A34=149=ISLD52=00000000-00:00:00.00056=TW98=0108=3011
# Send with incorrect begin string and don't respond to logout
I8=FIX.4.135=134=249=TW52=<TIME>56=ISLD112=id
E8=FIXT.1.19=7435=534=249=ISLD52=00000000-00:00:00.00056=TW58=Incorrect BeginString10=0
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ E8=FIXT.1.19=8435=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=CompID
# logout message
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT

# TargetCompID is invalid

Expand All @@ -28,7 +28,7 @@ E8=FIXT.1.19=8435=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=CompID
# logout message
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT

# SenderCompID and TargetCompID is invalid

Expand All @@ -44,4 +44,4 @@ E8=FIXT.1.19=8435=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=CompID
# logout message
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ I8=FIXT.1.135=034=249=TW52=<TIME-121>56=ISLD
E8=FIXT.1.19=9935=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=SendingTime accuracy problem372=0373=1010=0
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT

# SendingTime is too large, reject

Expand All @@ -26,4 +26,4 @@ I8=FIXT.1.135=034=249=TW52=<TIME+121>56=ISLD
E8=FIXT.1.19=9935=334=249=ISLD52=00000000-00:00:00.00056=TW45=258=SendingTime accuracy problem372=0373=1010=0
E8=FIXT.1.19=4935=534=349=ISLD52=00000000-00:00:00.00056=TW10=0
I8=FIXT.1.135=534=349=TW52=<TIME>56=ISLD
eDISCONNECT_OR_ALREADY_DISCONNECTED
eDISCONNECT

0 comments on commit 216c3e3

Please sign in to comment.