Package org.apache.rave.model

Examples of org.apache.rave.model.Region


        String regionWidgetId3 = "2874L";
        Page page = new PageImpl("1234L");
        List<Page> pages = Lists.newArrayList();
        List<Region> regions = Lists.newArrayList();
        List<RegionWidget> regionWidgets = Lists.newArrayList();
        Region region = new RegionImpl(id);
        Region region2 = new RegionImpl(id2);
        RegionWidget rw1 = new RegionWidgetImpl(regionWidgetId1);
        RegionWidget rw2 = new RegionWidgetImpl(regionWidgetId2);
        RegionWidget rw3 = new RegionWidgetImpl(regionWidgetId3);
        regions.add(region);
        regions.add(region2);
View Full Code Here


        String regionWidgetId3 = "2874L";
        Page page = new PageImpl("1234L");
        List<Page> pages = Lists.newArrayList();
        List<Region> regions = Lists.newArrayList();
        List<RegionWidget> regionWidgets = Lists.newArrayList();
        Region region = new RegionImpl(id);
        Region region2 = new RegionImpl(id2);
        RegionWidget rw1 = new RegionWidgetImpl(regionWidgetId1);
        RegionWidget rw2 = new RegionWidgetImpl(regionWidgetId2);
        RegionWidget rw3 = new RegionWidgetImpl(regionWidgetId3);
        regions.add(region);
        regions.add(region2);
View Full Code Here

    @Test
    public void get(){
        String id = "1111L";
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region region = new RegionImpl(id);
        regions.add(region);
        page.setRegions(regions);

        expect(template.findOne(new Query(Criteria.where("regions").elemMatch(Criteria.where("_id").is(id))))).andReturn(page);
        replay(template);

        Region result = repo.get(id);
        assertNotNull(result);
        assertThat(result, is(equalTo(region)));
        assertThat(result.getId(), equalTo(id));

    }
View Full Code Here

    @Test
    public void get_null(){
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region region = new RegionImpl("1111L");
        regions.add(region);
        page.setRegions(regions);

        expect(template.findOne(new Query(Criteria.where("regions").elemMatch(Criteria.where("_id").is("2222L"))))).andReturn(page);
        replay(template);

        Region result = repo.get("2222L");
        assertNull(result);

    }
View Full Code Here

    @Test
    public void save(){
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region item = new RegionImpl("1111L");
        regions.add(item);
        page.setRegions(regions);

        expect(template.findOne(new Query(Criteria.where("regions").elemMatch(Criteria.where("_id").is("1111L"))))).andReturn(page);
        expect(template.save(isA(Page.class))).andReturn(page);
        replay(template);

        Region result = repo.save(item);
        assertThat(result.getId(), is(equalTo("1111L")));
        assertThat(result, is(sameInstance(item)));

    }
View Full Code Here

    @Test
    public void save_null(){
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region item = new RegionImpl();
        item.setPage(page);
        regions.add(item);
        page.setRegions(regions);

        expect(template.get("1234L")).andReturn(page);
        expect(template.save(isA(Page.class))).andReturn(page);
        replay(template);

        Region result = repo.save(item);
        assertNull(result.getId());

    }
View Full Code Here

    @Test
     public void delete(){
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region item = new RegionImpl("1111L");
        regions.add(item);
        page.setRegions(regions);

        expect(template.findOne(new Query(Criteria.where("regions").elemMatch(Criteria.where("_id").is("1111L"))))).andReturn(page);
        expect(template.save(isA(Page.class))).andReturn(page);
View Full Code Here

    @Test (expected = IllegalStateException.class)
    public void delete_null(){
        Page page = new PageImpl("1234L");
        List<Region> regions = Lists.newArrayList();
        Region item = new RegionImpl();
        regions.add(item);
        page.setRegions(regions);

        repo.delete(item);
    }
View Full Code Here

        String id = "1111L";
        String id2 = "2222L";
        Page page = new PageImpl("1234L");
        List<Page> pages = Lists.newArrayList();
        List<Region> regions = Lists.newArrayList();
        Region region = new RegionImpl(id);
        Region region2 = new RegionImpl(id2);
        regions.add(region);
        regions.add(region2);
        pages.add(page);
        page.setRegions(regions);
View Full Code Here

        String id = "1111L";
        String id2 = "2222L";
        Page page = new PageImpl("1234L");
        List<Page> pages = Lists.newArrayList();
        List<Region> regions = Lists.newArrayList();
        Region region = new RegionImpl(id);
        Region region2 = new RegionImpl(id2);
        regions.add(region);
        regions.add(region2);
        pages.add(page);
        page.setRegions(regions);
View Full Code Here

TOP

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

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.