}
public void testUnparsableSelectors() throws Exception
{
AMQSession session = (AMQSession) _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
boolean caught = false;
//Try Creating a Browser
try
{
session.createBrowser(session.createQueue("Ping"), INVALID_SELECTOR);
}
catch (JMSException e)
{
_logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
if (!(e instanceof InvalidSelectorException))
{
fail("Wrong exception:" + e.getMessage());
}
caught = true;
}
assertTrue("No exception thrown!", caught);
caught = false;
//Try Creating a Consumer
try
{
session.createConsumer(session.createQueue("Ping"), INVALID_SELECTOR);
}
catch (JMSException e)
{
_logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
if (!(e instanceof InvalidSelectorException))
{
fail("Wrong exception:" + e.getMessage());
}
caught = true;
}
assertTrue("No exception thrown!", caught);
caught = false;
//Try Creating a Receiever
try
{
session.createReceiver(session.createQueue("Ping"), INVALID_SELECTOR);
}
catch (JMSException e)
{
_logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
if (!(e instanceof InvalidSelectorException))
{
fail("Wrong exception:" + e.getMessage());
}
caught = true;
}
assertTrue("No exception thrown!", caught);
caught = false;
try
{
session.createReceiver(session.createQueue("Ping"), BAD_MATHS_SELECTOR);
}
catch (JMSException e)
{
_logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
if (!(e instanceof InvalidSelectorException))