Package org.apache.rave.model

Examples of org.apache.rave.model.PageTemplateWidget


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

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


    @Test
    public void convertValid() {
        JpaWidget widget = new JpaWidget();
        widget.setEntityId(1L);
        PageTemplateWidget template = new PageTemplateWidgetImpl("1");
        template.setLocked(true);
        template.setHideChrome(true);
        template.setPageTemplateRegion(new PageTemplateRegionImpl("1"));
        template.setRenderSeq(1);
        template.setWidgetId(widget.getId());

        JpaPageTemplateWidget jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPageTemplateWidget.class)));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
        assertThat(jpaTemplate.getPageTemplateRegion(), is(instanceOf(JpaPageTemplateRegion.class)));
        assertThat(jpaTemplate.getRenderSeq(), is(equalTo(template.getRenderSeq())));
        assertThat(jpaTemplate.getWidgetId(), is(equalTo(template.getWidgetId())));
        assertThat(jpaTemplate.isLocked(), is(equalTo(template.isLocked())));
        assertThat(jpaTemplate.isHideChrome(), is(equalTo(template.isHideChrome())));
    }
View Full Code Here

        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(((JpaPageTemplateRegion)ptw1.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidgetId());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)ptw2.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidgetId());
        assertTrue(ptw2.isLocked());
        // sub page 1 region 1 tests
        JpaPageTemplateRegion sp1Region1 = (JpaPageTemplateRegion)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(((JpaPageTemplateRegion)spw1.getPageTemplateRegion()).getEntityId(), sp1Region1.getEntityId());
        assertEquals(0, spw1.getRenderSeq());
        assertNotNull(spw1.getWidgetId());
        assertTrue(spw1.isLocked());
        // sub page 1 region 1 widget 2 tests
        PageTemplateWidget spw2 = sp1Region1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)spw2.getPageTemplateRegion()).getEntityId(), sp1Region1.getEntityId());
        assertEquals(1, spw2.getRenderSeq());
        assertNotNull(spw2.getWidgetId());
        assertTrue(spw2.isLocked());
        // sub page 2 region tests
        JpaPageTemplateRegion sp2Region1 = (JpaPageTemplateRegion)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(((JpaPageTemplateRegion)sp2w1.getPageTemplateRegion()).getEntityId(), sp2Region1.getEntityId());
        assertEquals(0, sp2w1.getRenderSeq());
        assertNotNull(sp2w1.getWidgetId());
        assertTrue(sp2w1.isLocked());

    }
View Full Code Here

        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(((JpaPageTemplateRegion)ptw1.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidgetId());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)ptw2.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidgetId());
        assertTrue(ptw2.isLocked());
    }
View Full Code Here

        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(((JpaPageTemplateRegion)ptw1.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidgetId());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)ptw2.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidgetId());
        assertTrue(ptw2.isLocked());
        // sub page 1 region 1 tests
        JpaPageTemplateRegion sp1Region1 = (JpaPageTemplateRegion)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(((JpaPageTemplateRegion)spw1.getPageTemplateRegion()).getEntityId(), sp1Region1.getEntityId());
        assertEquals(0, spw1.getRenderSeq());
        assertNotNull(spw1.getWidgetId());
        assertTrue(spw1.isLocked());
        // sub page 1 region 1 widget 2 tests
        PageTemplateWidget spw2 = sp1Region1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)spw2.getPageTemplateRegion()).getEntityId(), sp1Region1.getEntityId());
        assertEquals(1, spw2.getRenderSeq());
        assertNotNull(spw2.getWidgetId());
        assertTrue(spw2.isLocked());
        // sub page 2 region tests
        JpaPageTemplateRegion sp2Region1 = (JpaPageTemplateRegion)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(((JpaPageTemplateRegion)sp2w1.getPageTemplateRegion()).getEntityId(), sp2Region1.getEntityId());
        assertEquals(0, sp2w1.getRenderSeq());
        assertNotNull(sp2w1.getWidgetId());
        assertTrue(sp2w1.isLocked());

    }
View Full Code Here

        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(((JpaPageTemplateRegion)ptw1.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(0, ptw1.getRenderSeq());
        assertNotNull(ptw1.getWidgetId());
        assertTrue(ptw1.isLocked());
        // parent page region widget 2 tests
        PageTemplateWidget ptw2 = ptRegion1.getPageTemplateWidgets().get(1);
        assertEquals(((JpaPageTemplateRegion)ptw2.getPageTemplateRegion()).getEntityId(), ptRegion1.getEntityId());
        assertEquals(1, ptw2.getRenderSeq());
        assertNotNull(ptw2.getWidgetId());
        assertTrue(ptw2.isLocked());
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.model.PageTemplateWidget

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.