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

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


    /**
     * @see net.sf.pmr.keopsframework.data.DomainObjectRootAggregateMapper#addOrUpdate(java.lang.Object)
     */
    public void addOrUpdate(final DomainObject story) {

        Story storyToAddorUpdate = (Story) story;

        getHibernateTemplate().saveOrUpdate(storyToAddorUpdate);

    }
View Full Code Here


     * Test la méthode isDeletable quand la release a des stories.
     * Dans ce cas la release ne peut être supprimée
     */
    public void testIsDeletableWhenStoryTaskIsNotEmpty() {
     
      Story story = new StoryImpl();
      Set<Story> storySet = new HashSet<Story>();
      storySet.add(story);
     
      release.setStories(storySet);
     
View Full Code Here

     
      // deux stories sont trouvées
      assertEquals(2, stories.size());
     
        // Story to Update
        Story story1 = new StoryImpl();
        story1.setProject(project);
        story1.setDescription("faire un report d'avancement des tâches à modifier");
        story1.setDaysEstimated(10);
        story1.setPersistanceId(1);
        story1.setPersistanceVersion(2);
        story1.setShortDescription("avancement des tâches à modifier");
        story1.setBusinessValue(businessValue);
        story1.setRiskLevel(riskLevel);

        Story story2 = new StoryImpl();
        story2.setProject(project);
        story2.setDescription("faire une revue de code de l'iteration courant");
        story2.setDaysEstimated(1);
        story2.setPersistanceId(2);
        story2.setPersistanceVersion(2);
        story2.setShortDescription("revue de code");
        story2.setBusinessValue(businessValue);
        story2.setRiskLevel(riskLevel);
     
      // ... et sont dans la liste
      assertTrue(stories.contains(story1));
        assertTrue(stories.contains(story2));
     
View Full Code Here

    /**
     * test quand la story n'est pas trouvée.
     */
    public void testFindByIdWhenStoryIsNotFound(){
       
        Story story = (Story) storyMapper.findById(888);

        assertNull(story);
       
    }
View Full Code Here

     */
    public Errors add(final int projectPersistanceId, final String shortDescription, final String description,
            final double daysEstimated, final int businessValueId, final int riskLevelId) {

        // buid the story
        Story story = this.buildStory(projectPersistanceId, shortDescription, description, daysEstimated,
                businessValueId, riskLevelId);

        // validate
        Errors errors = storyValidator.validate(story);

View Full Code Here

     */
    public Errors addTask(final int storyPersistanceId, final double numberOfIdealDays, final String shortDescription,
            final int developperPersistanceId) {
     
        // find the story
        Story story = storyRepository.findByPersistanceId(storyPersistanceId);
       
    // if the story is not found, return a global error
    if (story == null) {
      Errors errros = AgilePlanningObjectFactory.getErrors();
      errros.reject("story.doesntExistsInDatabase");
      return errros;
    }

        // else build the object to persist
        Task task = AgilePlanningObjectFactory.getTask();
        User user = CoreObjectFactory.getUser();
        user.setPersistanceId(developperPersistanceId);

        task.setOwner(user);
        task.setDaysEstimated(numberOfIdealDays);
        task.setShortDescription(shortDescription);

        // validate
        Errors errors = taskValidator.validate(task);

        // persist
        if (!errors.hasErrors()) {
                story.getTasks().add(task);
                storyRepository.addOrUpdate(story);

        }

        return errors;
View Full Code Here

    }

    public Errors addOrUpdateTask(final int storyPersistanceId, final Task task) {
       
         // find the story
        Story story = storyRepository.findByPersistanceId(storyPersistanceId);
       
    // if the story is not found, return a global error
    if (story == null) {
      Errors errros = AgilePlanningObjectFactory.getErrors();
      errros.reject("story.doesntExistsInDatabase");
      return errros;
    }

     
        // validate
        Errors errors = taskValidator.validate(task);

        // persist
        if (!errors.hasErrors()) {
                story.getTasks().add(task);
                storyRepository.addOrUpdate(story);

        }

        return errors;
View Full Code Here

     * @see net.sf.pmr.agilePlanning.service.StoryService#delete(int, long)
     */
     public Errors delete(final int persistanceId, final long persistanceVersion) {
    
         // find the story to delete in the repository
         Story story = storyRepository.findByPersistanceId(persistanceId);

     // if the story is not found, return a global error
     if (story == null) {
       Errors errors = AgilePlanningObjectFactory.getErrors();
       errors.reject("story.doesntExistsInDatabase");
       return errors;
     }
        
         // if the story is found, update the persistanceVersion for concurrency management
         story.setPersistanceVersion(persistanceVersion);
 
         // validate
         Errors errors = storyValidator.validateForDelete(story);

         // delete if validation is ok
View Full Code Here

     */
    public Errors update(final String shortDescription, final String description, final double daysEstimated,
            final int businessValueId, final int riskLevelId, final int persistanceId, final long persistanceVersion) {

        // find the story to update in the repository
        Story story = storyRepository.findByPersistanceId(persistanceId);

    // if the story is not found, return a global error
    if (story == null) {
      Errors errros = AgilePlanningObjectFactory.getErrors();
      errros.reject("story.doesntExistsInDatabase");
      return errros;
    }

       
        // update the story
        story.setShortDescription(shortDescription);
        story.setDescription(description);
        story.setDaysEstimated(daysEstimated);
        story.setPersistanceId(persistanceId);
        story.setPersistanceVersion(persistanceVersion);

        // find the riskLevel and business value
        BusinessValue businessValue = businessValueRepository.findById(businessValueId);
        story.setBusinessValue(businessValue);

        RiskLevel riskLevel = riskLevelRepository.findById(riskLevelId);
        story.setRiskLevel(riskLevel);

        // validate
        Errors errors = storyValidator.validate(story);

        // persist
View Full Code Here

      final double numberOfIdealDays, final String shortDescription,
      final int developperPersistanceId, final int persistanceId,
      final long persistanceVersion) {

    // find the story
    Story story = storyRepository.findByPersistanceId(storyPersistanceId);

    // if the story is not found, return a global error
    if (story == null) {
      Errors errros = AgilePlanningObjectFactory.getErrors();
      errros.reject("story.doesntExistsInDatabase");
      return errros;
    }

    // else, build the object to persist
    Task task = AgilePlanningObjectFactory.getTask();
    User user = CoreObjectFactory.getUser();
    user.setPersistanceId(developperPersistanceId);

    task.setOwner(user);
    task.setPersistanceId(persistanceId);
    task.setPersistanceVersion(persistanceVersion);
    task.setDaysEstimated(numberOfIdealDays);
    task.setShortDescription(shortDescription);

    // validate
    Errors errors = taskValidator.validate(task);

    if (!errors.hasErrors()) {

      // find the task to update
      for (Iterator iterator = story.getTasks().iterator(); iterator
          .hasNext();) {
        Task taskToUpdate = (Task) iterator.next();

        if (task.getPersistanceId() == taskToUpdate.getPersistanceId()) {
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.