Package org.jboss.test.messaging.core

Examples of org.jboss.test.messaging.core.SimpleCondition


                                      sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         Message msg = CoreMessageFactory.createCoreMessage(1, true, null);

         MessageReference ref = ms.reference(msg);

         office1.route(ref, new SimpleCondition("queue1"), null);

         Thread.sleep(2000);

         //Messages should all be in queue1
View Full Code Here


                                      sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         Message msg = CoreMessageFactory.createCoreMessage(1, true, null);

         MessageReference ref = ms.reference(msg);

         office1.route(ref, new SimpleCondition("queue1"), null);

         Thread.sleep(2000);

         //Messages should all be in queue1
View Full Code Here

                                      sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         Message msg = CoreMessageFactory.createCoreMessage(1, true, null);

         MessageReference ref = ms.reference(msg);

         office1.route(ref, new SimpleCondition("queue1"), null);

         Thread.sleep(2000);

         //Messages should all be in queue1
View Full Code Here

         log.trace("Created postoffices");

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);

         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);

         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);

         log.trace("Created and bound queues");

         final int NUM_MESSAGES = 100;
View Full Code Here

                                      sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("queue1"), queue3);

         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office4.bindClusteredQueue(new SimpleCondition("queue1"), queue4);

         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm,
                                    true, recoverable, -1, null, tr);
         office5.bindClusteredQueue(new SimpleCondition("queue1"), queue5);

         final int NUM_MESSAGES = 100;

         this.sendMessages("queue1", persistent, office1, NUM_MESSAGES, null);
         this.sendMessages("queue1", persistent, office2, NUM_MESSAGES, null);
View Full Code Here

         office6 = createClusteredPostOfficeWithRRR(6, "testgroup", sc, ms, pm, tr);
        
         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("topic"), queue1);
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
        
         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("topic"), queue2);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
        
         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("topic"), queue3);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
        
         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office4.bindClusteredQueue(new SimpleCondition("topic"), queue4);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue4.add(receiver4);
        
         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office5.bindClusteredQueue(new SimpleCondition("topic"), queue5);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue5.add(receiver5);
        
         LocalClusteredQueue queue6 =
            new LocalClusteredQueue(office6, 6, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office6.bindClusteredQueue(new SimpleCondition("topic"), queue6);
         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue6.add(receiver6);
        
         log.info("setup");
              
View Full Code Here

         office6 = createClusteredPostOffice(6, "testgroup", sc, ms, pm, tr);
        
         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
        
         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
        
         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
        
         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue4.add(receiver4);
        
         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office6, 6, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue5.add(receiver5);
              
         List msgs = sendMessages("topic", persistent, office1, 1, null);        
         checkContainsAndAcknowledge(msgs, receiver1, queue1);        
View Full Code Here

         office6 = createClusteredPostOffice(6, "testgroup", sc, ms, pm, tr);
        
         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("topic"), queue1);
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
        
         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office3, 3, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("topic"), queue2);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
        
         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office4, 4, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office4.bindClusteredQueue(new SimpleCondition("topic"), queue3);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
        
         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office5, 5, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office5.bindClusteredQueue(new SimpleCondition("topic"), queue4);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue4.add(receiver4);
        
         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office6, 6, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
         office6.bindClusteredQueue(new SimpleCondition("topic"), queue5);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue5.add(receiver5);
              
         List msgs = sendMessages("topic", persistent, office2, 3, null);        
         checkContainsAndAcknowledge(msgs, receiver1, queue1);        
