Пример #1
0
 def _node_disambiguation_precreated(self, ambiguous_send):
     agent = BrokerAgent(self.conn)
     agent.addExchange("fanout", "ambiguous")
     agent.addQueue("ambiguous")
     try:
         r1 = self.ssn.receiver("ambiguous; {node:{type:topic}}")
         r2 = self.ssn.receiver("ambiguous; {node:{type:queue}}")
         self._node_disambiguation_test(r1, r2, ambiguous_send=ambiguous_send)
     finally:
         agent.delExchange("ambiguous")
         agent.delQueue("ambiguous", False, False)
Пример #2
0
 def test_ambiguous_delete_2(self):
     agent = BrokerAgent(self.conn)
     agent.addExchange("fanout", "ambiguous")
     agent.addQueue("ambiguous")
     self.ssn.receiver("ambiguous; {delete:receiver, node:{type:queue}}").close()
     exchange = agent.getExchange("ambiguous")
     queue = agent.getQueue("ambiguous")
     try:
         assert(exchange)
         assert(not queue)
     finally:
         if exchange: agent.delExchange("ambiguous")
         if queue: agent.delQueue("ambiguous", False, False)
Пример #3
0
 def _node_disambiguation_precreated(self, ambiguous_send):
     agent = BrokerAgent(self.conn)
     agent.addExchange("fanout", "ambiguous")
     agent.addQueue("ambiguous")
     try:
         r1 = self.ssn.receiver("ambiguous; {node:{type:topic}}")
         r2 = self.ssn.receiver("ambiguous; {node:{type:queue}}")
         self._node_disambiguation_test(r1,
                                        r2,
                                        ambiguous_send=ambiguous_send)
     finally:
         agent.delExchange("ambiguous")
         agent.delQueue("ambiguous", False, False)
Пример #4
0
 def test_ambiguous_create_2(self):
     #create exchange first, then queue
     r1 = self.ssn.receiver("ambiguous; {create:receiver, node:{type:topic}}")
     r2 = self.ssn.receiver("ambiguous; {create:receiver, node:{type:queue}}")
     agent = BrokerAgent(self.conn)
     exchange = agent.getExchange("ambiguous")
     queue = agent.getQueue("ambiguous")
     try:
         assert(exchange)
         assert(queue)
         self._node_disambiguation_test(r1, r2)
     finally:
         if exchange: agent.delExchange("ambiguous")
         if queue: agent.delQueue("ambiguous", False, False)
Пример #5
0
 def test_ambiguous_delete_2(self):
     agent = BrokerAgent(self.conn)
     agent.addExchange("fanout", "ambiguous")
     agent.addQueue("ambiguous")
     self.ssn.receiver(
         "ambiguous; {delete:receiver, node:{type:queue}}").close()
     exchange = agent.getExchange("ambiguous")
     queue = agent.getQueue("ambiguous")
     try:
         assert (exchange)
         assert (not queue)
     finally:
         if exchange: agent.delExchange("ambiguous")
         if queue: agent.delQueue("ambiguous", False, False)
Пример #6
0
 def test_ambiguous_create_2(self):
     #create exchange first, then queue
     r1 = self.ssn.receiver(
         "ambiguous; {create:receiver, node:{type:topic}}")
     r2 = self.ssn.receiver(
         "ambiguous; {create:receiver, node:{type:queue}}")
     agent = BrokerAgent(self.conn)
     exchange = agent.getExchange("ambiguous")
     queue = agent.getQueue("ambiguous")
     try:
         assert (exchange)
         assert (queue)
         self._node_disambiguation_test(r1, r2)
     finally:
         if exchange: agent.delExchange("ambiguous")
         if queue: agent.delQueue("ambiguous", False, False)