Examples of UsageMetricDailyStreamInfoRequest


Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

            {
                oneOf(daysAgoDateStrategy).execute(with(1));
                will(returnValue(date));

                oneOf(getDailyUsageSummaryByDateMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(DateDayExtractor
                                .getStartOfDay(date), null))));
                will(returnValue(existingSummary));

                oneOf(dayOfWeekStrategy).isWeekday(with(DateDayExtractor.getStartOfDay(date)));
                will(returnValue(true));
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

                oneOf(daysAgoDateStrategy).execute(with(1));
                will(returnValue(dateRaw));

                // no data found
                oneOf(getDailyUsageSummaryByDateMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(date, null))));
                will(returnValue(null));

                oneOf(getDailyUniqueVisitorCountMapper).execute(with(date));
                will(returnValue(uniqueVisitorCount));

                oneOf(getDailyPageViewCountMapper).execute(with(date));
                will(returnValue(pageViewCount));

                oneOf(getDailyStreamViewerCountMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(date, null))));
                will(returnValue(streamViewerCount));

                oneOf(getDailyStreamViewCountMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(date, null))));
                will(returnValue(streamViewCount));

                oneOf(getDailyStreamContributorCountMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(date, null))));
                will(returnValue(streamContributorCount));

                oneOf(getDailyMessageResponseTimeMapper).execute(with(date));
                will(returnValue(avgActivityResponseTime));

                oneOf(getDailyMessageCountMapper).execute(
                        with(IsEqualInternally.equalInternally(new UsageMetricDailyStreamInfoRequest(date, null))));
                will(returnValue(messageCount));

                oneOf(dayOfWeekStrategy).isWeekday(with(date));
                will(returnValue(true));
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

            return;
        }

        logger.info("Checking id daily usage summary data exists for " + reportDate);
        DailyUsageSummary existingSummary = getDailyUsageSummaryByDateMapper
                .execute(new UsageMetricDailyStreamInfoRequest(reportDate, null));
        clearEntityManagerMapper.execute(null);

        if (existingSummary != null)
        {
            logger.info("Data already exists for " + reportDate);
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

     */
    private void generateDailyUsageSummaryForStreamScope(final Date inDate, final Long inStreamScopeId)
    {
        try
        {
            UsageMetricDailyStreamInfoRequest streamInfoRequest = new UsageMetricDailyStreamInfoRequest(inDate,
                    inStreamScopeId);

            String timerLog = "TimerData:" + inStreamScopeId;
            long start;
            long totalStart = System.currentTimeMillis();
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

        getEntityManager().createQuery("UPDATE Activity set postedTime=:date").setParameter("date",
                new Date(apri8th2011)).executeUpdate();
        getEntityManager().createQuery("UPDATE Comment set timeSent=:date").setParameter("date", new Date(apri8th2011))
                .executeUpdate();

        Assert.assertEquals(4L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), null)));

        // push all activities out of the date range
        getEntityManager().createQuery("UPDATE Activity set postedTime=:date").setParameter("date",
                new Date(april7th2011)).executeUpdate();
        Assert.assertEquals(3L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), null)));

        // push all comments out of the date range
        getEntityManager().createQuery("UPDATE Comment set timeSent=:date")
                .setParameter("date", new Date(april7th2011)).executeUpdate();
        Assert.assertEquals(0L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), null)));

        // now pull back just the comments
        getEntityManager().createQuery("UPDATE Comment set timeSent=:date").setParameter("date", new Date(apri8th2011))
                .executeUpdate();
        Assert.assertEquals(3L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), null)));
    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

        getEntityManager().createQuery("UPDATE Activity set postedTime=:date").setParameter("date",
                new Date(apri8th2011)).executeUpdate();
        getEntityManager().createQuery("UPDATE Comment set timeSent=:date").setParameter("date", new Date(apri8th2011))
                .executeUpdate();

        Assert.assertEquals(3L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011),
                streamScopeId)));

    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

    @Test
    public void testExecuteWithResults()
    {
        final Long streamScopeId = 87433L;
        Assert.assertEquals(new Long(6L),
                sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(), streamScopeId)));
    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

     */
    @Test
    public void testExecuteWithNoResults()
    {
        final Long streamScopeId = 87433388L;
        Assert.assertEquals(new Long(0), sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(), streamScopeId)));
    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

        getEntityManager().flush();
        getEntityManager().clear();

        // test with all streams
        Assert.assertEquals(3L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), null)));

        // test with stream #1
        Assert.assertEquals(2L, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(new Date(apri8th2011), 1L)));
    }
View Full Code Here

Examples of org.eurekastreams.server.service.actions.requests.UsageMetricDailyStreamInfoRequest

     */
    @Test
    public void testExecuteForAllStreams()
    {
        Date april4th = new Date(april4th2011 + 8); // change the date a little bit
        assertEquals(3, (long) sut.execute(new UsageMetricDailyStreamInfoRequest(april4th, null)));
    }
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.