Examples of Sprint


Examples of br.com.mystudies.domain.entity.Sprint

  @Override
  public Sprint addStoryInSprint(Story story) {

    // FIXME: validation of parameters story...

    Sprint sprint = getCurrentSprint();

    if(sprint == null)
      throw new IllegalStateException("Haven't sprint in running");

    sprint.getStories().add(story);
    sprint.setEstimatedPoints(sprint.getEstimatedPoints() + story.getPoints());

    story.setSprint(sprint);
    story.setStatus(StoryStatus.TODO);

View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

      HttpServletResponse response) throws ServletException {

    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

    try {
      return new Sprint(
          sdf.parse(request.getParameter("startDate")),
          sdf.parse(request.getParameter("finalDate")),
          SprintStatus.RUNNING
        );
    } catch (ParseException e) {
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

  public void shouldntDoNothingWhenFinalDateNotExpired() {

    Calendar calendar = Calendar.getInstance();
    calendar.roll(Calendar.DAY_OF_MONTH, 1); // rest one day for finish the sprint

    Sprint sprint = new Sprint();
    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);

    scheduleSprint.execute();

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);

    assertEquals(SprintStatus.RUNNING, sprint.getSprintStatus());
  }
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

     */

    Calendar calendar = Calendar.getInstance();
    calendar.roll(Calendar.DAY_OF_MONTH, -1); // sprint finished

    Sprint sprint = new Sprint();
    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);


    sprint.setStories(new HashSet<Story>());
    sprint.getStories().add(new Story("STORY 1", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 2", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DOING, null, 10)); // <<---
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null, 10));
    sprint.getStories().add(new Story("STORY 4", null, StoryStatus.DOING, null, 10));// <<---


    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);

    scheduleSprint.execute();

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);
    verify(sprintDao).update(sprint);

    assertEquals(SprintStatus.FAIL, sprint.getSprintStatus());
    assertEquals(new Long(30), sprint.getDonePoints());

    for (Story story : sprint.getStories()) {
      if (story.getStatus() != StoryStatus.DONE) {
        assertEquals(StoryStatus.BACKLOG, story.getStatus());
      }
    }
  }
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

        // salvar novo estado da historia.




      Sprint sprint =
          sprintService.getCurrentSprint();



      Set<Story> stories =
          sprint.getStories();


      Map<Theme, List<Story>> map = new HashMap<>();

View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint


  @Test
  public void shouldReturnTrueWhileContainsSprintInRun() {

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(new Sprint());

    boolean containsSprintInRun = sprintServiceBean.containsSprintInRun();

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint


  @Test(expected=IllegalStateException.class)
  public void shouldThrowExceptionWhenContainsSprintInRunning() {

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(new Sprint());

    sprintServiceBean.create(new Sprint());

  }
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

  }

  @Test()
  public void shouldCreateSprintWhenHaventSprintInRunning() {

    Sprint sprint = new Sprint(
        new Date(),
        new Date(),
        SprintStatus.RUNNING
        );

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(null);
    when(sprintDao.persist(any(Sprint.class) )).thenReturn(sprint);


    sprint = sprintServiceBean.create(sprint);

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);
    verify(sprintDao).persist(sprint);

    assertNotNull(sprint);
    assertEquals(SprintStatus.RUNNING, sprint.getSprintStatus());
    assertEquals(new Long(0), sprint.getEstimatedPoints());


  }
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

     */

    Calendar calendar = Calendar.getInstance();
    calendar.roll(Calendar.DAY_OF_MONTH, -1); // sprint finished

    Sprint sprint = new Sprint();
    sprint.setFinalDate(calendar.getTime());
    sprint.setSprintStatus(SprintStatus.RUNNING);


    sprint.setStories(new HashSet<Story>());
    sprint.getStories().add(new Story("STORY 1", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 2", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.TODO, null,10)); // <<---
    sprint.getStories().add(new Story("STORY 3", null, StoryStatus.DONE, null,10));
    sprint.getStories().add(new Story("STORY 4", null, StoryStatus.TODO, null,10));// <<---


    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(sprint);
    when(sprintDao.update(sprint)).thenReturn(sprint);

    scheduleSprint.execute();

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);
    verify(sprintDao).update(sprint);

    assertEquals(SprintStatus.FAIL, sprint.getSprintStatus());
    assertEquals(new Long(30), sprint.getDonePoints());

    for (Story story : sprint.getStories()) {
      if (story.getStatus() != StoryStatus.DONE) {
        assertEquals(StoryStatus.BACKLOG, story.getStatus());
      }
    }
  }
View Full Code Here

Examples of br.com.mystudies.domain.entity.Sprint

  @Test()
  public void shouldReturnNullWhenHaventSprintInRunning() {

    when(sprintDao.findSprintByStatus(SprintStatus.RUNNING)).thenReturn(null);

    Sprint sprint = sprintServiceBean.getCurrentSprint();

    verify(sprintDao).findSprintByStatus(SprintStatus.RUNNING);

    assertNull(sprint);
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.