Examples of DerivedDayAssignment


Examples of org.libreplan.business.planner.entities.DerivedDayAssignment

    private void givenDayAssignments(DerivedAllocation derivedAllocation,
            LocalDate start, Resource resource, int... hours) {
        dayAssignments = new ArrayList<DerivedDayAssignment>();
        for (int i = 0; i < hours.length; i++) {
            LocalDate current = start.plusDays(i);
            DerivedDayAssignment d = DerivedDayAssignment.create(current,
                    hours[i], resource, derivedAllocation);
            dayAssignments.add(d);
        }
    }
View Full Code Here

Examples of org.libreplan.business.planner.entities.DerivedDayAssignment

                }
                Iterator<DerivedDayAssignment> argIterator = arg.iterator();
                Iterator<DerivedDayAssignment> expectedIterator = expected
                        .iterator();
                while (argIterator.hasNext()) {
                    DerivedDayAssignment dayAssignment = argIterator.next();
                    DerivedDayAssignment expectedAssignment = expectedIterator.next();
                    Resource resource = dayAssignment.getResource();
                    Resource expectedResource = expectedAssignment
                            .getResource();
                    LocalDate day = dayAssignment.getDay();
                    LocalDate expectedDay = expectedAssignment.getDay();
                    int hours = dayAssignment.getHours();
                    int expectedHours = expectedAssignment
                                                    .getHours();
                    if (!resource.equals(expectedResource)
                            || !day.equals(expectedDay)
                            || hours != expectedHours) {
                        return false;
View Full Code Here

Examples of org.libreplan.business.planner.entities.DerivedDayAssignment

        LocalDate start = new LocalDate(2008, 12, 1);
        givenDayAssignments(start, worker, 8, 8, 8, 8);
        derivedAllocation.resetAssignmentsTo(dayAssignments);
        final LocalDate startInterval = start.plusDays(2);
        final LocalDate finishInterval = start.plusDays(4);
        DerivedDayAssignment newAssignment = DerivedDayAssignment.create(
                startInterval, 3, worker, derivedAllocation);
        derivedAllocation.resetAssignmentsTo(startInterval, finishInterval,
                Arrays.asList(newAssignment));
        assertThat(derivedAllocation.getAssignments(),
                compareValuesExceptParent(dayAssignments.get(0), dayAssignments
View Full Code Here

Examples of org.libreplan.business.planner.entities.DerivedDayAssignment

    public void whenResettingAssignmentsOnIntervalOnlyTheOnesAtTheIntervalAreAdded() {
        givenADerivedAllocation();
        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());
    }
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.