Examples of accept()


Examples of org.mule.module.xml.filters.JXPathFilter.accept()

    {
        try
        {
            JXPathFilter myFilter = createObject(JXPathFilter.class);
            myFilter.setPattern("foo/bar/");
            myFilter.accept(new DefaultMuleMessage(xmlStringInput, muleContext));
            fail("Invalid XPath should have thrown an exception");
        }
        //Now we have Jaxen on the class path we get a Jaxen exception, but this is an unchecked exception
        catch (Exception e)
        {
View Full Code Here

Examples of org.mule.routing.filters.ExpressionFilter.accept()

    public void testExpressionFilter() throws Exception
    {
        ExpressionFilter filter = new ExpressionFilter("#[json:[0]/text]");
        filter.setMuleContext(muleContext);
        assertTrue(filter.accept(message));

        filter.setExpression("[0]/favorited");
        assertFalse(filter.accept(message));

        filter.setExpression("[0]/truncated");
View Full Code Here

Examples of org.mule.routing.filters.RegExFilter.accept()

                    return e;
                }
                try
                {
                    RegExFilter regExFilter = new RegExFilter(regex);
                    if (regExFilter.accept(e.getClass().getName()))
                    {
                        return e;
                    }
                }
                catch (Exception regexEx)
View Full Code Here

Examples of org.mule.routing.filters.WildcardFilter.accept()

        for (Iterator iterator = receivers.values().iterator(); iterator.hasNext();)
        {
            receiver = (MessageReceiver)iterator.next();
            String filterAddress = receiver.getEndpointURI().getAddress();
            WildcardFilter filter = new WildcardFilter(filterAddress);
            if (filter.accept(endpointUri.getAddress()))
            {
                InboundEndpoint endpoint = receiver.getEndpoint();
                EndpointURI newEndpointURI = new MuleEndpointURI(endpointUri, filterAddress);
                receiver.setEndpoint(new DynamicURIInboundEndpoint(endpoint, newEndpointURI));
View Full Code Here

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

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

    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());
View Full Code Here

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

    public void testOrFilter()
    {
        OrFilter filter = new OrFilter();
        assertEquals(0, filter.getFilters().size());
        assertFalse(filter.accept(new DefaultMuleMessage("foo", muleContext)));

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

Examples of org.mule.transaction.constraints.BatchConstraint.accept()

    {
        MuleEvent testEvent = Mockito.mock(MuleEvent.class);
        BatchConstraint filter = new BatchConstraint();
        filter.setBatchSize(3);
        assertEquals(3, filter.getBatchSize());
        assertTrue(!filter.accept(testEvent));

        ConstraintFilter clone = (ConstraintFilter)filter.clone();
        assertNotNull(clone);
        assertNotSame(filter, clone);
View Full Code Here

Examples of org.mule.transaction.constraints.ConstraintFilter.accept()

public class TransactionConstraintTestCase extends AbstractMuleTestCase
{
    public void testConstraintFilter() throws Exception
    {
        ConstraintFilter filter = new ConstraintFilter();
        assertTrue(filter.accept(getTestEvent("test")));

        ConstraintFilter clone = (ConstraintFilter)filter.clone();
        assertNotNull(clone);
        assertNotSame(filter, clone);
    }
View Full Code Here

Examples of org.mule.transport.file.filters.FilenameRegexFilter.accept()

    public void testFilenameRegexFilter()
    {
        FilenameRegexFilter filter = new FilenameRegexFilter();
        assertNull(filter.getPattern());
        assertFalse(filter.accept("foo"));

        filter.setPattern("[0-9]*_test.csv");
        assertNotNull(filter.getPattern());
        filter.setCaseSensitive(true);
        assertNotNull(filter.getPattern());
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.