Package org.apache.rave.portal.model.util

Examples of org.apache.rave.portal.model.util.WidgetStatistics


    @Before
    public void setup() {
        validUser = new User();
        validUser.setEntityId(1L);
        widgetStatistics = new WidgetStatistics();

        allWidgetStatisticsMap = new HashMap<Long, WidgetStatistics>();
        allWidgetStatisticsMap.put(WIDGET_ID, widgetStatistics);

        widgetService = createMock(WidgetService.class);
View Full Code Here


    @Test
    public void getAllWidgetStatistics() {
        Map<Long, WidgetStatistics> widgetStatistics = repository.getAllWidgetStatistics(1L);

        WidgetStatistics gadgetOne = widgetStatistics.get(1L);
        assertEquals(0, gadgetOne.getTotalLike());
        assertEquals(1, gadgetOne.getTotalDislike());
        assertEquals(0, gadgetOne.getUserRating());
        assertEquals(10, gadgetOne.getTotalUserCount());

        WidgetStatistics gadgetTwo = widgetStatistics.get(2L);
        assertEquals(1, gadgetTwo.getTotalLike());
        assertEquals(0, gadgetTwo.getTotalDislike());
        assertEquals(10, gadgetTwo.getUserRating());
        assertEquals(10, gadgetOne.getTotalUserCount());
    }
View Full Code Here

        Widget widget = repository.get(1L);
        List<WidgetRating> ratings = widget.getRatings();
        assertNotNull(ratings);
        assertEquals(1, ratings.size());

        WidgetStatistics widgetStatistics = repository.getWidgetStatistics(widget.getEntityId(), 1L);
        widgetStatistics.toString();
        assertNotNull(widgetStatistics);
        assertEquals(0, widgetStatistics.getTotalLike());
        assertEquals(1, widgetStatistics.getTotalDislike());
        assertEquals(10, widgetStatistics.getTotalUserCount());
        assertEquals(WidgetRating.DISLIKE.intValue(), widgetStatistics.getUserRating());
    }
View Full Code Here

        Widget widget = repository.get(2L);
        List<WidgetRating> ratings = widget.getRatings();
        assertNotNull(ratings);
        assertEquals(1, ratings.size());

        WidgetStatistics widgetStatistics = repository.getWidgetStatistics(widget.getEntityId(), 1L);
        assertNotNull(widgetStatistics);
        assertEquals(1, widgetStatistics.getTotalLike());
        assertEquals(0, widgetStatistics.getTotalDislike());
        assertEquals(10, widgetStatistics.getTotalUserCount());
        assertEquals(WidgetRating.LIKE.intValue(), widgetStatistics.getUserRating());
    }
View Full Code Here

        Widget widget = repository.get(3L);
        List<WidgetRating> ratings = widget.getRatings();
        assertNotNull(ratings);
        assertEquals(0, ratings.size());

        WidgetStatistics widgetStatistics = repository.getWidgetStatistics(widget.getEntityId(), 1L);
        assertNotNull(widgetStatistics);
        assertEquals(0, widgetStatistics.getTotalDislike());
        assertEquals(0, widgetStatistics.getTotalLike());
        assertEquals(WidgetRating.UNSET.intValue(), widgetStatistics.getUserRating());
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.util.WidgetStatistics

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.