Package org.apache.qpid.client.filter

Examples of org.apache.qpid.client.filter.JMSSelectorFilter


            {
                _messageSelectorFilter = null;
            }
            else
            {
                _messageSelectorFilter = new JMSSelectorFilter(messageSelector);
            }
        }
        catch (final AMQInternalException ie)
        {
            InvalidSelectorException ise = new InvalidSelectorException("cannot create consumer because of selector issue");
View Full Code Here


            {
                _messageSelectorFilter = null;
            }
            else
            {
                _messageSelectorFilter = new JMSSelectorFilter(messageSelector);
            }
        }
        catch (final AMQInternalException ie)
        {
            InvalidSelectorException ise = new InvalidSelectorException("cannot create consumer because of selector issue");
View Full Code Here

    private void validateSelector(String messageSelector) throws InvalidSelectorException
    {
        try
        {
            new JMSSelectorFilter(messageSelector);
        }
        catch (AMQInternalException e)
        {
            throw new InvalidSelectorException(e.getMessage());
        }
View Full Code Here

    public void testEmptySelectorFilter() throws Exception
    {
        try
        {
            new JMSSelectorFilter("");
            fail("Should not be able to create a JMSSelectorFilter with an empty selector");
        }
        catch (IllegalArgumentException iae)
        {
            // pass
View Full Code Here

    public void testNullSelectorFilter() throws Exception
    {
        try
        {
            new JMSSelectorFilter(null);
            fail("Should not be able to create a JMSSelectorFilter with a null selector");
        }
        catch (IllegalArgumentException iae)
        {
            // pass
View Full Code Here

    public void testInvalidSelectorFilter() throws Exception
    {
        try
        {
            new JMSSelectorFilter("$%^");
            fail("Unparsable selector so expected AMQInternalException to be thrown");
        }
        catch (AMQInternalException amqie)
        {
            // pass
View Full Code Here

        }
    }

    public void testSimpleSelectorFilter() throws Exception
    {
        MessageFilter simpleSelectorFilter = new JMSSelectorFilter("select=5");

        assertNotNull("Filter object is null", simpleSelectorFilter);
        assertNotNull("Selector string is null", simpleSelectorFilter.getSelector());
        assertEquals("Unexpected selector", "select=5", simpleSelectorFilter.getSelector());
        assertTrue("Filter object is invalid", simpleSelectorFilter != null);

        final JMSTextMessage message = TestMessageHelper.newJMSTextMessage();

        message.setIntProperty("select", 4);
        assertFalse("Selector did match when not expected", simpleSelectorFilter.matches(message));
        message.setIntProperty("select", 5);
        assertTrue("Selector didnt match when expected", simpleSelectorFilter.matches(message));
        message.setIntProperty("select", 6);
        assertFalse("Selector did match when not expected", simpleSelectorFilter.matches(message));
    }
View Full Code Here

        assertFalse("Selector did match when not expected", simpleSelectorFilter.matches(message));
    }

    public void testFailedMatchingFilter() throws Exception
    {
        MessageFilter simpleSelectorFilter = new JMSSelectorFilter("select>4");

        assertNotNull("Filter object is null", simpleSelectorFilter);
        assertNotNull("Selector string is null", simpleSelectorFilter.getSelector());
        assertEquals("Unexpected selector", "select>4", simpleSelectorFilter.getSelector());
        assertTrue("Filter object is invalid", simpleSelectorFilter != null);

        final JMSTextMessage message = TestMessageHelper.newJMSTextMessage();

        message.setStringProperty("select", "5");
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
        message.setStringProperty("select", "elephant");
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
        message.setBooleanProperty("select", false);
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
    }
View Full Code Here

            {
                _messageSelectorFilter = null;
            }
            else
            {
                _messageSelectorFilter = new JMSSelectorFilter(messageSelector);
            }
        }
        catch (final AMQInternalException ie)
        {
            InvalidSelectorException ise = new InvalidSelectorException("cannot create consumer because of selector issue");
View Full Code Here

            {
                _messageSelectorFilter = null;
            }
            else
            {
                _messageSelectorFilter = new JMSSelectorFilter(messageSelector);
            }
        }
        catch (final AMQInternalException ie)
        {
            InvalidSelectorException ise = new InvalidSelectorException("cannot create consumer because of selector issue");
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.filter.JMSSelectorFilter

Copyright © 2018 www.massapicom. 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.