Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.PageTemplateRegion


        assertEquals("# of regions for sub page 2", 1, subPage2.getPageTemplateRegions().size());
        assertEquals("columns_1", subPage2.getPageLayout().getCode());
        assertEquals("# of widgets on sub page 2 region 1", 1, subPage2.getPageTemplateRegions().get(0).getPageTemplateWidgets().size());
        assertEquals("# of sub pages for sub page 2", 0, subPage2.getSubPageTemplates().size());
        // parent page region tests
        PageTemplateRegion ptRegion1 = pt.getPageTemplateRegions().get(0);
        assertEquals(pt.getEntityId(), ptRegion1.getPageTemplate().getEntityId());
        assertEquals(0, ptRegion1.getRenderSequence());
        assertEquals(2, ptRegion1.getPageTemplateWidgets().size());
        assertTrue(ptRegion1.isLocked());
        // parent page region 1 widget 1 tests
        PageTemplateWidget ptw1 = ptRegion1.getPageTemplateWidgets().get(0);
        assertEquals(ptw1.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidget());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(ptw2.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidget());
        assertTrue(ptw2.isLocked());
        // sub page 1 region 1 tests
        PageTemplateRegion sp1Region1 = subPage1.getPageTemplateRegions().get(0);
        assertEquals(subPage1.getEntityId(), sp1Region1.getPageTemplate().getEntityId());
        assertEquals(0, sp1Region1.getRenderSequence());
        assertEquals(2, sp1Region1.getPageTemplateWidgets().size());
        assertTrue(sp1Region1.isLocked());
        // sub page 1 region 1 widget 1 tests
        PageTemplateWidget spw1 = sp1Region1.getPageTemplateWidgets().get(0);
        assertEquals(spw1.getPageTemplateRegion().getEntityId(), sp1Region1.getEntityId());
        assertEquals(0, spw1.getRenderSeq());
        assertNotNull(spw1.getWidget());
        assertTrue(spw1.isLocked());
        // sub page 1 region 1 widget 2 tests
        PageTemplateWidget spw2 = sp1Region1.getPageTemplateWidgets().get(1);
        assertEquals(spw2.getPageTemplateRegion().getEntityId(), sp1Region1.getEntityId());
        assertEquals(1, spw2.getRenderSeq());
        assertNotNull(spw2.getWidget());
        assertTrue(spw2.isLocked());
        // sub page 2 region tests
        PageTemplateRegion sp2Region1 = subPage2.getPageTemplateRegions().get(0);
        assertEquals(subPage2.getEntityId(), sp2Region1.getPageTemplate().getEntityId());
        assertEquals(0, sp2Region1.getRenderSequence());
        assertEquals(1, sp2Region1.getPageTemplateWidgets().size());
        assertTrue(sp2Region1.isLocked());
        // sub page 2 region widget 1 tests
        PageTemplateWidget sp2w1 = sp2Region1.getPageTemplateWidgets().get(0);
        assertEquals(sp2w1.getPageTemplateRegion().getEntityId(), sp2Region1.getEntityId());
        assertEquals(0, sp2w1.getRenderSeq());
        assertNotNull(sp2w1.getWidget());
        assertTrue(sp2w1.isLocked());

    }
View Full Code Here


        assertThat(converter.convert(template), is(sameInstance(template)));
    }

    @Test
    public void nullConversion() {
        PageTemplateRegion template = null;
        assertThat(converter.convert(template), is(nullValue()));
    }
