Examples of OrderVersion


Examples of org.libreplan.business.scenarios.entities.OrderVersion

    private Task createValidTask() {
        associatedHoursGroup = new HoursGroup();
        associatedHoursGroup.setCode("hours-group-code-" + UUID.randomUUID());
        OrderLine orderLine = createOrderLine();
        orderLine.addHoursGroup(associatedHoursGroup);
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager,
                orderLine.getOrder());
        orderLine.useSchedulingDataFor(orderVersion);
        SchedulingDataForVersion schedulingDataForVersion = orderLine
                .getCurrentSchedulingDataForVersion();
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

        return sessionFactory.getCurrentSession();
    }

    private Order createValidOrder() {
        Order order = Order.create();
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(orderVersion);
        order.setDescription("description");
        order.setInitDate(CriterionSatisfactionDAOTest.year(2000)
                .toDateTimeAtStartOfDay().toDate());
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

public class ResourceAllocationDAOTest {

    public static OrderVersion setupVersionUsing(
            IScenarioManager scenarioManager, Order order) {
        Scenario current = scenarioManager.getCurrent();
        OrderVersion result = OrderVersion.createInitialVersion(current);
        order.setVersionForScenario(current, result);
        return result;
    }
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

    }

    private OrderLine createValidOrderLine() {
        Order order = new Order();
        order.setInitDate(new Date());
        OrderVersion orderVersion = setupVersionUsing(scenarioManager, order);
        order.useSchedulingDataFor(orderVersion);
        OrderLine orderLine = OrderLine.create();
        order.add(orderLine);
        orderLine.setName(UUID.randomUUID().toString());
        orderLine.setCode(UUID.randomUUID().toString());
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

    private ResourceAllocation<?> createValidResourceAllocation(
            ResourceAllocationType type) {
        OrderLine orderLine = createValidOrderLine();
        Order order = orderLine.getOrder();
        OrderVersion orderVersion = setupVersionUsing(scenarioManager,
                order);
        orderLine.useSchedulingDataFor(orderVersion);
        assert orderLine.getSchedulingStateType().isSomewhatScheduled();

        orderElementDAO.save(orderLine);
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

        order.setCode(UUID.randomUUID().toString());
        order.setInitDate(new Date());
        BaseCalendar basicCalendar = BaseCalendarTest.createBasicCalendar();
        calendarDAO.save(basicCalendar);
        order.setCalendar(basicCalendar);
        OrderVersion orderVersion = ResourceAllocationDAOTest
                .setupVersionUsing(scenarioManager, order);
        orderElementDAO.save(order);
        orderElementDAO.flush();
        order.useSchedulingDataFor(orderVersion);
        return order;
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

    public void testSaveOrderLineGroupWithAdvanceAssignments()
            throws DuplicateValueTrueReportGlobalAdvanceException,
            DuplicateAdvanceAssignmentForOrderElementException,
            InstanceNotFoundException {
        Order order = createValidOrder();
        OrderVersion orderVersion = order.getOrderVersionFor(scenarioManager
                .getCurrent());
        OrderElement orderElement = OrderElementTest
                .givenOrderLineGroupWithTwoOrderLines(orderVersion,
                        2000, 3000);
        order.add(orderElement);
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

    public void testRemoveOrderLineGroupWithAdvanceAssignments()
            throws DuplicateValueTrueReportGlobalAdvanceException,
            DuplicateAdvanceAssignmentForOrderElementException,
            InstanceNotFoundException {
        Order order = createValidOrder();
        OrderVersion orderVersion = order.getOrderVersionFor(scenarioManager
                .getCurrent());
        OrderElement orderElement = OrderElementTest
                .givenOrderLineGroupWithTwoOrderLines(orderVersion, 2000, 3000);
        order.add(orderElement);
        order.useSchedulingDataFor(order.getOrderVersionFor(scenarioManager
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

    void setupScenario(Order order) {
        if (!order.hasNoVersions()) {
            return;
        }
        Scenario currentScenario = scenarioManager.getCurrent();
        OrderVersion orderVersion = currentScenario.addOrder(order);
        order.setVersionForScenario(currentScenario, orderVersion);
        order.useSchedulingDataFor(currentScenario);
    }
View Full Code Here

Examples of org.libreplan.business.scenarios.entities.OrderVersion

            return new UsingOwnerScenario(currentScenario, orderReloaded);
        }
        final List<DayAssignment> previousAssignments = orderReloaded
                .getDayAssignments(DayAssignment.FilterType.KEEP_ALL);

        OrderVersion newVersion = OrderVersion
                .createInitialVersion(currentScenario);

        orderReloaded.writeSchedulingDataChangesTo(currentScenario, newVersion);
        switchAllocationsToScenario(currentScenario,
                orderReloaded.getAssociatedTaskElement());
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.