diff --git a/LCS/MessageBus/test/tPyMsgBus.py b/LCS/MessageBus/test/tPyMsgBus.py index e32c1f727ebe336086d15da005106e54d80c0864..8b88c1a98190fd82f9ca71794881f93092b73b4f 100644 --- a/LCS/MessageBus/test/tPyMsgBus.py +++ b/LCS/MessageBus/test/tPyMsgBus.py @@ -1,17 +1,25 @@ #!/usr/bin/python from lofar.messagebus.msgbus import FromBus, ToBus -from lofar.messagebus.message import Message +from lofar.messagebus.message import Message, MessageContent -# Send a message +# Send a message (send MessageContent) tbus = ToBus("test") -tmsg = Message() +tmsg = MessageContent() tmsg.payload = "foo" tbus.send(tmsg) # Receive it fbus = FromBus("test") fmsg = fbus.get(1) + +# Verify the content assert fmsg != None +assert fmsg.content().payload == "foo" + +# Resend it! (send Message) +tbus.send(fmsg) +rmsg = fbus.get(1) # Verify the content -assert fmsg.payload == "foo" +assert rmsg != None +assert rmsg.content().payload == "foo"