View Full Code Here

    }


    @Test
    public void convertValid() {
        PageTemplateRegion template = new PageTemplateRegionImpl();
        template.setRenderSequence(1);
        template.setPageTemplateWidgets(new ArrayList<PageTemplateWidget>());
        template.setPageTemplate(new PageTemplateImpl());
        template.setLocked(true);

        JpaPageTemplateRegion jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
        assertThat(jpaTemplate.getPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
        assertThat(jpaTemplate.getPageTemplateWidgets(), is(equalTo(template.getPageTemplateWidgets())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
    }
View Full Code Here

        assertThat(converter.convert(template), is(sameInstance(template)));
    }

    @Test
    public void nullConversion() {
        PageTemplateRegion template = null;
        assertThat(converter.convert(template), is(nullValue()));
    }
View Full Code Here

    }


    @Test
    public void convertValid() {
        PageTemplateRegion template = new PageTemplateRegionImpl("1");
        template.setRenderSequence(1);
        template.setPageTemplateWidgets(new ArrayList<PageTemplateWidget>());
        template.setPageTemplate(new PageTemplateImpl("1"));
        template.setLocked(true);

        JpaPageTemplateRegion jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSequence(), is(equalTo(template.getRenderSequence())));
        assertThat(jpaTemplate.getPageTemplate(), is(instanceOf(JpaPageTemplate.class)));
        assertThat(jpaTemplate.getPageTemplateWidgets(), is(equalTo(template.getPageTemplateWidgets())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
    }
View Full Code Here

        assertEquals("# of regions for sub page 2", 1, subPage2.getPageTemplateRegions().size());
        assertEquals("columns_1", subPage2.getPageLayout().getCode());
        assertEquals("# of widgets on sub page 2 region 1", 1, subPage2.getPageTemplateRegions().get(0).getPageTemplateWidgets().size());
        assertEquals("# of sub pages for sub page 2", 0, subPage2.getSubPageTemplates().size());
        // parent page region tests
        PageTemplateRegion ptRegion1 = pt.getPageTemplateRegions().get(0);
        assertEquals(pt.getEntityId(), ptRegion1.getPageTemplate().getEntityId());
        assertEquals(0, ptRegion1.getRenderSequence());
        assertEquals(2, ptRegion1.getPageTemplateWidgets().size());
        assertTrue(ptRegion1.isLocked());
        // parent page region 1 widget 1 tests
        PageTemplateWidget ptw1 = ptRegion1.getPageTemplateWidgets().get(0);
        assertEquals(ptw1.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidget());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(ptw2.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidget());
        assertTrue(ptw2.isLocked());
        // sub page 1 region 1 tests
        PageTemplateRegion sp1Region1 = subPage1.getPageTemplateRegions().get(0);
        assertEquals(subPage1.getEntityId(), sp1Region1.getPageTemplate().getEntityId());
        assertEquals(0, sp1Region1.getRenderSequence());
        assertEquals(2, sp1Region1.getPageTemplateWidgets().size());
        assertTrue(sp1Region1.isLocked());
        // sub page 1 region 1 widget 1 tests
        PageTemplateWidget spw1 = sp1Region1.getPageTemplateWidgets().get(0);
        assertEquals(spw1.getPageTemplateRegion().getEntityId(), sp1Region1.getEntityId());
        assertEquals(0, spw1.getRenderSeq());
        assertNotNull(spw1.getWidget());
        assertTrue(spw1.isLocked());
        // sub page 1 region 1 widget 2 tests
        PageTemplateWidget spw2 = sp1Region1.getPageTemplateWidgets().get(1);
        assertEquals(spw2.getPageTemplateRegion().getEntityId(), sp1Region1.getEntityId());
        assertEquals(1, spw2.getRenderSeq());
        assertNotNull(spw2.getWidget());
        assertTrue(spw2.isLocked());
        // sub page 2 region tests
        PageTemplateRegion sp2Region1 = subPage2.getPageTemplateRegions().get(0);
        assertEquals(subPage2.getEntityId(), sp2Region1.getPageTemplate().getEntityId());
        assertEquals(0, sp2Region1.getRenderSequence());
        assertEquals(1, sp2Region1.getPageTemplateWidgets().size());
        assertTrue(sp2Region1.isLocked());
        // sub page 2 region widget 1 tests
        PageTemplateWidget sp2w1 = sp2Region1.getPageTemplateWidgets().get(0);
        assertEquals(sp2w1.getPageTemplateRegion().getEntityId(), sp2Region1.getEntityId());
        assertEquals(0, sp2w1.getRenderSeq());
        assertNotNull(sp2w1.getWidget());
        assertTrue(sp2w1.isLocked());

    }
View Full Code Here

        assertEquals("# of regions for parent page", 1, pt.getPageTemplateRegions().size());
        assertEquals("person_profile", pt.getPageLayout().getCode());
        assertEquals("# of widgets on parent page region", 2, pt.getPageTemplateRegions().get(0).getPageTemplateWidgets().size());

        // parent page region tests
        PageTemplateRegion ptRegion1 = pt.getPageTemplateRegions().get(0);
        assertEquals(pt.getEntityId(), ptRegion1.getPageTemplate().getEntityId());
        assertEquals(0, ptRegion1.getRenderSequence());
        assertEquals(2, ptRegion1.getPageTemplateWidgets().size());
        assertTrue(ptRegion1.isLocked());
        // parent page region 1 widget 1 tests
        PageTemplateWidget ptw1 = ptRegion1.getPageTemplateWidgets().get(0);
        assertEquals(ptw1.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidget());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(ptw2.getPageTemplateRegion().getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidget());
        assertTrue(ptw2.isLocked());
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.PageTemplateRegion

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.