Skip to content
Snippets Groups Projects
Commit 4ee8dc47 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

SW-516: fixed t_tbbserver for python3/qpid. Left the test in its original...

SW-516: fixed t_tbbserver for python3/qpid. Left the test in its original state of incompleteness. At least it passes now (nothing is really tested).
parent 9af94a74
No related branches found
No related tags found
No related merge requests found
......@@ -2,56 +2,21 @@
import unittest
import uuid
from qpid.messaging.exceptions import *
from lofar.messaging.messagebus import FromBus, ToBus
from lofar.messaging.messages import CommandMessage, EventMessage
from lofar.messaging.messagebus import TemporaryQueue
import logging
logger = logging.getLogger(__name__)
try:
from qpid.messaging import Connection
from qpidtoollibs import BrokerAgent
except ImportError:
print('Cannot run test without qpid tools')
print('Please source qpid profile')
exit(3)
#TODO: add tests for tbbservice
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
exit_code = 0
test_exchange_name = 't_tbbserver_test_exchange_%s' % uuid.uuid1()
connection = None
broker = None
with TemporaryQueue(__name__) as tmp_queue:
try:
# setup broker connection
connection = Connection.establish('127.0.0.1')
broker = BrokerAgent(connection)
# add test service exchanges/queues
logger.info('adding test exchange to broker: %s', test_exchange_name)
broker.addExchange('topic', test_exchange_name)
logger.warning("TODO: add tests for tbbservice!")
exit(3)
# and run all tests
unittest.main()
except ConnectError as ce:
logger.error(ce)
exit_code = 3
except Exception as e:
logger.error(e)
exit_code = 1
finally:
# cleanup test exchanges/queues and exit
if broker:
logger.info('removing test exchange from broker: %s', test_exchange_name)
broker.delExchange(test_exchange_name)
if connection:
connection.close()
exit(exit_code)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment