Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.Banner


        session.flush();
    }

    @Test
    public void existsBannerShouldBeDeletedIfItIdPassed() {
        Banner banner = ObjectsFactory.getDefaultBanner();
        session.save(banner);
        session.flush();

        boolean isDeleted = bannerDao.delete(banner.getId());

        assertTrue(isDeleted, "Entity must be deleted by id.");
    }
View Full Code Here


    }

    /*===== Specific methods =====*/
    @Test
    public void existsBannerShouldBeFoundByPosition() {
        Banner banner = ObjectsFactory.getDefaultBanner();
        banner.setPositionOnPage(BannerPosition.TOP);
        session.save(banner);
        session.flush();
        session.evict(banner);

        Banner bannerInDatabase = bannerDao.getByPosition(BannerPosition.TOP);

        assertNotNull(bannerInDatabase, "Banner should be found by position, because it was saved.");
        assertReflectionEquals(banner, bannerInDatabase);
    }
View Full Code Here

        assertReflectionEquals(banner, bannerInDatabase);
    }

    @Test
    public void existsBannerShouldNotBeFoundByPosition() {
        Banner banner = ObjectsFactory.getDefaultBanner();
        banner.setPositionOnPage(BannerPosition.TOP);
        session.save(banner);
        session.flush();
        session.evict(banner);

        Banner bannerInDatabase = bannerDao.getByPosition(BannerPosition.BOTTOM);

        assertNull(bannerInDatabase,
                "Banner shouldn't be found by position, because different banner was saved.");
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.Banner

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.