Package org.mule.routing

Examples of org.mule.routing.IdempotentMessageFilter


        return "org/mule/test/config/idempotent-message-filter-config.xml";
    }

    public void testInMemoryObjectStore() throws Exception
    {
        IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("inMemoryStore");

        ObjectStore<?> store = filter.getStore();
        assertEquals(InMemoryObjectStore.class, store.getClass());

        InMemoryObjectStore<?> memoryStore = (InMemoryObjectStore<?>) store;
        assertEquals(1000, memoryStore.getEntryTTL());
        assertEquals(2000, memoryStore.getExpirationInterval());
View Full Code Here


        assertEquals(3000, memoryStore.getMaxEntries());
    }

    public void testSimpleTextFileStore() throws Exception
    {
        IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("simpleTextFileStore");

        ObjectStore<?> store = filter.getStore();
        assertEquals(TextFileObjectStore.class, store.getClass());

        TextFileObjectStore fileStore = (TextFileObjectStore) store;
        assertEquals("the-store", fileStore.getName());
View Full Code Here

        assertEquals(3000, fileStore.getMaxEntries());
    }

    public void testCustomObjectStore() throws Exception
    {
        IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("customObjectStore");

        ObjectStore<?> store = filter.getStore();
        assertEquals(CustomObjectStore.class, store.getClass());

        CustomObjectStore customStore = (CustomObjectStore) store;
        assertEquals("the-value", customStore.getCustomProperty());
    }
View Full Code Here

    public void testIdempotentReceiverRouter() throws Exception
    {
        MessageProcessor router = lookupInboundRouterFromService("IdempotentReceiverRouter");
        assertTrue(router instanceof IdempotentMessageFilter);

        IdempotentMessageFilter filter = (IdempotentMessageFilter)router;
        assertEquals("#[message:id]-#[message:correlationId]", filter.getIdExpression());
        assertNotNull(filter.getStore());
        assertTrue(filter.getStore() instanceof TextFileObjectStore);

        TextFileObjectStore store = (TextFileObjectStore)filter.getStore();
        assertEquals(-1, store.getEntryTTL());
        assertEquals(1000, store.getExpirationInterval());
        assertEquals(10000000, store.getMaxEntries());
        assertEquals("foo", store.getDirectory());
        assertNotNull(store.getName());
View Full Code Here

    }

    @Test
    public void testInMemoryObjectStore() throws Exception
    {
        final IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("inMemoryStore");

        final ObjectStore<?> store = filter.getStore();
        assertEquals(InMemoryObjectStore.class, store.getClass());

        final InMemoryObjectStore<?> memoryStore = (InMemoryObjectStore<?>) store;
        assertEquals(1000, memoryStore.getEntryTTL());
        assertEquals(2000, memoryStore.getExpirationInterval());
View Full Code Here

    }

    @Test
    public void testSimpleTextFileStore() throws Exception
    {
        final IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("simpleTextFileStore");

        final ObjectStore<?> store = filter.getStore();
        assertEquals(TextFileObjectStore.class, store.getClass());

        final TextFileObjectStore fileStore = (TextFileObjectStore) store;
        assertEquals("the-store", fileStore.getName());
View Full Code Here

    }
   
    @Test
    public void testOnUnaccepted() throws Exception
    {
        final IdempotentMessageFilter filter = idempotentMessageFilterFromFlow("idempotentFilterWithOnUnacceptedMP");
        assertNotNull(filter.getUnacceptedMessageProcessor());
        assertEquals(StringAppendTransformer.class, filter.getUnacceptedMessageProcessor().getClass());
    }
View Full Code Here

        testPojoObjectStore("beanObjectStore");
    }

    private void testPojoObjectStore(final String flowName) throws Exception
    {
        final IdempotentMessageFilter filter = idempotentMessageFilterFromFlow(flowName);

        final ObjectStore<?> store = filter.getStore();
        assertEquals(CustomObjectStore.class, store.getClass());

        final CustomObjectStore customStore = (CustomObjectStore) store;
        assertEquals("the-value:" + flowName, customStore.getCustomProperty());
    }
View Full Code Here

    public void testIdempotentReceiverRouter() throws Exception
    {
        MessageProcessor router = lookupMessageProcessorFromFlow("IdempotentReceiverRouter");
        assertTrue(router instanceof IdempotentMessageFilter);

        IdempotentMessageFilter filter = (IdempotentMessageFilter)router;
        assertEquals("#[message:id]-#[message:correlationId]", filter.getIdExpression());
        assertNotNull(filter.getStore());
        assertTrue(filter.getStore() instanceof TextFileObjectStore);

        TextFileObjectStore store = (TextFileObjectStore)filter.getStore();
        assertEquals(-1, store.getEntryTTL());
        assertEquals(1000, store.getExpirationInterval());
        assertEquals(10000000, store.getMaxEntries());
        assertEquals("foo", store.getDirectory());
        assertNotNull(store.getName());
View Full Code Here

        assertNotNull(flow1);
        List<MessageProcessor> mpList = flow1.getMessageProcessors();

        MessageProcessor mp1 = muleContext.getRegistry().lookupObject("idempotentFilter");
        assertTrue(mp1 instanceof IdempotentMessageFilter);
        IdempotentMessageFilter imf = (IdempotentMessageFilter) mp1;
        assertEquals(imf.getIdExpression(), "#[payload:]");
        assertMpPresent(mpList, mp1, IdempotentMessageFilter.class);

        MessageProcessor mp2 = muleContext.getRegistry().lookupObject("messageFilter");
        assertTrue(mp2 instanceof MessageFilter);
        MessageFilter mf = (MessageFilter) mp2;
View Full Code Here

TOP

Related Classes of org.mule.routing.IdempotentMessageFilter

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.