Examples of WidgetImpl


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

        Page value = new PageImpl();
        value.setRegions(new ArrayList<Region>());
        value.getRegions().add(originalRegion);
        value.getRegions().add(targetRegion);
        Widget widget = new WidgetImpl();

        expect(pageRepository.get(PAGE_ID)).andReturn(value);
        expect(widgetRepository.get(WIDGET_ID)).andReturn(widget);
        expect(regionRepository.save(originalRegion)).andReturn(originalRegion);
        replay(pageRepository);
        replay(regionRepository);
        replay(widgetRepository);

        RegionWidget instance = pageService.addWidgetToPage(PAGE_ID, WIDGET_ID);

        verify(pageRepository);
        verify(regionRepository);
        verify(widgetRepository);

        verifyPositions(0, instance, true);
        assertThat(originalRegion.getRegionWidgets().get(0), is(sameInstance(instance)));
        assertThat(instance.getWidgetId(), is(equalTo(widget.getId())));

    }
View Full Code Here

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

        Page value = new PageImpl();
        value.setRegions(new ArrayList<Region>());
        value.getRegions().add(originalRegion);
        value.getRegions().add(targetRegion);
        Widget widget = new WidgetImpl();

        expect(pageRepository.get(PAGE_ID)).andReturn(value);
        expect(widgetRepository.get(WIDGET_ID)).andReturn(widget);
        expect(regionRepository.save(originalRegion)).andReturn(originalRegion);
        replay(pageRepository);
View Full Code Here

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

        Page value = new PageImpl();
        value.setRegions(new ArrayList<Region>());
        value.getRegions().add(originalRegion);
        value.getRegions().add(targetRegion);
        Widget widget = new WidgetImpl();

        expect(pageRepository.get(PAGE_ID)).andReturn(value);
        expect(widgetRepository.get(WIDGET_ID)).andReturn(widget);
        expect(regionRepository.save(originalRegion)).andReturn(originalRegion);
        replay(pageRepository,regionRepository,widgetRepository);
View Full Code Here

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

    @Test(expected = IllegalArgumentException.class)
    public void addWidgetToPage_invalidPage() {
        String WIDGET_ID = "-1";
        expect(pageRepository.get(PAGE_ID)).andReturn(null);
        expect(widgetRepository.get(WIDGET_ID)).andReturn(new WidgetImpl());
        replay(pageRepository);
        replay(regionRepository);
        replay(widgetRepository);

        pageService.addWidgetToPage(PAGE_ID, WIDGET_ID);
View Full Code Here

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

    }

    @Test
    public void getAll(){
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setTitle("B");
        Widget w2 = new WidgetImpl();
        w.setTitle("A");
        widgets.add(w);
        widgets.add(w2);

        expect(template.find(isA(Query.class))).andReturn(widgets);
View Full Code Here

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

    @Test
    public void getLimitedList(){
        int offset = 2;
        int pageSize = 10;
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setTitle("B");
        Widget w2 = new WidgetImpl();
        w.setTitle("A");
        widgets.add(w);
        widgets.add(w2);

        expect(template.find(isA(Query.class))).andReturn(widgets);
View Full Code Here

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

    public void getByFreeTextSearch(){
        int offset = 2;
        int pageSize = 10;
        String searchTerm = "test";
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setTitle("A");
        w.setDescription("test");
        widgets.add(w);

        expect(template.find(isA(Query.class))).andReturn(widgets);
        replay(template);
View Full Code Here

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

    @Test
    public void getCountFreeTextSearch(){
        long count = 0;
        String searchTerm = "test";
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        Widget w2 = new WidgetImpl();
        w.setTitle("A");
        w.setDescription("test");
        widgets.add(w);
        widgets.add(w2);
View Full Code Here

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

    @Test
    public void getByStatus(){
        int offset = 2;
        int pageSize = 10;
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setWidgetStatus(WidgetStatus.PUBLISHED);
        Widget w2 = new WidgetImpl();
        w2.setWidgetStatus(WidgetStatus.PREVIEW);
        w.setTitle("A");
        w.setDescription("test");
        widgets.add(w);
        widgets.add(w2);
View Full Code Here

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

    @Test
    public void getCountByStatus(){
        long count = 0;
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setWidgetStatus(WidgetStatus.PUBLISHED);
        Widget w2 = new WidgetImpl();
        w2.setWidgetStatus(WidgetStatus.PREVIEW);
        w.setTitle("A");
        w.setDescription("test");
        widgets.add(w);
        widgets.add(w2);
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.