[
https://issues.apache.org/jira/browse/DISPATCH-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048252#comment-16048252
]
ASF GitHub Bot commented on DISPATCH-209:
-----------------------------------------
Github user ted-ross commented on a diff in the pull request:
https://github.com/apache/qpid-dispatch/pull/165#discussion_r121760979
--- 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."
+
+
+ def timeout(self):
+ self.error = "Timeout Expired"
+ self.shutdown ( )
+
+
+ def shutdown ( self ) :
+ self.recv_connection.close()
+ self.send_connection.close()
+ self.timer.cancel()
+ self.timer = None
+
+
+ def on_start(self, event):
+ # Iff this timer expires, the test fails.
+ self.timer = event.reactor.schedule ( 5, Timeout(self) )
+
+ # Create the receiver only at start time.
+ # Sender-creation has to wait until we know that the address is
available.
+ self.recv_connection = event.container.connect (
self.addr_listening_for_route_container )
+ self.receiver = event.container.create_receiver (
self.recv_connection, None, dynamic=True )
--- End diff --
Why is this receiver here? It serves no purpose in the test.
> Three+ router test is needed in the system test suite.
> ------------------------------------------------------
>
> Key: DISPATCH-209
> URL: https://issues.apache.org/jira/browse/DISPATCH-209
> Project: Qpid Dispatch
> Issue Type: New Feature
> Components: Tests
> Reporter: Ted Ross
> Assignee: michael goulish
> Fix For: 1.0.0
>
>
> There have arisen some issues that would have been caught had there been a
> three-router test in the regression suite. This test should be added.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]