@@ -64,46 +64,46 @@ def echo_message(self, body):
6464 self .assertEqual (len (body ), len (msg .content .body ))
6565 self .assertEqual (body , msg .content .body )
6666
67- def test_large_message_received_in_many_content_frames (self ):
68- if self .client .conn .FRAME_MIN_SIZE == self .frame_max_size :
69- raise Skipped ("Test requires that frame_max_size (%d) exceeds frame_min_size (%d)" % (self .frame_max_size , self .frame_max_size ))
67+ def test_large_message_received_in_many_content_frames (self ):
68+ if self .client .conn .FRAME_MIN_SIZE == self .frame_max_size :
69+ raise Skipped ("Test requires that frame_max_size (%d) exceeds frame_min_size (%d)" % (self .frame_max_size , self .frame_max_size ))
7070
71- channel = self .channel
71+ channel = self .channel
7272
73- queue_name = "q"
74- self .queue_declare (queue = queue_name )
73+ queue_name = "q"
74+ self .queue_declare (queue = queue_name )
7575
76- channel .tx_select ()
76+ channel .tx_select ()
7777
78- body = self .randomLongString ()
79- channel .basic_publish (
80- content = Content (body ),
81- routing_key = queue_name )
82- channel .tx_commit ()
78+ body = self .randomLongString ()
79+ channel .basic_publish (
80+ content = Content (body ),
81+ routing_key = queue_name )
82+ channel .tx_commit ()
8383
84- consuming_client = None
85- try :
86- # Create a second connection with minimum framesize. The Broker will then be forced to chunk
87- # the content in order to send it to us.
88- consuming_client = qpid .client .Client (self .config .broker .host , self .config .broker .port )
89- tune_params = { "frame_max" : self .client .conn .FRAME_MIN_SIZE }
90- consuming_client .start (username = self .config .broker .user , password = self .config .broker .password , tune_params = tune_params )
91-
92- consuming_channel = consuming_client .channel (1 )
93- consuming_channel .channel_open ()
94- consuming_channel .tx_select ()
95-
96- consumer_reply = consuming_channel .basic_consume (queue = queue_name , no_ack = False )
97- consumer = consuming_client .queue (consumer_reply .consumer_tag )
98- msg = consumer .get (timeout = 1 )
99- consuming_channel .basic_ack (delivery_tag = msg .delivery_tag )
100- consuming_channel .tx_commit ()
101-
102- self .assertEqual (len (body ), len (msg .content .body ))
103- self .assertEqual (body , msg .content .body )
104- finally :
105- if consuming_client :
106- consuming_client .close ()
84+ consuming_client = None
85+ try :
86+ # Create a second connection with minimum framesize. The Broker will then be forced to chunk
87+ # the content in order to send it to us.
88+ consuming_client = qpid .client .Client (self .config .broker .host , self .config .broker .port )
89+ tune_params = { "frame_max" : self .client .conn .FRAME_MIN_SIZE }
90+ consuming_client .start (username = self .config .broker .user , password = self .config .broker .password , tune_params = tune_params )
91+
92+ consuming_channel = consuming_client .channel (1 )
93+ consuming_channel .channel_open ()
94+ consuming_channel .tx_select ()
95+
96+ consumer_reply = consuming_channel .basic_consume (queue = queue_name , no_ack = False )
97+ consumer = consuming_client .queue (consumer_reply .consumer_tag )
98+ msg = consumer .get (timeout = 1 )
99+ consuming_channel .basic_ack (delivery_tag = msg .delivery_tag )
100+ consuming_channel .tx_commit ()
101+
102+ self .assertEqual (len (body ), len (msg .content .body ))
103+ self .assertEqual (body , msg .content .body )
104+ finally :
105+ if consuming_client :
106+ consuming_client .close ()
107107
108108 def test_commit_ok_possibly_interleaved_with_message_delivery (self ):
109109 """This test exposes an defect on the Java Broker (QPID-6094). The Java Broker (0.32 and below)
0 commit comments