View Full Code Here

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "sub1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         Binding binding1 =
            office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);
        
         log.info("Added binding1");
        
         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office1, 1, "sub2", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         Binding binding2 =
            office1.bindClusteredQueue(new SimpleCondition("topic1"), queue2);
        
         log.info("Added binding2");
        
         // Start another office - make sure it picks up the bindings from the first node
        
         office2 = createClusteredPostOffice(2, "testgroup", sc, ms, pm, tr);
        
         log.info("Created office 2");
        
         Collection bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         Iterator iter = bindings.iterator();
         assertEquivalent(binding1, (Binding)iter.next());
         assertEquivalent(binding2, (Binding)iter.next());        
        
         // Add another binding on node 2
        
         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office2, 2, "sub3", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         Binding binding3 =
            office2.bindClusteredQueue(new SimpleCondition("topic1"), queue3);
 
         // Make sure both nodes pick it up
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(3, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding1, (Binding)iter.next());
         assertEquivalent(binding2, (Binding)iter.next());
         assertEquivalent(binding3, (Binding)iter.next());

         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(3, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding1, (Binding)iter.next());
         assertEquivalent(binding2, (Binding)iter.next());
         assertEquivalent(binding3, (Binding)iter.next());

         // Add another binding on node 1
        
         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office2, 2, "sub4", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         Binding binding4 =
            office2.bindClusteredQueue(new SimpleCondition("topic1"), queue4);
        
         // Make sure both nodes pick it up
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding1, (Binding)iter.next());
         assertEquivalent(binding2, (Binding)iter.next());
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding1, (Binding)iter.next());
         assertEquivalent(binding2, (Binding)iter.next());
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
        
         // Unbind binding 1 and binding 2
         office1.unbindClusteredQueue("sub1");
         office1.unbindClusteredQueue("sub2");
        
         // Make sure bindings are not longer available on either node
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
  
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());

         // Add a third office
                 
         office3 = createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);
        
         // Maks sure it picks up the bindings
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
        
         // Add another binding on node 3
                 
         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office3, 3, "sub5", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         Binding binding5 =
            office3.bindClusteredQueue(new SimpleCondition("topic1"), queue5);
        
         // Make sure all nodes pick it up
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(3, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(3, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(3, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
        
         // Add a durable and a non durable binding on node 1
        
         LocalClusteredQueue queue6 =
            new LocalClusteredQueue(office1, 1, "sub6", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
        
         Binding binding6 =
            office1.bindClusteredQueue(new SimpleCondition("topic1"), queue6);
        
         LocalClusteredQueue queue7 =
            new LocalClusteredQueue(office1, 1, "sub7", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         Binding binding7 =
            office1.bindClusteredQueue(new SimpleCondition("topic1"), queue7);
        
         // Make sure all nodes pick them up
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(5, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
         assertEquivalent(binding7, (Binding)iter.next());
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(5, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
         assertEquivalent(binding7, (Binding)iter.next());
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(5, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
         assertEquivalent(binding7, (Binding)iter.next());
              
         // Stop office 1
         office1.stop();
 
         // Need to sleep since it may take some time for the view changed request to reach the
         // members which causes the bindings to be removed.
        
         Thread.sleep(1000);
        
         // All it's non durable bindings should be removed from the other nodes.
         // Durable bindings should remain.
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding3, (Binding)iter.next());
         assertEquivalent(binding4, (Binding)iter.next());
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         // Stop office 2
         office2.stop();
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         // Restart office 1 and office 2
         office1 = createClusteredPostOffice(1, "testgroup", sc, ms, pm, tr);
        
         office2 = createClusteredPostOffice(2, "testgroup", sc, ms, pm, tr);
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(2, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding5, (Binding)iter.next());
         assertEquivalent(binding6, (Binding)iter.next());
        
         // Stop all offices
        
         office1.stop();
         office2.stop();
         office3.stop();
        
         // Start them all
         office1 = createClusteredPostOffice(1, "testgroup", sc, ms, pm, tr);
         office2 = createClusteredPostOffice(2, "testgroup", sc, ms, pm, tr);
         office3 = createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);
        
         // Only the durable queue should survive
        
         bindings = office1.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(1, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding6, (Binding)iter.next());
        
         bindings = office2.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(1, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding6, (Binding)iter.next());
        
         bindings = office3.listAllBindingsForCondition(new SimpleCondition("topic1"));
         assertNotNull(bindings);
         assertEquals(1, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent(binding6, (Binding)iter.next());
View Full Code Here

        
         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         office2.bindClusteredQueue(new SimpleCondition("queue1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         try
         {
            office1.bindClusteredQueue(new SimpleCondition("queue1"), queue3);
            fail();
         }
         catch (Exception e)
         {
            //Ok
         }

         LocalClusteredQueue queue4 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         try
         {
            office2.bindClusteredQueue(new SimpleCondition("queue1"), queue4);
            fail();
         }
         catch (Exception e)
         {
            //Ok
         }
        
         office2.unbindClusteredQueue("queue1");

         office1.unbindClusteredQueue("queue1");

         LocalClusteredQueue queue5 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);
        
         office1.bindClusteredQueue(new SimpleCondition("queue1"), queue5);
        
         PagingFilteredQueue queue6 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null);
         try
         {
            office1.bindQueue(new SimpleCondition("queue1"), queue6);
            fail();
         }
         catch (Exception e)
         {
            //ok
         }
         
         office1.unbindClusteredQueue("queue1");
        
         // It should be possible to bind queues locally into a clustered post office
         LocalClusteredQueue queue7 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         office1.bindQueue(new SimpleCondition("queue1"), queue7);
        
         LocalClusteredQueue queue8 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         office2.bindQueue(new SimpleCondition("queue1"), queue8);
        
         LocalClusteredQueue queue9 =
            new LocalClusteredQueue(office2, 2, "queue1", channelIDManager.getID(), ms, pm,
                                    true, false, -1, null, tr);

         try
         {
            office1.bindQueue(new SimpleCondition("queue1"), queue9);
            fail();
         }
         catch (Exception e)
         {
            //Ok
View Full Code Here

TOP

Related Classes of org.jboss.test.messaging.core.SimpleCondition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.