Package org.jasig.portal.events.aggr

Examples of org.jasig.portal.events.aggr.DateDimension


  @Test
  public void testGetMinMaxDateDimension() {
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateDimension newestDateDimension = dateDimensionDao.getNewestDateDimension();
                assertNull(newestDateDimension);
            }
        });
       
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final List<DateDimension> dateDimensions = dateDimensionDao.getDateDimensions();
               
                assertEquals(Collections.EMPTY_LIST, dateDimensions);
            }
        });
       
       
        this.executeInTransaction(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                DateMidnight date = new DateMidnight(2012, 1, 1);
               
                for (int i = 0; i < 7; i++) {
                    dateDimensionDao.createDateDimension(date, 0, null);
                    date = date.plusDays(1);
                }
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                DateMidnight date = new DateMidnight(2012, 1, 1);
                final DateDimension dateDimension = dateDimensionDao.getDateDimensionByDate(date);
                assertNotNull(dateDimension);
            }
        });
       
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final List<DateDimension> dateDimensions = dateDimensionDao.getDateDimensions();
               
                assertEquals(7, dateDimensions.size());
            }
        });
       
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateMidnight start = new DateMidnight(2012, 1, 2);
                final DateMidnight end = new DateMidnight(2012, 1, 6);
                final List<DateDimension> dateDimensions = dateDimensionDao.getDateDimensionsBetween(start, end);
               
                assertEquals(4, dateDimensions.size());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateDimension oldestDateDimension = dateDimensionDao.getOldestDateDimension();
               
                assertEquals(2012, oldestDateDimension.getYear());
                assertEquals(1, oldestDateDimension.getMonth());
                assertEquals(1, oldestDateDimension.getDay());
            }
        });
       
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
                final DateDimension newestDateDimension = dateDimensionDao.getNewestDateDimension();
               
                assertEquals(2012, newestDateDimension.getYear());
                assertEquals(1, newestDateDimension.getMonth());
                assertEquals(7, newestDateDimension.getDay());
            }
        });
  }
View Full Code Here


    @Override
    protected TabRenderAggregationKey createAggregationKey(AggregationIntervalInfo intervalInfo,
            AggregatedGroupMapping aggregatedGroup) {
       
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        final AggregatedTabMapping mappedTab = this.aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1n1");
        return new TabRenderAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedTab);
    }
View Full Code Here

    @Override
    protected Map<TabRenderAggregationKey, TabRenderAggregationImpl> createAggregations(
            AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
       
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        final AggregatedTabMapping mappedTab = this.aggregatedTabLookupDao.getMappedTabForLayoutId("u1l1n1");
        final TabRenderAggregationKeyImpl key = new TabRenderAggregationKeyImpl(
                dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedTab);
View Full Code Here

        aggregation.countUser(RandomStringUtils.random(8, 0, 0, true, true, null, r));
    }

    @Override
    protected LoginAggregationKey createAggregationKey(AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        return new LoginAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup);
    }
View Full Code Here

    @Override
    protected Map<LoginAggregationKey, LoginAggregationImpl> createAggregations(AggregationIntervalInfo intervalInfo,
            AggregatedGroupMapping aggregatedGroup) {

        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        final LoginAggregationKeyImpl key = new LoginAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup);
        final LoginAggregationImpl aggr = loginAggregationDao.createAggregation(key);
        return Collections.<LoginAggregationKey, LoginAggregationImpl>singletonMap(key, aggr);
View Full Code Here

    @Override
    protected PortletExecutionAggregationKey createAggregationKey(AggregationIntervalInfo intervalInfo,
            AggregatedGroupMapping aggregatedGroup) {
       
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
       
        final AggregatedPortletMapping mappedPortlet = aggregatedPortletLookupDao.getMappedPortletForFname("Foo");
       
View Full Code Here

    @Override
    protected Map<PortletExecutionAggregationKey, PortletExecutionAggregationImpl> createAggregations(
            AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
       
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        final AggregatedPortletMapping mappedPortlet = aggregatedPortletLookupDao.getMappedPortletForFname("Foo");
        final PortletExecutionAggregationKeyImpl key = new PortletExecutionAggregationKeyImpl(
                dateDimension, timeDimension, aggregationInterval, aggregatedGroup, mappedPortlet, ExecutionType.ALL);
View Full Code Here

        aggregation.countSession(RandomStringUtils.random(8, 0, 0, true, true, null, r));
    }

    @Override
    protected ConcurrentUserAggregationKey createAggregationKey(AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        return new ConcurrentUserAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup);
    }
View Full Code Here

    @Override
    protected Map<ConcurrentUserAggregationKey, ConcurrentUserAggregationImpl> createAggregations(
            AggregationIntervalInfo intervalInfo, AggregatedGroupMapping aggregatedGroup) {
       
        final DateDimension dateDimension = intervalInfo.getDateDimension();
        final TimeDimension timeDimension = intervalInfo.getTimeDimension();
        final AggregationInterval aggregationInterval = intervalInfo.getAggregationInterval();
        final ConcurrentUserAggregationKeyImpl key = new ConcurrentUserAggregationKeyImpl(dateDimension, timeDimension, aggregationInterval, aggregatedGroup);
        final ConcurrentUserAggregationImpl aggr = concurrentUserAggregationDao.createAggregation(key);
        return Collections.<ConcurrentUserAggregationKey, ConcurrentUserAggregationImpl>singletonMap(key, aggr);
View Full Code Here


    @Override
    protected PortletExecutionAggregationImpl createAggregationInstance(PortletExecutionAggregationKey key) {
        final TimeDimension timeDimension = key.getTimeDimension();
        final DateDimension dateDimension = key.getDateDimension();
        final AggregationInterval interval = key.getInterval();
        final AggregatedGroupMapping aggregatedGroup = key.getAggregatedGroup();
        final AggregatedPortletMapping portletMapping = key.getPortletMapping();
        final ExecutionType executionType = key.getExecutionType();
        return new PortletExecutionAggregationImpl(timeDimension, dateDimension, interval, aggregatedGroup, portletMapping, executionType);
View Full Code Here

TOP

Related Classes of org.jasig.portal.events.aggr.DateDimension

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.