Examples of invalidFrom()


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

    }

    @Test
    public void addingFromInterval() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidFrom(contemporaryExample);

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

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

    }

    @Test
    public void addingAndAlreadyIncludedIntervalToAFromIntervalDoesNothing() {
        AvailabilityTimeLine timeLine = AvailabilityTimeLine.allValid();
        timeLine.invalidFrom(contemporaryExample);
        timeLine.invalidAt(contemporaryExample.plusDays(30),
                contemporaryExample.plusDays(100));

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

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

    }

    @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)));
View Full Code Here

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

    }

    @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)));
View Full Code Here

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

    }

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

        assertThat(validPeriods, definedBy(StartOfTime.create(),
                new FixedPoint(contemporaryExample)));
    }
View Full Code Here

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

    @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.invalidFrom()

            if (previousEnd == null) {
                break;
            }
        }
        if (previousEnd != null) {
            result.invalidFrom(previousEnd);
        }
        return result;
    }

}
View Full Code Here

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

    @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) {
            assertTrue(each.getBeingModified().isUnsatisfied());
View Full Code Here

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

    @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) {
            assertTrue(each.getBeingModified().isSatisfied());
View Full Code Here

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

    @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));
        IntraDayDate expectedEnd = IntraDayDate.startOfDay(task
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.