Package org.mule.routing.filters.logic

Examples of org.mule.routing.filters.logic.AndFilter.accept()


    {
        AndFilter filter = new AndFilter();
        assertEquals(0, filter.getFilters().size());

        // both null
        assertFalse(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // only one filter set
        filter.getFilters().add(new EqualsFilter("foo"));
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));
View Full Code Here


        // both null
        assertFalse(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // only one filter set
        filter.getFilters().add(new EqualsFilter("foo"));
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // another one set too, but does not accept
        filter.getFilters().add(new EqualsFilter("foo"));
        assertFalse(filter.accept(new DefaultMuleMessage("bar", muleContext)));
View Full Code Here

        filter.getFilters().add(new EqualsFilter("foo"));
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // another one set too, but does not accept
        filter.getFilters().add(new EqualsFilter("foo"));
        assertFalse(filter.accept(new DefaultMuleMessage("bar", muleContext)));

        // both accept
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        WildcardFilter left = new WildcardFilter("blah.blah.*");
 
View Full Code Here

        // another one set too, but does not accept
        filter.getFilters().add(new EqualsFilter("foo"));
        assertFalse(filter.accept(new DefaultMuleMessage("bar", muleContext)));

        // both accept
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        WildcardFilter left = new WildcardFilter("blah.blah.*");
        WildcardFilter right = new WildcardFilter("blah.*");
        filter = new AndFilter(left, right);
        assertEquals(2,filter.getFilters().size());
View Full Code Here

        WildcardFilter left = new WildcardFilter("blah.blah.*");
        WildcardFilter right = new WildcardFilter("blah.*");
        filter = new AndFilter(left, right);
        assertEquals(2,filter.getFilters().size());

        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(right.accept(new DefaultMuleMessage("blah.blah", muleContext)));
        assertTrue(!left.accept(new DefaultMuleMessage("blah.blah", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("blah.blah", muleContext)));

        filter = new AndFilter();
View Full Code Here

        assertEquals(2,filter.getFilters().size());

        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(right.accept(new DefaultMuleMessage("blah.blah", muleContext)));
        assertTrue(!left.accept(new DefaultMuleMessage("blah.blah", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("blah.blah", muleContext)));

        filter = new AndFilter();
        filter.getFilters().add(left);
        filter.getFilters().add(right);
View Full Code Here

        filter = new AndFilter();
        filter.getFilters().add(left);
        filter.getFilters().add(right);

        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("blah.blah", muleContext)));
    }

    public void testOrFilter()
    {
View Full Code Here

        filter = new AndFilter();
        filter.getFilters().add(left);
        filter.getFilters().add(right);

        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(!filter.accept(new DefaultMuleMessage("blah.blah", muleContext)));
    }

    public void testOrFilter()
    {
        OrFilter filter = new OrFilter();
View Full Code Here

    {
        AndFilter filter = new AndFilter();
        assertEquals(0, filter.getFilters().size());

        // both null
        assertFalse(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // only one filter set
        filter.getFilters().add(new EqualsFilter("foo"));
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));
View Full Code Here

        // both null
        assertFalse(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // only one filter set
        filter.getFilters().add(new EqualsFilter("foo"));
        assertTrue(filter.accept(new DefaultMuleMessage("foo", muleContext)));

        // another one set too, but does not accept
        filter.getFilters().add(new EqualsFilter("foo"));
        assertFalse(filter.accept(new DefaultMuleMessage("bar", muleContext)));
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.