amqp - JMSClientTest with browser

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1404980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2012-11-02 14:42:30 +00:00
parent 67744f7398
commit 6a253ebd3f
1 changed files with 13 additions and 2 deletions

View File

@ -23,6 +23,8 @@ import org.junit.Test;
import javax.jms.*; import javax.jms.*;
import java.util.Enumeration;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -44,11 +46,20 @@ public class JMSClientTest extends AmqpTestSupport {
msg.setObjectProperty("x", 1); msg.setObjectProperty("x", 1);
p.send(msg); p.send(msg);
// session.commit(); // session.commit();
MessageConsumer c = session.createConsumer(queue, "x = 1"); /* MessageConsumer c = session.createConsumer(queue, "x = 1");
Message received = c.receive(2000); Message received = c.receive(2000);
assertNotNull(received); assertNotNull(received);
System.out.println("first: " + ((TextMessage)received).getText()); System.out.println("first: " + ((TextMessage)received).getText());
System.out.println(received.getJMSRedelivered()); System.out.println(received.getJMSRedelivered());*/
QueueBrowser browser = session.createBrowser(queue);
Enumeration enumeration = browser.getEnumeration();
while (enumeration.hasMoreElements()) {
System.out.println("BROWSE " + enumeration.nextElement());
}
// session.rollback(); // session.rollback();
// //