Package org.mule.routing.filters.logic

Examples of org.mule.routing.filters.logic.NotFilter


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

    public void testNotFilter()
    {
        NotFilter notFilter = new NotFilter();
        assertNull(notFilter.getFilter());
        assertFalse(notFilter.accept(new DefaultMuleMessage("foo", muleContext)));
        assertFalse(notFilter.accept(new DefaultMuleMessage(null, muleContext)));

        WildcardFilter filter = new WildcardFilter("blah.blah.*");
        notFilter = new NotFilter(filter);
        assertNotNull(notFilter.getFilter());

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

        notFilter = new NotFilter();
        notFilter.setFilter(filter);
        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(!notFilter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
    }
View Full Code Here


                addEventHandlers(xpathBuilder, (Filter) itr.next());
            }
        }
        else if (filter instanceof NotFilter)
        {
            NotFilter f = (NotFilter) filter;

            addEventHandlers(xpathBuilder, f.getFilter());
        }
        else
        {
            logger.warn("Filter type " + filter.getClass().toString()
                           + " is not recognized by the SXC router. If it contains child "
View Full Code Here

        RestServiceWrapper restServiceWrapper = (RestServiceWrapper) component;
        assertEquals(restServiceWrapper.getServiceUrl(), SERVICE_URL);
        assertEquals(restServiceWrapper.getHttpMethod(), "POST");
        assertNotNull(restServiceWrapper.getFilter());
        assertEquals(NotFilter.class, restServiceWrapper.getFilter().getClass());
        NotFilter filter = (NotFilter) restServiceWrapper.getFilter();
        assertEquals(filter.getFilter().getClass(), WildcardFilter.class);
        WildcardFilter innerFilter = (WildcardFilter) filter.getFilter();
        assertEquals(innerFilter.getPattern(), "*xyz*");
        assertNotNull(restServiceWrapper.getPayloadParameterNames());
        assertEquals(restServiceWrapper.getPayloadParameterNames().size(), 2);
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(0), "test-property1");
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(1), "test-property2");
View Full Code Here

        RestServiceWrapper restServiceWrapper = (RestServiceWrapper) component;
        assertEquals(restServiceWrapper.getServiceUrl(), SERVICE_URL);
        assertEquals(restServiceWrapper.getHttpMethod(), "POST");
        assertNotNull(restServiceWrapper.getFilter());
        assertEquals(NotFilter.class, restServiceWrapper.getFilter().getClass());
        NotFilter filter = (NotFilter) restServiceWrapper.getFilter();
        assertEquals(filter.getFilter().getClass(), WildcardFilter.class);
        WildcardFilter innerFilter = (WildcardFilter) filter.getFilter();
        assertEquals(innerFilter.getPattern(), "*xyz*");
        assertNotNull(restServiceWrapper.getPayloadParameterNames());
        assertEquals(restServiceWrapper.getPayloadParameterNames().size(), 2);
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(0), "test-property1");
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(1), "test-property2");
View Full Code Here

        RestServiceWrapper restServiceWrapper = (RestServiceWrapper) component;
        assertEquals(restServiceWrapper.getServiceUrl(), FLOW_URL);
        assertEquals(restServiceWrapper.getHttpMethod(), "POST");
        assertNotNull(restServiceWrapper.getFilter());
        assertEquals(NotFilter.class, restServiceWrapper.getFilter().getClass());
        NotFilter filter = (NotFilter) restServiceWrapper.getFilter();
        assertEquals(filter.getFilter().getClass(), WildcardFilter.class);
        WildcardFilter innerFilter = (WildcardFilter) filter.getFilter();
        assertEquals(innerFilter.getPattern(), "*xyz*");
        assertNotNull(restServiceWrapper.getPayloadParameterNames());
        assertEquals(restServiceWrapper.getPayloadParameterNames().size(), 2);
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(0), "test-property1");
        assertEquals(restServiceWrapper.getPayloadParameterNames().get(1), "test-property2");
View Full Code Here

    }

    @Test
    public void testNotFilter()
    {
        NotFilter notFilter = new NotFilter();
        assertNull(notFilter.getFilter());
        assertFalse(notFilter.accept(new DefaultMuleMessage("foo", muleContext)));
        assertFalse(notFilter.accept(new DefaultMuleMessage(null, muleContext)));

        WildcardFilter filter = new WildcardFilter("blah.blah.*");
        notFilter = new NotFilter(filter);
        assertNotNull(notFilter.getFilter());

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

        notFilter = new NotFilter();
        notFilter.setFilter(filter);
        assertTrue(filter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
        assertTrue(!notFilter.accept(new DefaultMuleMessage("blah.blah.blah", muleContext)));
    }
View Full Code Here

                addEventHandlers(xpathBuilder, (Filter) itr.next());
            }
        }
        else if (filter instanceof NotFilter)
        {
            NotFilter f = (NotFilter) filter;

            addEventHandlers(xpathBuilder, f.getFilter());
        }
        else
        {
            logger.warn("Filter type " + filter.getClass().toString()
                           + " is not recognized by the SXC router. If it contains child "
View Full Code Here

TOP

Related Classes of org.mule.routing.filters.logic.NotFilter

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.