Package domain

Examples of domain.Blog


    @Test
    public void test_AT_CacheResult()
    {
        String testBody = "" + System.currentTimeMillis();
        String testTitle = "title a";
        Blog blog = new Blog(testTitle, testBody);
        BlogManager blogManager = getBlogManager();
        blogManager.createEntry(blog);

        Blog entryCached = blogManager.getEntryCached(testTitle);
        assertEquals(entryCached.getBody(), testBody);

        /* clear from map, but not from cache */
        blogManager.clearEntry(testTitle);
        entryCached = blogManager.getEntryCached(testTitle);
        assertNotNull("Item should still be in the cache thus not null", entryCached);
        assertEquals(
                "Item should still be in the cache and the title should be the same as before",
                entryCached.getBody(), testBody);

    }
View Full Code Here


    @Test
    public void test_AT_CacheResult_UsingAt_CacheKeyParam()
    {
        String testBody = "" + System.currentTimeMillis();
        String testTitle = "title abc";
        Blog blog = new Blog(testTitle, testBody);
        BlogManager blogManager = getBlogManager();
        blogManager.createEntry(blog);

        Blog entryCached = blogManager.getEntryCached("asdf", testTitle, "adsfa");
        assertEquals(entryCached.getBody(), testBody);

        /* clear from map, but not from cache */
        blogManager.clearEntry(testTitle);
        entryCached = blogManager.getEntryCached(testTitle);
        assertNotNull("Item should still be in the cache thus not null", entryCached);
        assertEquals(
                "Item should still be in the cache and the title should be the same as before",
                entryCached.getBody(), testBody);

    }
View Full Code Here

    @Test
    public void test_AT_CacheRemoveEntry()
    {
        String testBody = "" + System.currentTimeMillis();
        String testTitle = "title b";
        Blog blog = new Blog(testTitle, testBody);
        BlogManager blogManager = getBlogManager();
        blogManager.createEntry(blog);

        Blog entryCached = blogManager.getEntryCached(testTitle);
        assertEquals(entryCached.getBody(), testBody);

        /* clear from cache using annotation @CacheRemove */
        blogManager.clearEntryFromCache(testTitle);

        /* clear from map, but not from cache */
 
View Full Code Here

    public void test_AT_CacheRemoveAll()
    {
        String testBody = "" + System.currentTimeMillis();
        String testTitle = "title b";

        Blog blog = new Blog(testTitle, testBody);
        BlogManager blogManager = getBlogManager();
        blogManager.createEntry(blog);

        Blog entryCached = blogManager.getEntryCached(testTitle);
        assertEquals(entryCached.getBody(), testBody);

        /* clear from map, but not from cache */
        blogManager.clearEntry(testTitle);

        /* clear from cache using annotation @CacheRemoveAll */
 
View Full Code Here

TOP

Related Classes of domain.Blog

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.