Examples of invalidUntil()


Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void addingToInterval() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidUntil(contemporaryExample);

        assertTrue(timeLine.isValid(contemporaryExample));
        assertTrue(timeLine.isValid(contemporaryExample.plusDays(1)));
        assertFalse(timeLine.isValid(contemporaryExample.minusDays(1)));
        assertFalse(timeLine.isValid(earlyExample));
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    @Test
    public void addingAllInvalidMakesAllInvalid() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidFrom(contemporaryExample);
        timeLine.invalidUntil(contemporaryExample.minusDays(10));

        assertFalse(timeLine.isValid(earlyExample));
        assertTrue(timeLine.isValid(contemporaryExample.minusDays(10)));

        assertFalse(timeLine.isValid(contemporaryExample));
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    @Test
    public void addingSeveralTypesOfIntervals() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidFrom(contemporaryExample);
        timeLine.invalidUntil(contemporaryExample.minusDays(10));

        assertFalse(timeLine.isValid(earlyExample));
        assertTrue(timeLine.isValid(contemporaryExample.minusDays(10)));

        assertFalse(timeLine.isValid(contemporaryExample));
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void anInvalidPeriodUntilGeneratesAValidIntervalAfterwards() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidUntil(contemporaryExample);
        List<Interval> validPeriods = timeLine.getValidPeriods();

        assertThat(validPeriods, definedBy(point(contemporaryExample),
                EndOfTime.create()));
    }
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void aCombinationOfSeveralInvalidPeriods() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidUntil(earlyExample);
        timeLine.invalidAt(contemporaryExample, lateExample);
        timeLine.invalidFrom(lateExample.plusDays(10));
        assertThat(timeLine.getValidPeriods(), definedBy(point(earlyExample),
                point(contemporaryExample), point(lateExample),
                point(lateExample.plusDays(10))));
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

        LocalDate previousEnd = null;
        for (CriterionSatisfaction each : satisfactions) {
            LocalDate startDate = each.getStartDate();
            assert startDate != null : "satisfactions start date is not null";
            if (previousEnd == null) {
                result.invalidUntil(startDate);
            } else {
                result.invalidAt(previousEnd, startDate);
            }
            previousEnd = each.getEndDate();
            if (previousEnd == null) {
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void ifNoAvailableHoursTheAllocationsAreNotSatisfied() {
        AvailabilityTimeLine availability = AvailabilityTimeLine.allValid();
        availability.invalidUntil(new LocalDate(2010, 11, 13));
        availability.invalidFrom(new LocalDate(2010, 11, 15));
        givenCalendarWithAvailability(availability, hours(8));
        givenSpecificAllocations(ResourcesPerDay.amount(1));
        ResourceAllocation.allocating(allocations).untilAllocating(hours(24));
        for (ResourcesPerDayModification each : allocations) {
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void ifAvailableHoursTheAllocationsAreSatisfied() {
        AvailabilityTimeLine availability = AvailabilityTimeLine.allValid();
        availability.invalidUntil(new LocalDate(2010, 11, 13));
        availability.invalidFrom(new LocalDate(2010, 11, 15));
        givenCalendarWithAvailability(availability, hours(8));
        givenSpecificAllocations(ResourcesPerDay.amount(1));
        ResourceAllocation.allocating(allocations).untilAllocating(hours(16));
        for (ResourcesPerDayModification each : allocations) {
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    @Test
    public void ifNoAllocationsCantBeDoneTheTaskEndIsReturned() {
        givenTaskOfDaysLength(10);
        AvailabilityTimeLine availability = AvailabilityTimeLine.allValid();
        availability.invalidUntil(new LocalDate(2010, 11, 13));
        availability.invalidFrom(new LocalDate(2010, 11, 15));
        givenCalendarWithAvailability(availability, hours(8));
        givenSpecificAllocations(ResourcesPerDay.amount(1));
        IntraDayDate end = ResourceAllocation.allocating(allocations)
                .untilAllocating(hours(17));
View Full Code Here

Examples of org.libreplan.business.calendars.entities.AvailabilityTimeLine.invalidUntil()

    }

    @Test
    public void theAllocationsThatAreNotSatisfiedAreNotified() {
        AvailabilityTimeLine availability = AvailabilityTimeLine.allValid();
        availability.invalidUntil(new LocalDate(2010, 11, 13));
        availability.invalidFrom(new LocalDate(2010, 11, 15));
        givenCalendarWithAvailability(availability, hours(8));
        givenSpecificAllocations(ResourcesPerDay.amount(1),
                ResourcesPerDay.amount(2));
        INotFulfilledReceiver receiver = createMock(INotFulfilledReceiver.class);
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.