Package org.libreplan.business.workingday

Examples of org.libreplan.business.workingday.ResourcesPerDay


                AvailabilityTimeLine.allValid()).anyTimes();
        IAnswer<EffortDuration> durationAnswer = new IAnswer<EffortDuration>() {
            @Override
            public EffortDuration answer() throws Throwable {
                PartialDay day = (PartialDay) getCurrentArguments()[0];
                ResourcesPerDay resourcesPerDay = (ResourcesPerDay) getCurrentArguments()[1];
                return capacityMultipliedByUnits.limitDuration(resourcesPerDay
                        .asDurationGivenWorkingDayOf(day.limitWorkingDay(capacity
                                .getStandardEffort())));
            }
        };
        expect(
View Full Code Here


        LocalDate start = new LocalDate(2006, 10, 5);
        givenTaskWithStartAndEnd(toInterval(start, Period
                .days(TASK_DURATION_DAYS)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay resourcesPerDay = ResourcesPerDay.amount(1);

        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .resourcesPerDayUntil(plusDays(start, 2))
                .allocate(resourcesPerDay);

        List<GenericDayAssignment> orderedAssignmentsFor = genericResourceAllocation
                .getOrderedAssignmentsFor(worker1);
        int hoursPerDay = resourcesPerDay.asDurationGivenWorkingDayOf(
                EffortDuration.hours(8)).getHours();
        assertThat(orderedAssignmentsFor, haveHours(hoursPerDay, hoursPerDay));
    }
View Full Code Here

        LocalDate start = new LocalDate(2006, 10, 5);
        givenTaskWithStartAndEnd(toInterval(start, Period
                .days(TASK_DURATION_DAYS)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay resourcesPerDay = ResourcesPerDay.amount(1);

        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .allocate(resourcesPerDay);
        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .resourcesPerDayUntil(plusDays(start, 2))
                .allocate(resourcesPerDay);

        List<GenericDayAssignment> orderedAssignmentsFor = genericResourceAllocation
                .getOrderedAssignmentsFor(worker1);
        int hoursPerDay = resourcesPerDay.asDurationGivenWorkingDayOf(
                EffortDuration.hours(8)).getHours();
        assertThat(orderedAssignmentsFor, haveHours(hoursPerDay, hoursPerDay));
    }
View Full Code Here

    public void whenAllocatingUntilSomeEndDateBeforeTheStartNothingIsDone() {
        LocalDate start = new LocalDate(2006, 10, 5);
        givenTaskWithStartAndEnd(toInterval(start, Period.days(4)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay resourcesPerDay = ResourcesPerDay.amount(1);

        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .resourcesPerDayUntil(minusDays(start, 1))
                .allocate(resourcesPerDay);
View Full Code Here

    public void whenAllocatingUntilSomeEndDateTheEndDateMustNotBeNull() {
        LocalDate start = new LocalDate(2006, 10, 5);
        givenTaskWithStartAndEnd(toInterval(start, Period.days(4)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay resourcesPerDay = ResourcesPerDay.amount(1);

        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .resourcesPerDayUntil((IntraDayDate) null)
                .allocate(resourcesPerDay);
    }
View Full Code Here

    public void allocatingUntilEndDateEqualToStartImpliesNoAssignmentsAndZeroResourcesPerDay() {
        LocalDate start = new LocalDate(2006, 10, 5);
        givenTaskWithStartAndEnd(toInterval(start, Period.days(4)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay resourcesPerDay = ResourcesPerDay.amount(1);

        genericResourceAllocation.forResources(Arrays.asList(worker1))
                .resourcesPerDayUntil(IntraDayDate.startOfDay(start))
                .allocate(resourcesPerDay);
        assertThat(genericResourceAllocation.getResourcesPerDay(),
View Full Code Here

    public void theResourcesPerDayAreChangedWhenTheAllocationIsDone() {
        givenTaskWithStartAndEnd(toInterval(new LocalDate(2006, 10, 5), Period
                .days(2)));
        givenGenericResourceAllocationForTask(task);
        givenWorkersWithoutLoadAndWithoutCalendar();
        ResourcesPerDay assignedResourcesPerDay = ResourcesPerDay.amount(5);
        genericResourceAllocation.forResources(workers).allocate(
                assignedResourcesPerDay);
        assertThat(genericResourceAllocation.getResourcesPerDay(),
                equalTo(assignedResourcesPerDay));
    }
View Full Code Here

        givenGenericResourceAllocationForTask(task);
        givenWorkersWithLoads(8, 8, 8);

        genericResourceAllocation.forResources(workers).allocate(
                ResourcesPerDay.amount(3));
        ResourcesPerDay original = genericResourceAllocation
                .getResourcesPerDay();
        genericResourceAllocation.forResources(workers).onIntervalWithinTask(start,
                start.plusDays(2)).allocateHours(60);
        ResourcesPerDay current = genericResourceAllocation
                .getResourcesPerDay();
        assertTrue(current.getAmount()
                .compareTo(original.getAmount()) > 0);
    }
View Full Code Here

        return ResourcesPerDay.amount((BigDecimal) cached);
    }

    @Override
    public Serializable disassemble(Object value) throws HibernateException {
        ResourcesPerDay resourcesPerDay = (ResourcesPerDay) value;
        return resourcesPerDay.getAmount();
    }
View Full Code Here

            @Override
            public Void onResourcesPerDay(
                    ResourcesPerDayModification modification) {

                ResourcesPerDay realResourcesPerDay = modification
                        .getBeingModified().getNonConsolidatedResourcePerDay();
                onDifferentRealResourcesPerDay(realResourcesPerDay);

                return null;
            }
View Full Code Here

TOP

Related Classes of org.libreplan.business.workingday.ResourcesPerDay

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.