Exemple #1
0
 def test_error(self):
     from pyactivemq import ActiveMQConnectionFactory
     f = ActiveMQConnectionFactory()
     # set broker URL with an invalid port
     f.brokerURI = 'tcp://localhost:70000'
     try:
         conn = f.createConnection()
     except Exception:
         exctype, value = sys.exc_info()[:2]
         self.assert_(exctype is pyactivemq.CMSException)
Exemple #2
0
 def test_properties(self):
     from pyactivemq import ActiveMQConnectionFactory
     f1 = ActiveMQConnectionFactory()
     # default broker URL enables failover
     self.assertEqual('failover:(tcp://localhost:61616)', f1.brokerURI)
     self.assertEqual('', f1.username)
     self.assertEqual('', f1.password)
     f2 = ActiveMQConnectionFactory('url')
     self.assertEqual('url', f2.brokerURI)
     f3 = ActiveMQConnectionFactory('url', 'user')
     self.assertEqual('url', f3.brokerURI)
     self.assertEqual('user', f3.username)
     f4 = ActiveMQConnectionFactory('url', 'user', 'password')
     self.assertEqual('url', f4.brokerURI)
     self.assertEqual('user', f4.username)
     self.assertEqual('password', f4.password)
     f4.brokerURI = 'url2'
     f4.username = '******'
     f4.password = '******'
     self.assertEqual('url2', f4.brokerURI)
     self.assertEqual('user2', f4.username)
     self.assertEqual('password2', f4.password)