Examples of StoryImpl


Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     * <li>retours d'une structure d'erreur vide contenant un message indiquant que l'iteration n'a pas été trouvée</li>
     * </ul>
     */
    public void testUpdateWhenStoryIsNotFound() {

        Story storyToUpdate = new StoryImpl();
        String shortDescription = "scooby";
        String description = "doo";
        double daysestimated = 2;
        int persistanceId = 1;
        int persistanceVersion = 5;
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     * <li>Validation</li>
     * </ul>
     */
    public void testUpdateWhenValidationFails() {

        Story storyToUpdate = new StoryImpl();
        String shortDescription = "scooby";
        String description = "doo";
        int estimate = 2;
        int persistanceId = 1;
        int persistanceVersion = 5;
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     * </ul>
     */
    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)
        mockTaskValidator.expectValidate(new Ignore(), AgilePlanningObjectFactory.getErrors());
       
        // modification
        mockStoryRepository.acceptAddOrUpdate_Story(story);
       
        Errors errorsFromService = storyService.updateTask(1,5,"doo", 4, 1, 7);
       
        // V�rifie les appels
        MockCore.verify();
       
        // aucune erreur n'est retourn�e
        assertFalse(errorsFromService.hasErrors());
       
        // test de l'ajout de la t�che dans le liste de la story
        for (Iterator iterator = story.getTasks().iterator(); iterator.hasNext();) {
            Task taskUpdated = (Task) iterator.next();
           
            assertEquals("doo", taskUpdated.getShortDescription());
            assertEquals(5.0, taskUpdated.getDaysEstimated());
            assertEquals(1, taskUpdated.getPersistanceId());
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     */
    public void testUpdateTaskWhenValidationFails() {

        // validation (avec erreurs)
     
        Story storyToUpdate = new StoryImpl();
        int persistanceId = 1;

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

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

      int storyPersistanceId = 1;
      int persistanceId = 1;
      long persistanceVersion = 2;
     
        // recherche de la story
        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)
        mockTaskValidator.expectValidateForDelete(task, AgilePlanningObjectFactory.getErrors());
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

      int storyPersistanceId = 1;
      int persistanceId = 1;
      long persistanceVersion = 2;
     
        // recherche de la story
        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
        Errors errorsFromService = storyService.deleteTask(storyPersistanceId, persistanceId, persistanceVersion);
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

      int storyPersistanceId = 1;
      int persistanceId = 1;
      long persistanceVersion = 2;
     
        // recherche de la story
        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
        mockStoryRepository.expectFindByPersistanceId(storyPersistanceId, story);       
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

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

        int persistanceId = 1;
        Story story = new StoryImpl();

        mockStoryRepository.expectFindByPersistanceId(persistanceId, story);

        Story storyFromService = storyService.findByPersistanceId(persistanceId);

View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     */
    public void testFindByProjectPersistanceIdWhenStoriesAreFound() {

        int projetPersistanceId = 1;
        Set set = new HashSet();
        Story story = new StoryImpl();
        set.add(story);

        mockStoryRepository.expectFindByProjectPersistanceId(projetPersistanceId, set);

        Set setFromService = storyService.findByProjectPersistanceId(projetPersistanceId);
View Full Code Here

Examples of net.sf.pmr.agilePlanning.domain.story.StoryImpl

     *
     */
    public void testAddCharge() {

        // recherche de la story
        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);
       
        // appel de la recherche de la story
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // appel de la recherche du user
        mockUserRepository.expectFindUserById(1, user);
       
        // appel de la mise à jour de la story
        mockStoryRepository.expectAddOrUpdate(story);

        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, 2005);
        calendar.set(Calendar.MONTH, 12);
        calendar.set(Calendar.DAY_OF_MONTH, 2);
        calendar.set(Calendar.HOUR, 2);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        Date day = calendar.getTime();
       
        // appel du service
        storyService.addCharge(1, 1, 1, day, 1, 3);

        // Vérifie les appels
        MockCore.verify();
       
        // test de l'ajout de la charge dans la liste
       
        boolean chargeFound = false;
       
        for (Task taskToFind : story.getTasks()) {
     
          if (taskToFind.getPersistanceId() == 1)  {
           
           
            for (Charge chargeTofind : taskToFind.getCharges()) {
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.