spec/onstomp/full_stacks/test_broker.rb in onstomp-1.0.6 vs spec/onstomp/full_stacks/test_broker.rb in onstomp-1.0.7

- old
+ new

@@ -241,9 +241,65 @@ @connection.configure connect_frame, {} @processor.start end end + class SessionCloseBeforeConnect + def initialize server, sock + sock.close rescue nil + end + end + + class SessionCloseAfterConnect < Session10 + def initialize server, sock + @server = server + @socket = sock + init_events + init_connection + connect_frame = nil + @connection.io_process_read do |f| + connect_frame ||= f + end until connect_frame + @socket.close + end + end + + class SessionTimeoutAfterConnect < Session10 + def initialize server, sock + @server = server + @socket = sock + init_events + init_connection + connect_frame = nil + @connection.io_process_read do |f| + connect_frame ||= f + end until connect_frame + # Do not send a frame, do not close the connection, let it timeout + end + end + + class SessionBadFrameAfterConnect < Session10 + def initialize server, sock + @server = server + @socket = sock + init_events + init_connection + connect_frame = nil + @connection.io_process_read do |f| + connect_frame ||= f + end until connect_frame + reply_to_connect_with_crap + end + + def reply_to_connect_with_crap + connected_frame = nil + transmit OnStomp::Components::Frame.new('CRAPPY_FRAME') + @connection.io_process_write do |f| + connected_frame ||= f + end until connected_frame + end + end + class StompErrorOnConnectSession < Session10 end end class TestSSLBroker < TestBroker