diff --git a/MAC/Services/TBB/TBBServer/test/t_tbbserver.py b/MAC/Services/TBB/TBBServer/test/t_tbbserver.py index 35c946f74b83dc42c682a4bb706971fe939c4b04..a3d6d4340add963968cfa0a206ac75e0cacbcd3f 100755 --- a/MAC/Services/TBB/TBBServer/test/t_tbbserver.py +++ b/MAC/Services/TBB/TBBServer/test/t_tbbserver.py @@ -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 - - try: - # setup broker connection - connection = Connection.establish('127.0.0.1') - broker = BrokerAgent(connection) + with TemporaryQueue(__name__) as tmp_queue: - # 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)