Package org.apache.rave.portal.model.impl

Examples of org.apache.rave.portal.model.impl.PageImpl


    private final Long SUB_PAGE_1_ID = 666666L;
    private final Long SUB_PAGE_2_ID = 121212L;

  @Before
  public void setup(){
    page=new PageImpl();
    id=19191991L;
        parentId = 12345L;
    testName="testName";
    testOwner=new JpaUser(id);
        parentPage = new PageImpl(parentId);
        subPages = new ArrayList<Page>();

        Page subPage1 = new PageImpl();
        subPage1.setId(SUB_PAGE_1_ID);
        subPage1.setOwner(testOwner);
        Page subPage2 = new PageImpl();
        subPage2.setId(SUB_PAGE_2_ID);
        subPage2.setOwner(testOwner);

        List<PageUser> pageUsers1 = new ArrayList<PageUser>();
        PageUser pageUser1 = new PageUserImpl();
        pageUser1.setUser(testOwner);
        pageUser1.setPage(subPage1);
        pageUser1.setRenderSequence(2L);
        pageUsers1.add(pageUser1);
        subPage1.setMembers(pageUsers1);

        List<PageUser> pageUsers2 = new ArrayList<PageUser>();
        PageUser pageUser2 = new PageUserImpl();
        pageUser2.setUser(new JpaUser());
        pageUser2.setPage(subPage2);
        pageUser2.setRenderSequence(19L);
        pageUsers2.add(pageUser2);

        PageUser pageUser3 = new PageUserImpl();
        pageUser3.setUser(testOwner);
        pageUser3.setPage(subPage2);
        pageUser3.setRenderSequence(1L);
        pageUsers2.add(pageUser3);
        subPage2.setMembers(pageUsers2);

        subPages.add(subPage1);
        subPages.add(subPage2);
    pageLayout=new PageLayoutImpl();
    renderSequence=1223L;
View Full Code Here


        assertThat(pageConverter.convert(page), is(nullValue()));
    }

    @Test
    public void newPage() {
        Page page = new PageImpl();
        page.setId(1L);
        page.setMembers(new ArrayList<PageUser>());
        page.setName("name");
        page.setOwner(new JpaUser());
        page.setPageLayout(new PageLayoutImpl());
        page.setPageType(PageType.USER);
        page.setParentPage(new PageImpl(1L));
        page.setRegions(new ArrayList<Region>());
        page.setSubPages(new ArrayList<Page>());

        JpaPage converted = pageConverter.convert(page);
        assertThat(converted, is(not(sameInstance(page))));
        assertThat(converted, is(instanceOf(JpaPage.class)));
        assertThat(converted.getId(), is(equalTo(page.getId())));
        assertThat(converted.getParentPage().getId(), is(equalTo(page.getParentPage().getId())));
        assertThat(converted.getRegions(), is(equalTo(page.getRegions())));
        assertThat(converted.getMembers(), is(equalTo(page.getMembers())));
        assertThat(converted.getName(), is(equalTo(page.getName())));
        assertThat(converted.getOwner(), is(equalTo(page.getOwner())));
        assertThat(converted.getPageLayout().getCode(), is(equalTo(page.getPageLayout().getCode())));
        assertThat(converted.getPageType(), is(equalTo(page.getPageType())));
        assertThat(converted.getSubPages(), is(equalTo(page.getSubPages())));
    }
View Full Code Here

    @Transactional(readOnly=false)
    @Rollback(true)
    public void deletePage_implObject() {
        Page p = repository.get(USER_ID);
        assertThat(p, is(notNullValue()));
        PageImpl impl = new PageImpl(p.getId());

        repository.delete(impl);
        p = repository.get(USER_ID);
        assertThat(p, is(nullValue()));
    }
View Full Code Here

        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);

        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwner(user);
        page.setPageType(PageType.USER);

        pageSubPage = new PageImpl();
        pageSubPage.setId(VALID_PAGE_ID4);
        pageSubPage.setOwner(user);
        pageSubPage.setPageType(PageType.SUB_PAGE);
        pageSubPage.setParentPage(page);

        personProfilePage = new PageImpl();
        personProfilePage.setId(VALID_PAGE_ID2);
        personProfilePage.setOwner(user);
        personProfilePage.setPageType(PageType.PERSON_PROFILE);
        personProfileSubPage = new PageImpl();
        personProfileSubPage.setId(VALID_PAGE_ID3);
        personProfileSubPage.setOwner(user);
        personProfileSubPage.setPageType(PageType.PERSON_PROFILE);
        personProfileSubPage.setParentPage(personProfilePage);
View Full Code Here

        user = new UserImpl();
        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwner(user);
        widget = new WidgetImpl(VALID_WIDGET_ID);
        widget.setOwner(user);
        widget.setWidgetStatus(WidgetStatus.PUBLISHED);
View Full Code Here

        user = new UserImpl();
        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwner(user);
        region = new RegionImpl();
        region.setId(VALID_REGION_ID);
        region.setPage(page);
View Full Code Here

        user = new UserImpl();
        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwner(user);
        region = new RegionImpl();
        region.setId(VALID_REGION_ID);
        region.setPage(page);
View Full Code Here

    public void deleteUser() {
        final int NUM_COMMENTS = 33;
        final int NUM_RATINGS = 99;
        final int NUM_WIDGETS_OWNED = 4;
        UserImpl user = new UserImpl(USER_ID, USER_NAME);
        Page page = new PageImpl(1L, user);
        List<Page> pages = new ArrayList<Page>();
        pages.add(page);

        expect(userRepository.get(USER_ID)).andReturn(user);
        expect(pageRepository.deletePages(USER_ID, PageType.USER)).andReturn(pages.size());
View Full Code Here

    @Test
    public void registerNewUser_valid(){
        User user = new UserImpl();
        expect(userRepository.save(user)).andReturn(user).once();
        expect(pageTemplateRepository.getDefaultPage(PageType.PERSON_PROFILE)).andReturn(new PageTemplateImpl()).once();
        expect(pageRepository.createPageForUser(isA(UserImpl.class), isA(PageTemplate.class))).andReturn(new PageImpl());
        replay(userRepository, pageTemplateRepository, pageRepository);
        service.registerNewUser(user);
        verify(userRepository, pageTemplateRepository, pageRepository);
    }
View Full Code Here

    @Transactional(readOnly=false)
    @Rollback(true)
    public void deletePage_implObject() {
        Page p = repository.get(USER_ID);
        assertThat(p, is(notNullValue()));
        PageImpl impl = new PageImpl(p.getId());

        repository.delete(impl);
        p = repository.get(USER_ID);
        assertThat(p, is(nullValue()));
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.impl.PageImpl

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.