Package net.sf.pmr.agilePlanning.domain.story.task

Examples of net.sf.pmr.agilePlanning.domain.story.task.TaskImpl


        calendar.set(Calendar.YEAR, 2001);
        calendar.set(Calendar.MONTH, 3);
        calendar.set(Calendar.DAY_OF_MONTH, 27);
       
        // tasks to update
        task1ToUpdate = new TaskImpl();
        task1ToUpdate.setOwner(null);
        task1ToUpdate.setDaysEstimated(60);
        task1ToUpdate.setPersistanceId(1);
        task1ToUpdate.setPersistanceVersion(2);
        task1ToUpdate.setShortDescription("première tâche");
       
        task2ToUpdate = new TaskImpl();
        task2ToUpdate.setOwner(null);
        task2ToUpdate.setDaysEstimated(40);
        task2ToUpdate.setPersistanceId(2);
        task2ToUpdate.setPersistanceVersion(3);
        task2ToUpdate.setShortDescription("seconde tâche");

        // Set of task
        Set<Task> tasksToUpdate = new HashSet<Task>();
        tasksToUpdate.add(task1ToUpdate);
        tasksToUpdate.add(task2ToUpdate);
       
        // charge to update
        charge1ToUpdate = new ChargeImpl();

        calendar = Calendar.getInstance();
       
        calendar.set(Calendar.YEAR, 2005);
        calendar.set(Calendar.MONTH, 11);
        calendar.set(Calendar.DAY_OF_MONTH, 03);
       
        userForChargeToUpdate = new UserImpl();
        userForChargeToUpdate.setPersistanceId(2);
        userForChargeToUpdate.setPersistanceVersion(1);

        charge1ToUpdate.setPersistanceId(1);
        charge1ToUpdate.setDay(calendar.getTime());
        charge1ToUpdate.setTimeUsedToday(2);
        charge1ToUpdate.setDaysNeededToFinish(4);
        charge1ToUpdate.setUser(userForChargeToUpdate);
        charge1ToUpdate.setPersistanceVersion(2);
       
        charge2ToUpdate = new ChargeImpl();
       
        calendar = Calendar.getInstance();
       
        calendar.set(Calendar.YEAR, 2005);
        calendar.set(Calendar.MONTH, 11);
        calendar.set(Calendar.DAY_OF_MONTH, 04);
       
        charge2ToUpdate.setPersistanceId(2);
        charge2ToUpdate.setDay(calendar.getTime());
        charge2ToUpdate.setTimeUsedToday(1);
        charge2ToUpdate.setDaysNeededToFinish(2);
        charge2ToUpdate.setUser(userForChargeToUpdate);
        charge2ToUpdate.setPersistanceVersion(2);
       
        Set<Charge> chargesToUpdate = new HashSet<Charge>();
        chargesToUpdate.add(charge1ToUpdate);
        chargesToUpdate.add(charge2ToUpdate);
       
        // add the charges to task1
        task1ToUpdate.setCharges(chargesToUpdate);
       
        // Story to Update
        storyToUpdate = new StoryImpl();
        storyToUpdate.setProject(project);
        storyToUpdate.setDescription("faire un report d'avancement des tâches");
        storyToUpdate.setDaysEstimated(4);
        storyToUpdate.setPersistanceId(1);
        storyToUpdate.setPersistanceVersion(2);
        storyToUpdate.setShortDescription("avancement des tâches");
        storyToUpdate.setTasks(tasksToUpdate);
        storyToUpdate.setBusinessValue(businessValue);
        storyToUpdate.setRiskLevel(riskLevel);

        // tasks to add
        task1ToAdd = new TaskImpl();
        task1ToAdd.setOwner(null);
        task1ToAdd.setDaysEstimated(8);
        task1ToAdd.setPersistanceId(0);
        task1ToAdd.setPersistanceVersion(0);
        task1ToAdd.setShortDescription("première tâche ajoutée");
       
        task2ToAdd = new TaskImpl();
        task2ToAdd.setOwner(null);
        task2ToAdd.setDaysEstimated(9);
        task2ToAdd.setPersistanceId(0);
        task2ToAdd.setPersistanceVersion(0);
        task2ToAdd.setShortDescription("seconde tâche ajoutée");
