Examples of WidgetImpl


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

        int offset = 2;
        int pageSize = 10;
        String type = "type";
        String searchTerm = "test" ;
        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");
        w.setType(type);
        widgets.add(w);
        widgets.add(w2);
View Full Code Here

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

        int offset = 2;
        int pageSize = 10;
        String type = "type";
        String searchTerm = "test" ;
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        Widget w2 = new WidgetImpl();
        widgets.add(w);
        widgets.add(w2);

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

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

    public void getCountByStatusAndTypeAndFreeText(){
        long count = 0;
        String type = "type";
        String searchTerm = "test" ;
        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

    public void getByOwmer(){
        int offset = 2;
        int pageSize = 10;
        User owner = new UserImpl("1234L");
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setOwnerId(owner.getId());
        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

        int offset = 2;
        int pageSize = 10;
        String id = "1234L";
        User owner = new UserImpl(id);
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        w.setOwnerId(id);
        widgets.add(w);

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

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

    }

    @Test
    public void getByUrl(){
        String widgetUrl = "www.test.com";
        Widget widget = new WidgetImpl();
        widget.setUrl(widgetUrl);

        expect(template.findOne(new Query(where("url").is(widgetUrl)))).andReturn(widget);
        replay(template);

        Widget result = repo.getByUrl(widgetUrl);
View Full Code Here

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

    public void getUserWidgetRatings(){
        String userId = "1234L";
        Map<String, WidgetRating> wr = Maps.newHashMap();
        List<Widget> widgets = Lists.newArrayList();
        List<WidgetRating> widget_ratings = Lists.newArrayList();
        Widget widget = new WidgetImpl("1111L");
        WidgetRating rating1 = new WidgetRatingImpl();
        WidgetRating rating2 = new WidgetRatingImpl();
        rating1.setUserId(userId);
        rating2.setUserId("5555L");
        widget_ratings.add(rating1);
        widget_ratings.add(rating2);
        widget.setRatings(widget_ratings);
        widgets.add(widget);
        Query q = query(where("ratings").elemMatch(where("userId").is(userId)));

        expect(template.find(q)).andReturn(widgets);
        replay(template);
View Full Code Here

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

    public void getWidgetByTag(){
        int offset = 2;
        int pagesize = 10;
        String tagKeyword = "test";
        List<Widget> widgets = Lists.newArrayList();
        Widget widget = new WidgetImpl();
        Tag tag = new TagImpl();
        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 deleteAll(){
        String userId = "1234L";
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        List<WidgetComment> comments = Lists.newArrayList();
        WidgetComment wc1 = new WidgetCommentImpl();
        WidgetComment wc2 = new WidgetCommentImpl();
        wc1.setUserId(userId);
        wc2.setUserId(userId);
        comments.add(wc1);
        comments.add(wc2);
        w.setComments(comments);
        widgets.add(w);

        expect(template.find(query(where("comments").elemMatch(where("userId").is(userId))))).andReturn(widgets);
        expect(template.save(isA(Widget.class))).andReturn(w);
        expect(template.find(query(where("comments").elemMatch(where("userId").is(userId))))).andReturn(widgets);
View Full Code Here

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

    @Test
    public void deleteAll_zero(){
        String userId = "1234L";
        String userId_2 = "1111L";
        List<Widget> widgets = Lists.newArrayList();
        Widget w = new WidgetImpl();
        List<WidgetComment> comments = Lists.newArrayList();
        WidgetComment wc1 = new WidgetCommentImpl();
        WidgetComment wc2 = new WidgetCommentImpl();
        wc1.setUserId(userId_2);
        wc2.setUserId(userId_2);
        comments.add(wc1);
        comments.add(wc2);
        w.setComments(comments);
        widgets.add(w);

        expect(template.find(query(where("comments").elemMatch(where("userId").is(userId))))).andReturn(widgets);
        replay(template);
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.