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

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


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

        // recherche de la story
        Story story =  null;
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // Appel au service
        Errors errorsFromService = storyService.deleteTask(1, 2, 2);
       
View Full Code Here


      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

      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

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

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

        mockStoryRepository.expectFindByPersistanceId(persistanceId, story);

        Story storyFromService = storyService.findByPersistanceId(persistanceId);

        MockCore.verify();

        assertEquals(story, storyFromService);

View Full Code Here

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

        int persistanceId = 1;
        Story story = null;

        mockStoryRepository.expectFindByPersistanceId(persistanceId, story);

        Story storyFromService = storyService.findByPersistanceId(persistanceId);

        MockCore.verify();

        assertNull(storyFromService);

View Full Code Here

     */
    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

     *
     */
    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

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

        // recherche de la story
        Story story =  null;
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // Appel au service
        Errors errorsFromService = storyService.addCharge(1, 1, 1, Calendar.getInstance().getTime(), 1, 3);
       
View Full Code Here

     *
     */
    public void testUpdateCharge() {

        // 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);
        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
        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.updateCharge(day, 1, 3,1, 1, 1, 2);
       

        // 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

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

        // recherche de la story
        Story story =  null;
        mockStoryRepository.expectFindByPersistanceId(1, story);
       
        // Appel au service
        Errors errorsFromService = storyService.updateCharge(Calendar.getInstance().getTime(), 1, 3,1, 1, 1, 2);
       
View Full Code Here

TOP

Related Classes of net.sf.pmr.agilePlanning.domain.story.Story

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.