Package org.mule.api.store

Examples of org.mule.api.store.ObjectStore


    }

    @Test
    public void partitionObjectStoreDoesNotCollide() throws Exception
    {
        ObjectStore os = objectStoreFactory.createObjectStore("myOs");
        ObjectStore os2 = objectStoreFactory.createObjectStore("myOs2");
        os.store(OBJECT_KEY, OBJECT_KEY_VALUE_1);
        os2.store(OBJECT_KEY, OBJECT_KEY_VALUE_2);
        assertThat(os.contains(OBJECT_KEY), is(true));
        assertThat((String) os.retrieve(OBJECT_KEY), is(OBJECT_KEY_VALUE_1));
        assertThat(os2.contains(OBJECT_KEY),is(true));
        assertThat((String) os2.retrieve(OBJECT_KEY), is(OBJECT_KEY_VALUE_2));
        assertThat((String) os.remove(OBJECT_KEY), is(OBJECT_KEY_VALUE_1));
        assertThat((String) os2.remove(OBJECT_KEY), is(OBJECT_KEY_VALUE_2));
    }
View Full Code Here


    @Test
    public void maxEntriesIsHonored() throws Exception
    {
        final int expirationInterval = 1000;
        final int maxEntries = 5;
        final ObjectStore os = objectStoreFactory.createObjectStore("myOs", 5, 0, expirationInterval);

        for (int i = 0; i < maxEntries +1; i++)
        {
            os.store(i, i);
        }

        PollingProber prober = new PollingProber(expirationInterval * 5, expirationInterval);
        prober.check(new JUnitProbe()
        {
            @Override
            public boolean test() throws Exception
            {
                assertThat(os.contains(0), is(false));

                for (int i = 1; i < maxEntries + 1; i++)
                {
                    assertThat(os.contains(i), is(true));
                }

                return true;
            }

View Full Code Here

    @Test
    public void testMessageRedeliveryUsingSerializationStore() throws Exception
    {
        when(message.getPayload()).thenReturn(STRING_MESSAGE);
        reset(mockObjectStoreManager);
        final ObjectStore serializationObjectStore = new SerializationObjectStore();
        when(mockObjectStoreManager.getObjectStore(anyString(), anyBoolean(), anyInt(), anyInt(), anyInt())).thenAnswer(new Answer<ObjectStore>()
        {
            @Override
            public ObjectStore answer(InvocationOnMock invocation) throws Throwable
            {
View Full Code Here

TOP

Related Classes of org.mule.api.store.ObjectStore

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.