Examples of PageImpl


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

        user.setUsername(VALID_USERNAME);
        user.setId(VALID_USER_ID);
        user2 = new UserImpl();
        user2.setUsername(VALID_USERNAME2);
        user2.setId(VALID_USER_ID2);
        page = new PageImpl();
        page.setId(VALID_PAGE_ID);
        page.setOwnerId(user.getId());
        region = new RegionImpl(VALID_REGION_ID);
        region.setPage(page);
        regionWidget = new RegionWidgetImpl(VALID_REGION_WIDGET_ID);
View Full Code Here

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

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

    @Test
    public void newPage() {
        Page page = new PageImpl();
        page.setId("1");
        page.setMembers(new ArrayList<PageUser>());
        page.setName("name");
        page.setOwnerId("");
        page.setPageLayout(new PageLayoutImpl());
        page.setPageType(PageType.USER);
        page.setParentPage(new PageImpl("1"));
        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.getOwnerId(), is(equalTo(page.getOwnerId())));
        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

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

        defaultPageUser = new PageUserImpl(USER_ID, defaultPage, 1L);
        defaultPageUser.setPageStatus(PageInvitationStatus.OWNER);

        validUser.setDefaultPageLayout(validPageLayout);

        defaultPage = new PageImpl(DEFAULT_PAGE_ID, USER_ID);
        defaultPage.setPageLayout(validPageLayout);

        List<PageUser> members = new ArrayList<PageUser>();
        members.add(defaultPageUser);
        defaultPage.setMembers(members);

        otherPage = new PageImpl(OTHER_PAGE_ID, USER_ID);
        otherPage.setPageLayout(validPageLayout);
        otherPageUser = new PageUserImpl(USER_ID, otherPage, 2L);
        otherPageUser.setPageStatus(PageInvitationStatus.OWNER);

        List<PageUser> members2 = new ArrayList<PageUser>();
View Full Code Here

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

    profileController = new ProfileController(userService, pageService);

        validPageLayout = new PageLayoutImpl();
        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);

        defaultPage = new PageImpl(DEFAULT_PAGE_ID);
        defaultPage.setPageLayout(validPageLayout);
        otherPage = new PageImpl(OTHER_PAGE_ID);
        otherPage.setPageLayout(validPageLayout);

        allProfilePages = new ArrayList<Page>();
        allProfilePages.add(defaultPage);
        allProfilePages.add(otherPage);
View Full Code Here

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

    final int modelSize = 4;
    final String username="canonical";
        user.setUsername(username);
        user.setId(USER_ID);
    String userProfile = new String(ModelKeys.USER_PROFILE);
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
        personProfile.setPageLayout(pageLayout);
        List<Person> personObjects = new ArrayList<Person>();

    expect(userService.getUserByUsername(username)).andReturn(user).once();
        expect(pageService.getPersonProfilePage(user.getId())).andReturn(personProfile);
    expect(userService.getFriendRequestsReceived(username)).andReturn(personObjects);
View Full Code Here

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

    final int modelSize = 4;
    final String username="canonical";
        user.setUsername(username);
        user.setId(USER_ID);
    String userProfile = new String(ModelKeys.USER_PROFILE);
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
        personProfile.setPageLayout(pageLayout);
        List<Person> personObjects = new ArrayList<Person>();

    expect(userService.getUserById(USER_ID)).andReturn(user).once();
        expect(pageService.getPersonProfilePage(user.getId())).andReturn(personProfile);
    expect(userService.getFriendRequestsReceived(username)).andReturn(personObjects);
View Full Code Here

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

        //creating a mock user
        final User user = null;
        final ModelMap model = new ModelMap();
        final int modelSize = 4;
        final String username="Canonical";
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode("person_profile");
        personProfile.setPageLayout(pageLayout);

        expect(userService.getUserByUsername(username)).andThrow(new UsernameNotFoundException("Username does not exist"));

        replay(userService, pageService);
View Full Code Here

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

        //creating a mock user
        final User user = null;
        final ModelMap model = new ModelMap();
        final int modelSize = 4;
        final String username="Canonical";
        Page personProfile = new PageImpl();
        PageLayout pageLayout = new PageLayoutImpl();
        pageLayout.setCode("person_profile");
        personProfile.setPageLayout(pageLayout);

        expect(userService.getUserById(username)).andThrow(new UsernameNotFoundException("Username does not exist"));

        replay(userService, pageService);
View Full Code Here

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

    }

    @Test
    public void getEncryptedSecurityToken_valid() {
        Widget widget = new WidgetImpl("25", VALID_GADGET_URL);
        Page page = new PageImpl(VALID_PAGE_ID, VALID_OWNER_ID);
        widget.setWidgetStatus(WidgetStatus.PUBLISHED);
        expect(widgetService.getWidgetByUrl(VALID_GADGET_URL)).andReturn(widget);
        expect(pageService.getPage(VALID_PAGE_ID)).andReturn(page);
        expect(tokenService.getEncryptedSecurityToken(isA(RegionWidget.class), eq(widget))).andReturn(VALID_TOKEN);
        replay(widgetService, pageService, tokenService);
View Full Code Here

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

    @Test
    public void addNewDefaultUserPage() {

        final Long EXPECTED_RENDER_SEQUENCE = 1L;
        PageTemplate pageTemplate = new PageTemplateImpl();
        Page expectedPage = new PageImpl();
        expectedPage.setName(defaultPageName);
        expectedPage.setOwnerId(user.getId());
        expectedPage.setPageLayout(pageLayout);
        expectedPage.setRegions(createEmptyRegionList(pageLayout.getNumberOfRegions()));
        PageUser lPageUser = new PageUserImpl(user.getId(), expectedPage, EXPECTED_RENDER_SEQUENCE);
        List<PageUser> members = new ArrayList<PageUser>();
        members.add(lPageUser);
        expectedPage.setMembers(members);

        expect(userService.getUserById(user.getId())).andReturn(user);
        expect(pageLayoutRepository.getByPageLayoutCode(PAGE_LAYOUT_CODE)).andReturn(pageLayout);
        expect(pageTemplateRepository.getDefaultPage(PageType.USER)).andReturn(pageTemplate);
        expect(pageRepository.createPageForUser(user, pageTemplate)).andReturn(expectedPage);
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.