Search in sources :

Example 6 with InvalidSelectorException

use of javax.jms.InvalidSelectorException in project qpid-broker-j by apache.

the class SelectorTest method invalidSelector.

@Test
public void invalidSelector() throws Exception {
    Connection connection = getConnection();
    Queue queue = createQueue(getTestName());
    try {
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        try {
            session.createConsumer(queue, INVALID_SELECTOR);
            fail("Exception not thrown");
        } catch (InvalidSelectorException e) {
        // PASS
        }
        try {
            session.createBrowser(queue, INVALID_SELECTOR);
            fail("Exception not thrown");
        } catch (InvalidSelectorException e) {
        // PASS
        }
    } finally {
        connection.close();
    }
}
Also used : InvalidSelectorException(javax.jms.InvalidSelectorException) Connection(javax.jms.Connection) Queue(javax.jms.Queue) Session(javax.jms.Session) Test(org.junit.Test)

Aggregations

InvalidSelectorException (javax.jms.InvalidSelectorException)6 Connection (javax.jms.Connection)4 Session (javax.jms.Session)4 Test (org.junit.Test)4 JMSException (javax.jms.JMSException)2 Enumeration (java.util.Enumeration)1 LinkedList (java.util.LinkedList)1 InvalidDestinationException (javax.jms.InvalidDestinationException)1 JMSSecurityException (javax.jms.JMSSecurityException)1 Message (javax.jms.Message)1 Queue (javax.jms.Queue)1 QueueBrowser (javax.jms.QueueBrowser)1 TextMessage (javax.jms.TextMessage)1 TopicConnection (javax.jms.TopicConnection)1 TopicSession (javax.jms.TopicSession)1 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 ActiveMQMessageConsumer (org.apache.activemq.ActiveMQMessageConsumer)1 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)1 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)1 QueueInfo (org.jaffa.modules.messaging.services.configdomain.QueueInfo)1