Package org.libreplan.business.planner.entities

Examples of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor


        if ((task != null) && (planner != null)) {

            planner.expandAllAlways();

            Task foundTask = null;
            TaskElement foundTaskElement = null;
            IContext<TaskElement> context = (IContext<TaskElement>) planner
                    .getContext();
            Map<TaskElement, Task> map = context.getMapper()
                    .getMapDomainToTask();
View Full Code Here


    public void mustNotAllowANullValuesForAnyOfTheCreationArguments() {
        Object[] arguments = { origin, destination, type };
        for (int i = 0; i < arguments.length; i++) {
            Object[] cloned = arguments.clone();
            cloned[i] = null;
            TaskElement origin = (TaskElement) cloned[0];
            TaskElement destination = (TaskElement) cloned[1];
            Type type = (Type) cloned[2];
            try {
                Dependency.create(origin, destination, type);
                fail("must send IllegalArgumentException");
            } catch (IllegalArgumentException e) {
View Full Code Here

    @Transactional
    public void canSaveTask() {
        Task task = createValidTask();
        taskElementDAO.save(task);
        flushAndEvict(task);
        TaskElement fromDB;
        try {
            fromDB = taskElementDAO.find(task.getId());
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
        assertThat(fromDB.getId(), equalTo(task.getId()));
        assertThat(fromDB, instanceOf(Task.class));
        checkProperties(task, fromDB);
        HoursGroup reloaded = ((Task) fromDB).getHoursGroup();
        assertThat(reloaded.getId(), equalTo(reloaded.getId()));
    }
View Full Code Here

    @Transactional
    public void canSaveMilestone() {
        TaskMilestone milestone = createValidTaskMilestone();
        taskElementDAO.save(milestone);
        flushAndEvict(milestone);
        TaskElement fromDB;
        try {
            fromDB = taskElementDAO.find(milestone.getId());
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
        assertThat(fromDB.getId(), equalTo(milestone.getId()));
        assertThat(fromDB, instanceOf(TaskMilestone.class));
    }
View Full Code Here

    @Transactional
    public void canSaveTaskGroup() {
        TaskGroup taskGroup = createValidTaskGroup();
        taskElementDAO.save(taskGroup);
        flushAndEvict(taskGroup);
        TaskElement reloaded;
        try {
            reloaded = taskElementDAO.find(taskGroup.getId());
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
        assertThat(reloaded.getId(), equalTo(taskGroup.getId()));
        assertThat(reloaded, instanceOf(TaskGroup.class));
        checkProperties(taskGroup, reloaded);
    }
View Full Code Here

    public void theParentPropertyIsPresentWhenRetrievingTasks() {
        TaskGroup taskGroup = createValidTaskGroup();
        taskGroup.addTaskElement(createValidTask());
        taskElementDAO.save(taskGroup);
        flushAndEvict(taskGroup);
        TaskElement reloaded;
        try {
            reloaded = taskElementDAO.find(taskGroup.getId());
        } catch (InstanceNotFoundException e) {
            throw new RuntimeException(e);
        }
        TaskElement child = reloaded.getChildren().get(0);
        assertThat(child.getParent(), equalTo(reloaded));
    }
View Full Code Here

        assertTrue(child2.getDependenciesWithThisOrigin().isEmpty());
        IOnTransaction<Void> checkDependencyWasSaved = new IOnTransaction<Void>() {

            @Override
            public Void execute() {
                TaskElement fromDB = (TaskElement) taskElementDAO
                        .findExistingEntity(child1.getId());
                assertThat(fromDB.getDependenciesWithThisOrigin()
                        .size(), equalTo(1));
                assertTrue(fromDB.getDependenciesWithThisDestination()
                        .isEmpty());
                return null;
            }
        };
        transactionService.runOnTransaction(checkDependencyWasSaved);
View Full Code Here

TOP

Related Classes of org.libreplan.business.planner.entities.TaskElement$IDatesInterceptor

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.