Package javax.jms

Examples of javax.jms.MessageConsumer.receiveNoWait()


           assertNotNull(m);
          
           assertEquals("john", m.getStringProperty("beatle"));
        }
 
        Message m = cons1.receiveNoWait();
 
        assertNull(m);
       
        String selector2 = "beatle = 'kermit the frog'";
       
View Full Code Here


           assertNotNull(m);
          
           assertEquals("kermit the frog", m.getStringProperty("beatle"));
        }
       
        m = cons2.receiveNoWait();
 
        assertNull(m);
      }
      finally
      {
View Full Code Here

           assertNotNull(m);
 
           assertEquals("john", m.getStringProperty("beatle"));
        }
 
        Message m = cons1.receiveNoWait();
       
        assertNull(m);
 
        String selector2 = "beatle = 'kermit the frog'";
 
View Full Code Here

              Message m = cons1.receive(1000);
 
              assertNotNull(m);
           }
 
           Message m = cons1.receiveNoWait();
 
           assertNull(m);
          
           sess.close();
        }
View Full Code Here

              Message m = cons1.receive(1000);
             
              assertNotNull(m);
           }
 
           Message m = cons1.receiveNoWait();
 
           assertNull(m);
          
           sess.close();
        }
View Full Code Here

         Object ms = cons.receive();
         assertTrue(ms instanceof TextMessage);
         assertEquals(((TextMessage)ms).getText(), MESSAGE_TWO);
         Thread.sleep(500);
         assertNull(cons.receiveNoWait());
         conn.close();
      }
      finally
      {
         ServerManagement.undeployQueue("QueueRemoveMessages");
View Full Code Here

        Message message = null;
        for (int i = 0; i < 4; i++) {
            message = consumer.receive(1000);
            assertNotNull(message);
        }
        assertNull(consumer.receiveNoWait());
        message.acknowledge();
    }

    public void initCombosForTestDurableConsumerSelectorChange() {
        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
View Full Code Here

        // Selector should skip the 2nd message.
        m = consumer.receive(1000);
        assertNotNull(m);
        assertEquals("3rd", ((TextMessage)m).getText());

        assertNull(consumer.receiveNoWait());
    }

    public void initCombosForTestSendReceiveBytesMessage() {
        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),
View Full Code Here

        BytesMessage m = (BytesMessage)consumer.receive(1000);
        assertNotNull(m);
        assertTrue(m.readBoolean());
        assertFalse(m.readBoolean());

        assertNull(consumer.receiveNoWait());
    }

    public void initCombosForTestSetMessageListenerAfterStart() {
        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
        addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE), Byte.valueOf(ActiveMQDestination.TOPIC_TYPE),
View Full Code Here

        for (int i = 0; i < 2; i++) {
            message = consumer.receive(1000);
            assertNotNull(message);
        }
        message.acknowledge();
        assertNull(consumer.receiveNoWait());

    }

    public void initCombosForTestPrefetch1MessageNotDispatched() {
        addCombinationValues("deliveryMode", new Object[] {Integer.valueOf(DeliveryMode.NON_PERSISTENT), Integer.valueOf(DeliveryMode.PERSISTENT)});
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.