Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.JpaPage$SubPageComparator


    @Autowired
    private JpaPageConverter pageConverter;

    @Test
    public void noConversion() {
        Page page = new JpaPage();
        assertThat(pageConverter.convert(page), is(sameInstance(page)));
    }
View Full Code Here


        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

    @Test
    public void newRegion() {
        Region region = new RegionImpl("9");
        region.setLocked(false);
        region.setPage(new JpaPage());
        region.setRegionWidgets(new ArrayList<RegionWidget>());
        region.setRenderOrder(9);

        JpaRegion converted = regionConverter.convert(region);
        assertThat(converted, is(not(sameInstance(region))));
View Full Code Here

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
            if(converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = manager.find(JpaPage.class, source.getId() == null ? null : Long.parseLong(source.getId()));
            if (converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = manager.find(JpaPage.class, source.getId());
            if (converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

    public JpaPage convert(Page source) {
        return source instanceof JpaPage ? (JpaPage) source : createEntity(source);
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = null;
        if (source != null) {
            converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
            if(converted == null) {
                converted = new JpaPage();
            }
            updateProperties(source, converted);
        }
        return converted;
    }
View Full Code Here

        }
        return null;
    }

    private JpaPage createEntity(Page source) {
        JpaPage converted = source.getId() == null ? new JpaPage() : manager.find(JpaPage.class, Long.parseLong(source.getId()));
        if (converted == null) {
            converted = new JpaPage();
        }
        updateProperties(source, converted);
        return converted;
    }
View Full Code Here

    @Autowired
    private JpaPageConverter pageConverter;

    @Test
    public void noConversion() {
        Page page = new JpaPage();
        assertThat(pageConverter.convert(page), is(sameInstance(page)));
    }
View Full Code Here

        page.setParentPage(new PageImpl("1"));
        page.setRegions(new ArrayList<Region>());
        page.setSubPages(new ArrayList<Page>());
        page.setProperties(new HashMap<String, Object>());

        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.getContextId(), is(equalTo(page.getContextId())));
        assertThat(converted.getPageLayout().getCode(), is(equalTo(page.getPageLayout().getCode())));
        assertThat(converted.getPageType(), is(equalTo(page.getPageType())));
        assertThat(converted.getSubPages(), is(equalTo(page.getSubPages())));
        assertThat(converted.getProperties(), is(equalTo(page.getProperties())));
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.JpaPage$SubPageComparator

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.