Package org.jasig.portal.events.aggr.dao.jpa

Examples of org.jasig.portal.events.aggr.dao.jpa.AcademicTermDetailImpl


  @Before
  public void setUp() {
      when(eventAggregationManagementDao.getQuartersDetails()).thenReturn(EventDateTimeUtils.createStandardQuarters());
     
      final List<AcademicTermDetail> terms = ImmutableList.<AcademicTermDetail>of(
              new AcademicTermDetailImpl(new DateMidnight(2012, 1, 12), new DateMidnight(2012, 4, 1), "spring 2"),
              new AcademicTermDetailImpl(new DateMidnight(2012, 4, 1), new DateMidnight(2012, 7, 1), "summer 2"),
                new AcademicTermDetailImpl(new DateMidnight(2012, 7, 1), new DateMidnight(2012, 12, 15), "fall 2"),
                new AcademicTermDetailImpl(new DateMidnight(2012, 12, 15), new DateMidnight(2013, 1, 14), "winter 2"),
                new AcademicTermDetailImpl(new DateMidnight(2015, 12, 15), new DateMidnight(2016, 1, 14), "winter 5")
        );
        when(eventAggregationManagementDao.getAcademicTermDetails()).thenReturn(terms);
  }
View Full Code Here


     * Return a sorted list of AcademicTermDetail objects where the the first element of the list where the first element
     * is the first term that starts after the specified start DateTime.
     */
    protected List<AcademicTermDetail> getAcademicTermsAfter(DateTime start) {
        final List<AcademicTermDetail> terms = this.eventAggregationManagementDao.getAcademicTermDetails();
        final int index = Collections.binarySearch(terms, new AcademicTermDetailImpl(start.toDateMidnight(), start.plusDays(1).toDateMidnight(), ""));
        if (index > 0) {
            return terms.subList(index, terms.size());
        }
        else if (index < 0) {
            return terms.subList(-(index + 1), terms.size());
View Full Code Here

       

        //Set academic term if configured
        final List<AcademicTermDetail> academicTerms = Lists.transform(data.getTermDetails(), new Function<ExternalTermDetail, AcademicTermDetail>() {
            public AcademicTermDetail apply(ExternalTermDetail externalTermDetail) {
                return new AcademicTermDetailImpl(
                    new DateMidnight(externalTermDetail.getStart()),
                    new DateMidnight(externalTermDetail.getEnd()),
                    externalTermDetail.getName());
            }
        });
View Full Code Here

TOP

Related Classes of org.jasig.portal.events.aggr.dao.jpa.AcademicTermDetailImpl

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.