Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/165#discussion_r121760200
--- Diff: tests/system_tests_three_routers.py ---
@@ -335,36 +417,124 @@ def on_start ( self, event ):
self.client_receiver =
event.container.create_receiver(self.client_connection, None, dynamic=True)
+ def on_sendable ( self, event ):
+ if event.sender == self.sender :
+ while event.sender.credit > 0 and self.n_sent <
self.n_expected:
+ # We send to server, and tell it how to reply to the
client.
+ reply_to_addr = self.client_receiver.remote_source.address
- def on_sendable(self, event):
- while event.sender.credit > 0 and self.n_sent < self.n_expected:
- # We send to server, and tell it how to reply to the client.
- reply_to_addr = self.client_receiver.remote_source.address
-
- request = Message ( body=self.n_sent,
- address=self.dest,
- reply_to = reply_to_addr )
- event.sender.send ( request )
- self.n_sent += 1
+ request = Message ( body=self.n_sent,
+ address=self.dest,
+ reply_to = reply_to_addr )
+ event.sender.send ( request )
+ self.n_sent += 1
- def on_message(self, event):
+ def on_message ( self, event ):
# Server gets a request and responds to
# the address that is embedded in the message.
if event.receiver == self.server_receiver :
- self.server_sender.send (
Message(address=event.message.reply_to,
- body="Reply hazy, try again later.")
)
+ # pdb.set_trace()
self.received_by_server += 1
+ msg = Message(address=event.message.reply_to, body="Reply
hazy, try again later.")
+ self.server_sender.send ( msg )
# Client gets a response and counts it.
elif event.receiver == self.client_receiver :
self.received_by_client += 1
if self.received_by_client == self.n_expected:
- self.timer.cancel()
- self.server_receiver.close()
- self.client_receiver.close()
- self.client_connection.close()
- self.server_connection.close()
+ self.shutdown ( )
+
+
+ def run(self):
+ Container(self).run()
+
+
+
+
+
+class LinkRoute ( MessagingHandler ):
+
+ """
+ Set up and use a link-route, to send a message this way:
+ receiver <--- A <--- B <--- C <--- sender
+ """
+
+ def __init__ ( self, addr_listening_for_route_container,
linkroute_prefix, qdstat_address, send_address ):
+ super(LinkRoute, self).__init__(prefetch=0)
+ self.addr_listening_for_route_container =
addr_listening_for_route_container
+ self.send_address = send_address
+ self.linkroute_prefix = linkroute_prefix
+ self.qdstat_address = qdstat_address
+ self.error = None
+ self.send_connection = None
+ self.recv_connection = None
+ self.false_statement = "This is not the message you are looking
for."
--- End diff --
For anyone trying to understand how this test works, this text is
misleading.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]