View Full Code Here


    public void testUpdateTask() {

        // recherche de la story
        Story story = new StoryImpl();
        story.setTasks(new HashSet<Task>());
        Task task = new TaskImpl();
        task.setDaysEstimated(2);
        task.setShortDescription("scooby");
        task.setPersistanceId(1);
        task.setPersistanceVersion(3);
        story.getTasks().add(task);
       
        mockStoryRepository.expectFindByPersistanceId(1, story);
     
        // validation (sans erreurs)
View Full Code Here

        Story story = new StoryImpl();
        story.setPersistanceId(storyPersistanceId);
        story.setPersistanceVersion(2);
        story.setTasks(new HashSet<Task>());
       
        Task task = new TaskImpl();
        task.setDaysEstimated(2);
        task.setShortDescription("scooby");
        task.setPersistanceId(persistanceId);
        task.setPersistanceVersion(3);
        story.getTasks().add(task);
       
        Task task2 = new TaskImpl();
        task2.setDaysEstimated(3);
        task2.setShortDescription("doo");
        task2.setPersistanceId(2);
        task2.setPersistanceVersion(4);
        story.getTasks().add(task2);
       
        mockStoryRepository.expectFindByPersistanceId(storyPersistanceId, story);
     
        // validation (sans erreurs)
View Full Code Here

        Story story = new StoryImpl();
        story.setPersistanceId(storyPersistanceId);
        story.setPersistanceVersion(2);
        story.setTasks(new HashSet<Task>());
               
        Task task = new TaskImpl();
        task.setDaysEstimated(3);
        task.setShortDescription("doo");
        task.setPersistanceId(2);
        task.setPersistanceVersion(3);
        story.getTasks().add(task);

        mockStoryRepository.expectFindByPersistanceId(storyPersistanceId, story);
       
        // Appel au service
View Full Code Here

        Story story = new StoryImpl();
        story.setPersistanceId(storyPersistanceId);
        story.setPersistanceVersion(2);
        story.setTasks(new HashSet<Task>());
       
        Task task = new TaskImpl();
        task.setDaysEstimated(2);
        task.setShortDescription("scooby");
        task.setPersistanceId(persistanceId);
        task.setPersistanceVersion(3);
        story.getTasks().add(task);
       
        Task task2 = new TaskImpl();
        task2.setDaysEstimated(3);
        task2.setShortDescription("doo");
        task2.setPersistanceId(2);
        task2.setPersistanceVersion(4);
        story.getTasks().add(task2);

        MockCore.startBlock();
       
        // recherche de la story dans la repository
View Full Code Here

     * </ul>
     */
    public void testFindTaskByPersistanceIdWhenTaskIsFound() {

        int persistanceId = 1;
        Task task = new TaskImpl();

        mockStoryRepository.expectFindTaskByPersistanceId(persistanceId, task);

        Task taskFromService = storyService.findTaskByPersistanceId(persistanceId);

View Full Code Here

        Story story =  new StoryImpl();
        story.setPersistanceId(1);
        story.setTasks(new HashSet<Task>());
       
        // Ajout d'une tâche
        Task task = new TaskImpl();
        task.setPersistanceId(1);
        story.getTasks().add(task);

        User user = new UserImpl();
        user.setPersistanceId(1);
       
View Full Code Here

        Story story =  new StoryImpl();
        story.setPersistanceId(1);
        story.setTasks(new HashSet<Task>());
       
        // Ajout d'une tâche
        Task task = new TaskImpl();
        task.setPersistanceId(1);
        task.setCharges(new HashSet<Charge>());
        story.getTasks().add(task);
       
        // Charge
        Charge charge = new ChargeImpl();
        Date chargeDate = new Date();
        charge.setDay(chargeDate);
        charge.setDaysNeededToFinish(2);
        charge.setPersistanceId(1);
        charge.setPersistanceVersion(5);
        charge.setTimeUsedToday(0.5);
        User chargeUser = new UserImpl();
        charge.setUser(chargeUser);
       
        task.getCharges().add(charge);
       
        // appel de la recherche de la story
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // appel de la mise � jour de la story
View Full Code Here

     * Test la méthode isDeletable quand la story a des tasks.
     * Dans ce cas la story ne peut être supprimée
     */
    public void testIsDeletableWhenStoryTaskIsNotEmpty() {
     
      Task task = new TaskImpl();
      Set<Task> taskSet = new HashSet<Task>();
      taskSet.add(task);
     
      story.setTasks(taskSet);
     
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
       
        validator = AgilePlanningObjectFactory.getTaskValidator();
       
        task = new TaskImpl();
    }
View Full Code Here

TOP

Related Classes of net.sf.pmr.agilePlanning.domain.story.task.TaskImpl

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.