Package com.volantis.cache.impl

Examples of com.volantis.cache.impl.InternalCache.retrieve()


        // Check the cache integrity.
        ensureCacheIntegrity(cache);

        // Retrieve it again, this should invoke the expiration checker which
        // reports that it has not expired.
        value = cache.retrieve(key1);
        assertEquals(value1, value);

        // Check the cache integrity.
        ensureCacheIntegrity(cache);
View Full Code Here


        ensureCacheIntegrity(cache);

        // Retrieve it again, this should invoke the expiration checker which
        // now reports that it has expired so the object will be retrieved
        // again and will return a different value.
        value = cache.retrieve(key1);
        assertEquals(value2, value);

        // Check the cache integrity.
        ensureCacheIntegrity(cache);
    }
View Full Code Here

        ensureCacheIntegrity(cache);

        // Retrieve the object, this will fail and should result in an
        // exception being thrown.
        try {
            cache.retrieve(key1);
            fail("Did not cause exception");
        } catch (IllegalStateException expected) {
            assertSame(throwable, expected);
        }
View Full Code Here

        // Check the cache integrity.
        ensureCacheIntegrity(cache);

        // Retrieve it again, this should not invoke the provider again.
        try {
            cache.retrieve(key1);
            fail("Did not cause exception");
        } catch (ExtendedRuntimeException expected) {
            assertSame(throwable, expected.getCause());
        }
View Full Code Here

        // Check the cache integrity.
        ensureCacheIntegrity(cache);

        // Retrieve the object, this will work and should result in the entry
        // being added to the root group.
        value = cache.retrieve(key1);
        assertEquals(value1, value);

        // Check the cache integrity.
        ensureCacheIntegrity(cache);
View Full Code Here

        // Retrieve it again, this should invoke the provider again as the
        // entry has expired. Although this fails it should not remove the
        // entry from the cache as it already belongs to a group.
        try {
            value = cache.retrieve(key1);
        } catch (IllegalStateException expected) {
            assertSame(throwable, expected);
        }

        // Check the cache integrity.
View Full Code Here

        ensureCacheIntegrity(cache);

        // Retrieve it again, this should not invoke the provider as the entry
        // is in the cache and has not expired but it should still error.
        try {
            value = cache.retrieve(key1);
        } catch (ExtendedRuntimeException expected) {
            assertSame(throwable, expected.getCause());
        }

        // Check the cache integrity.
View Full Code Here

        // =====================================================================

        // Retrieve the object, this will fail and should result in an
        // exception being thrown.
        try {
            cache.retrieve(key1);
            fail("Did not cause exception");
        } catch (IllegalStateException expected) {
            assertEquals("Result from provider is null", expected.getMessage());
        }
    }
View Full Code Here

        addProviderExpectation(key1, null,
                new ProviderResult(value1, root, false, null));

        // Retrieve the object, this will work and mark the entry as
        // uncacheable.
        Object value = cache.retrieve(key1);
        assertSame(value1, value);

        // Expect a request for an uncacheable entry that fails with an error.
        Throwable throwable = new Error();
        addUncacheableProviderExpectation(key1, throwable);
View Full Code Here

        // Retrieve the object, this will fail and should result in an
        // exception being thrown. However, it must not mark the entry as
        // in error because that would be equivalent to caching the result
        // and the entry is uncacheable.
        try {
            cache.retrieve(key1);
            fail("Did not cause exception");
        } catch (Error expected) {
            assertSame(throwable, expected);
        }
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.