Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.Task$DurationBetweenDates


    @Test
    @Transactional
    public void testStoreSubcontractedTaskData()
            throws InstanceNotFoundException {
        Task task = createValidTask();

        SubcontractedTaskData subcontractedTaskData = SubcontractedTaskData
                .create(task);
        subcontractedTaskData.addRequiredDeliveringDates(SubcontractorDeliverDate
                .create(new Date(),new Date(), null));
        subcontractedTaskData.setExternalCompany(getSubcontractorExternalCompanySaved());

        task.setSubcontractedTaskData(subcontractedTaskData);
        taskElementDAO.save(task);
        taskElementDAO.flush();
        sessionFactory.getCurrentSession().evict(task);
        sessionFactory.getCurrentSession().evict(subcontractedTaskData);

        Task taskFound = (Task) taskElementDAO.find(task.getId());
        assertNotNull(taskFound.getSubcontractedTaskData());

        SubcontractedTaskData subcontractedTaskDataFound = subcontractedTaskDataDAO
                .find(subcontractedTaskData.getId());
        assertNotNull(subcontractedTaskDataFound.getTask());
    }
View Full Code Here


        IOnTransaction<Long> createTaskElement =
            new IOnTransaction<Long>() {

            @Override
            public Long execute() {
                Task task = createValidTask();
                TaskGroup taskGroup = createValidTaskGroup();
                taskGroup.addTaskElement(task);

                SpecificResourceAllocation allocation =
                    SpecificResourceAllocation.create(task);
                allocation.setResource(createValidWorker());
                LocalDate start = task.getStartAsLocalDate();
                task.setIntraDayEndDate(IntraDayDate.startOfDay(start
                        .plusDays(3)));
                allocation.onIntervalWithinTask(start, start.plusDays(3))
                        .allocateHours(24);
                assertTrue(allocation.getAssignedHours() > 0);

                task.addResourceAllocation(allocation);
                taskElementDAO.save(taskGroup);

                return task.getId();
            }
        };

        final Long id = transactionService.runOnTransaction(createTaskElement);
View Full Code Here

            return result;
        }

        private void findTasks(TaskElement taskElement, List<Task> result) {
            if (taskElement instanceof Task) {
                Task t = (Task) taskElement;
                result.add(t);
            }
            for (TaskElement each : taskElement.getChildren()) {
                findTasks(each, result);
            }
View Full Code Here

        private List<ResourceAllocation<?>> allocationsNotInOrder(
                Collection<? extends ResourceAllocation<?>> allocationsReturnedByQuery,
                Set<Long> orderElementsIds) {
            List<ResourceAllocation<?>> result = new ArrayList<ResourceAllocation<?>>();
            for (ResourceAllocation<?> each : allocationsReturnedByQuery) {
                Task task = each.getTask();
                if (!isIncluded(orderElementsIds, task)) {
                    result.add(each);
                }
            }
            return result;
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.Task$DurationBetweenDates

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.