Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.Task


public class TestSupertaskAdjustment extends TaskTestCase {
    public void testSupetaskDurationGrowsWhenNestedTasksGrow()
            throws TaskDependencyException {
        TaskManager taskManager = getTaskManager();
        Task supertask = taskManager.createTask();
        Task task1 = taskManager.createTask();
        Task task2 = taskManager.createTask();
        //
        task1.move(supertask);
        task2.move(supertask);
        //
        task1.setStart(new GanttCalendar(2000, 01, 01));
        task1.setEnd(new GanttCalendar(2000, 01, 03));
        task2.setStart(new GanttCalendar(2000, 01, 03));
        task2.setEnd(new GanttCalendar(2000, 01, 04));
        supertask.setStart(new GanttCalendar(2000, 01, 01));
        supertask.setEnd(new GanttCalendar(2000, 01, 04));
        //
        TaskDependency dep = taskManager
                .getDependencyCollection()
View Full Code Here


                new GanttCalendar(2000, 01, 05), supertask.getEnd());
    }

    public void testSupertaskDurationShrinksWhenNestedTasksShrink() {
        TaskManager taskManager = getTaskManager();
        Task supertask = taskManager.createTask();
        Task task1 = taskManager.createTask();
        Task task2 = taskManager.createTask();
        //
        task1.move(supertask);
        task2.move(supertask);
        //
        task1.setStart(new GanttCalendar(2000, 01, 01));
        task1.setEnd(new GanttCalendar(2000, 01, 03));
        task2.setStart(new GanttCalendar(2000, 01, 03));
        task2.setEnd(new GanttCalendar(2000, 01, 04));
        supertask.setStart(new GanttCalendar(2000, 01, 01));
        supertask.setEnd(new GanttCalendar(2000, 01, 04));
        //
        task1.setStart(new GanttCalendar(2000, 01, 02));
        task2.setStart(new GanttCalendar(2000, 01, 02));
        task2.setEnd(new GanttCalendar(2000, 01, 03));
        //
        AdjustTaskBoundsAlgorithm alg = taskManager.getAlgorithmCollection()
                .getAdjustTaskBoundsAlgorithm();
        alg.run(new Task[] { task1, task2 });
        //
View Full Code Here

                new GanttCalendar(2000, 01, 03), supertask.getEnd());
    }
   
    public void testTaskDurationChangeIsPropagatedTwoLevelsUp() {
      TaskManager taskManager = getTaskManager();
      Task supertask = taskManager.createTask();
      supertask.move(taskManager.getRootTask());
      //
      Task level1task1 = taskManager.createTask();
      level1task1.move(supertask);
      Task level1task2 = taskManager.createTask();
      level1task2.move(supertask);
      //
      Task level2task1 = taskManager.createTask();
      level2task1.move(level1task2);
      //
      supertask.setStart(newMonday());
      supertask.setEnd(newTuesday());
      level1task1.setStart(newMonday());
      level1task1.setEnd(newTuesday());
      level1task2.setStart(newMonday());
      level1task2.setEnd(newTuesday());
      level2task1.setStart(newMonday());
      level2task1.setEnd(newTuesday());
      //
      level2task1.setEnd(newWendesday());
      //
        AdjustTaskBoundsAlgorithm alg = taskManager.getAlgorithmCollection().getAdjustTaskBoundsAlgorithm();
        alg.run(new Task[] { level2task1 });
      //
        assertEquals("Unexpected end of the topleveltask="+supertask, newWendesday(), supertask.getEnd());
View Full Code Here

    public GPCalendar getCalendar() {
        return myJanuaryFirstIsHolidayCalendar;
    }

    public void testFinishStartBindings() throws Exception {
        Task dependant = getTaskManager().createTask();
        Task dependee = getTaskManager().createTask();
        dependant.setStart(new GanttCalendar(1999, Calendar.DECEMBER, 30));
        dependant.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 3));
        dependee.setStart(new GanttCalendar(1999, Calendar.NOVEMBER, 15));
        dependee.setEnd(new GanttCalendar(1999, Calendar.NOVEMBER, 16));
        //
        TaskDependency dep = getTaskManager().getDependencyCollection()
                .createDependency(dependant, dependee,
                        new FinishStartConstraintImpl());
        TaskDependency.ActivityBinding binding = dep.getActivityBinding();
        assertEquals(binding.getDependantActivity(),
                dependant.getActivities()[0]);
        assertEquals(binding.getDependeeActivity(), dependee.getActivities()[0]);
        //
        dependant.setStart(new GanttCalendar(2000, Calendar.JANUARY, 4));
        dependant.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 5));
        dependee.setStart(new GanttCalendar(1999, Calendar.DECEMBER, 30));
        dependee.setEnd(new GanttCalendar(2000, Calendar.JANUARY, 3));
        binding = dep.getActivityBinding();
        assertEquals(binding.getDependantActivity(),
                dependant.getActivities()[0]);
        assertEquals(binding.getDependeeActivity(), dependee.getActivities()[1]);
    }
