Package javax.jms

Examples of javax.jms.MessageConsumer.receiveNoWait()


            TextMessage tm = (TextMessage)cons.receive(10000);
            Assert.assertNotNull(tm);
            Assert.assertEquals("message" + i, tm.getText());
         }

         Message m = cons.receiveNoWait();
         Assert.assertNull(m);
      }
      finally
      {
         if (connSource != null)
View Full Code Here


            Assert.assertNotNull(tm);

            Assert.assertEquals("message" + i, tm.getText());
         }

         Message m = cons.receiveNoWait();

         Assert.assertNull(m);

      }
      finally
View Full Code Here

         TextMessage t = (TextMessage)cons.receive(1000);
         ProxyAssertSupport.assertNotNull(t);
         ProxyAssertSupport.assertEquals("c", t.getText());
      }
      {
         TextMessage t = (TextMessage)cons.receiveNoWait();
         ProxyAssertSupport.assertNull(t);
      }

      conn.close();
   }
View Full Code Here

      // Give the message enough time to reach the consumer

      Thread.sleep(2000);

      {
         TextMessage t = (TextMessage)cons.receiveNoWait();
         ProxyAssertSupport.assertNull(t);
      }

      conn.close();
   }
View Full Code Here

      Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
      connection.start();

      MessageConsumer consumer = JMSUtil.createConsumer(connection, queue);
      Assert.assertNull(consumer.receiveNoWait());

      connection.close();
   }

   public void testRemoveMatchingMessages() throws Exception
View Full Code Here

      message = consumer.receive(500);
      Assert.assertNotNull(message);
      Assert.assertEquals(msg_2.getJMSMessageID(), message.getJMSMessageID());
      Assert.assertEquals(unmatchingValue, message.getLongProperty(key));

      Assert.assertNull(consumer.receiveNoWait());

      connection.close();
   }

   public void testGetExpiryAddress() throws Exception
View Full Code Here

      connection.start();
      MessageConsumer consumer = session.createConsumer(queue);
      Message message = consumer.receive(500);
      Assert.assertNotNull(message);
      Assert.assertEquals(unmatchingValue, message.getLongProperty(key));
      Assert.assertNull(consumer.receiveNoWait());

      JMSUtil.consumeMessages(1, otherQueue);

      serverManager.destroyQueue(otherQueueName);
View Full Code Here

        MessageConsumer consumer = _session.createConsumer(_queue);

        _connection.start();

        //Start the dispatcher & Unflow the channel.
        consumer.receiveNoWait();

        //Fill the prefetch and two extra so that our receive bellow allows the
        // subscription to become active
        // Previously we set this to 17 so that it would return to a suspended
        // state. However, testing has shown that the state change can occur
View Full Code Here

        // Start the consumer pre-fetching
        // Don't care about response as we will fill the broker up with messages
        // after this point and ensure that the client is disconnected at the
        // right point.
        consumer.receiveNoWait();
        startPublisher(_destination);

        boolean disconnected = _disconnectionLatch.await(DISCONNECTION_WAIT, TimeUnit.SECONDS);
       
        assertTrue("Client was not disconnected", disconnected);
View Full Code Here

           assertNotNull(m);
        }
 
        Thread.sleep(500);
 
        Message m = cons1.receiveNoWait();
 
        assertNull(m);
      }
      finally
      {
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.