Package org.joda.time

Examples of org.joda.time.LocalDate.plusDays()


                .minusDays(10));
        timeLine.invalidAt(intervalStart.minusDays(10), intervalStart);
        LocalDate current = intervalStart.minusDays(20);
        while (current.isBefore(intervalEnd)) {
            assertFalse(timeLine.isValid(current));
            current = current.plusDays(1);
        }
    }

    @Test
    public void pointsAreMergedCorrectly() {
View Full Code Here


        SpecificDayAssignment specificDayAssignment = new SpecificDayAssignment(
                today, hours(10), worker);
        SpecificDayAssignment another = new SpecificDayAssignment(today,
                hours(3), worker);
        SpecificDayAssignment atAnotherDay = new SpecificDayAssignment(
                today.plusDays(1), hours(1), worker);
        givenWorkerWithAssignments(specificDayAssignment, another, atAnotherDay);

        assertThat(worker.getAssignedEffort(today), equalTo(hours(13)));
    }
View Full Code Here

    @Test
    public void testAllowSetValidFromInThePast() {
        BaseCalendar calendar = createBasicCalendar();

        LocalDate currentDate = new LocalDate();
        calendar.newVersion(currentDate.plusDays(1));

        LocalDate pastWeek = currentDate.minusWeeks(1);

        calendar.setValidFrom(pastWeek, currentDate.plusDays(1));
    }
View Full Code Here

        }

        final Task task = resourceAllocation.getTask();
        final LocalDate consolidatedEnd = lastDay(consolidated);

        return Stretch.create(consolidatedEnd.plusDays(1), resourceAllocation,
                task.getAdvancePercentage());
    }

    private ConsolidatedStretch() {
View Full Code Here

    @Test
    public void theLastIntervalHasStart() {
        givenStretchesFunction();
        LocalDate strechDate = new LocalDate().plusDays(1);
        givenStretchAsChild(strechDate, new BigDecimal(0.5));
        givenStretchAsChild(strechDate.plusDays(2), new BigDecimal(1));
        Interval lastInterval = stretchesFunction
                .getIntervalsDefinedByStreches().get(2);
        assertThat(lastInterval.getStart(), equalTo(strechDate));
    }
View Full Code Here

        givenStretchesFunction();
        LocalDate start = new LocalDate().plusDays(1);
        givenStretchAsChild(start, new BigDecimal(0.5));
        LocalDate middleEnd = start.plusDays(2);
        givenStretchAsChild(middleEnd, new BigDecimal(0.6));
        givenStretchAsChild(middleEnd.plusDays(3), new BigDecimal(1));
        Interval middle = stretchesFunction.getIntervalsDefinedByStreches()
                .get(2);
        assertFalse(middle.hasNoStart());
        assertThat(middle.getStart(), equalTo(start));
        assertThat(middle.getEnd(), equalTo(middleEnd));
View Full Code Here

        givenStretchesFunction();
        LocalDate start = new LocalDate().plusDays(1);
        givenStretchAsChild(start, new BigDecimal(0.5));
        LocalDate middleEnd = start.plusDays(2);
        givenStretchAsChild(middleEnd, new BigDecimal(0.8));
        givenStretchAsChild(middleEnd.plusDays(3), new BigDecimal(1));
        Interval first = stretchesFunction.getIntervalsDefinedByStreches().get(
                1);
        Interval middle = stretchesFunction.getIntervalsDefinedByStreches()
                .get(2);
        Interval last = stretchesFunction.getIntervalsDefinedByStreches()
View Full Code Here

    }

    @Test
    public void ifTheIntervalStartIsNotNullReturnsItsStartDate() {
        LocalDate start = new LocalDate().plusMonths(1);
        Interval interval = new Interval(new BigDecimal(0.3), start, start
                .plusDays(20));
        assertThat(interval.getStartFor(new LocalDate()), equalTo(start));
    }

    @Test
View Full Code Here

            capacity = calendar.getCapacityOn(PartialDay.wholeDay(day));
            if (!EffortDuration.zero().equals(capacity)) {
                allocate(resourceAllocation, day, hours);
                i++;
            }
            day = day.plusDays(1);
        }
        Validate.isTrue(resourceAllocation.getEndDate().equals(previousEndDate));
    }

    private List<BigDecimal> daysWithAllocatedHours(
View Full Code Here

        LocalDate start = new LocalDate(2008, 12, 1);
        givenDayAssignments(start, worker, 8, 8, 8, 8);
        derivedAllocation.resetAssignmentsTo(dayAssignments);
        DerivedDayAssignment newAssignment = DerivedDayAssignment.create(start
                .minusDays(1), 3, worker, derivedAllocation);
        derivedAllocation.resetAssignmentsTo(start, start.plusDays(4), Arrays
                .asList(newAssignment));
        assertTrue(derivedAllocation.getAssignments().isEmpty());
    }

    @Test
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.