View Full Code Here

public class TestTaskDependencyCommon extends TaskTestCase {

    public void testNewDependencyAppearsInCollections()
            throws TaskDependencyException {
        TaskManager taskMgr = getTaskManager();
        Task task1 = taskMgr.createTask(1);
        Task task2 = taskMgr.createTask(2);
        TaskDependency dep = taskMgr
                .getDependencyCollection()
                .createDependency(task1, task2, new FinishStartConstraintImpl());
        //
        assertDependenciesCollectionContainsDependency(task1, dep);
View Full Code Here

    }

    public void testDeletedDependencyDisappearsFromCollections()
            throws TaskDependencyException {
        TaskManager taskMgr = getTaskManager();
        Task task1 = taskMgr.createTask(1);
        Task task2 = taskMgr.createTask(2);
        TaskDependency dep = taskMgr
                .getDependencyCollection()
                .createDependency(task1, task2, new FinishStartConstraintImpl());
        //
        dep.delete();
View Full Code Here

    }

    public void testOneDependencyDeletionDoesntAffectOthers()
            throws TaskDependencyException {
        TaskManager taskMgr = getTaskManager();
        Task task1 = taskMgr.createTask(1);
        Task task2 = taskMgr.createTask(2);
        Task task3 = taskMgr.createTask(3);
        //
        TaskDependency dep1 = taskMgr
                .getDependencyCollection()
                .createDependency(task1, task2, new FinishStartConstraintImpl());
        TaskDependency dep2 = taskMgr
View Full Code Here

    }

    public void testDependenciesAsDependantDoesntContainDependenciesAsDependee()
            throws TaskDependencyException {
        TaskManager taskMgr = getTaskManager();
        Task task1 = taskMgr.createTask(1);
        Task task2 = taskMgr.createTask(2);
        Task task3 = taskMgr.createTask(3);
        //
        TaskDependency dep1 = taskMgr
                .getDependencyCollection()
                .createDependency(task1, task2, new FinishStartConstraintImpl());
        TaskDependency dep2 = taskMgr
View Full Code Here

    }

    public void testImpossibleToAddDependencyTwice()
            throws TaskDependencyException {
        TaskManager taskMgr = getTaskManager();
        Task task1 = taskMgr.createTask(1);
        Task task2 = taskMgr.createTask(2);
        TaskDependency dep1 = taskMgr
                .getDependencyCollection()
                .createDependency(task1, task2, new FinishStartConstraintImpl());
        TaskDependency dep2 = null;
        try {
View Full Code Here

                "finishstart"));
    }

    public TaskDependencyConstraint.Collision getCollision() {
        TaskDependencyConstraint.Collision result = null;
        Task dependee = getDependency().getDependee();
        Task dependant = getDependency().getDependant();
        GanttCalendar dependeeEnd = dependee.getEnd().Clone();
        // GanttCalendar dependeeEnd = dependee.getEnd();
        GanttCalendar dependantStart = dependant.getStart();

        int difference = getDependency().getDifference();
        GanttCalendar comparisonDate = dependantStart.Clone();
        comparisonDate.add(difference);
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.Task

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.