Пример #1
0
 @Test
 public void testGetTasksWithRankBetween_storyEmptyCollection() {
   story.setId(1);
   executeClassSql();
   Collection<Task> actual = taskDAO.getTasksWithRankBetween(2, 1, null, story);
   assertEquals(0, actual.size());
 }
Пример #2
0
 @Test
 public void testGetTasksWithRankBetween_iterationEmptyCollection() {
   iter.setId(1);
   executeClassSql();
   Collection<Task> actual = taskDAO.getTasksWithRankBetween(2, 0, iter, null);
   assertEquals(0, actual.size());
 }
Пример #3
0
 @Test
 public void testGetTasksWithRankBetween_storyBottom() {
   story.setId(3);
   executeClassSql();
   Collection<Task> actual = taskDAO.getTasksWithRankBetween(1, 5, null, story);
   assertEquals(1, actual.size());
 }
Пример #4
0
 @Test
 public void testSearchByName() {
   String search = "full";
   executeClassSql();
   List<User> users = userDAO.searchByName(search);
   assertEquals(1, users.size());
 }
Пример #5
0
 @Test
 public void testSearchByName_notFound() {
   String search = "not found string";
   executeClassSql();
   List<User> users = userDAO.searchByName(search);
   assertEquals(0, users.size());
 }
Пример #6
0
 @Test
 public void testGetNextTaskInRank_iteration() {
   iter.setId(1);
   executeClassSql();
   Task actual = taskDAO.getNextTaskInRank(0, iter, null);
   assertEquals(1, actual.getRank());
 }
Пример #7
0
 @Test
 public void testGetNextTaskInRank_iteration_largeCap() {
   iter.setId(3);
   executeClassSql();
   Task actual = taskDAO.getNextTaskInRank(25, iter, null);
   assertEquals(17, actual.getId());
   assertEquals(1500, actual.getRank());
 }
Пример #8
0
 @Test
 public void testGetLastTaskInRank_iteration() {
   iter.setId(3);
   executeClassSql();
   Task actual = taskDAO.getLastTaskInRank(null, iter);
   assertEquals(17, actual.getId());
   assertEquals(1500, actual.getRank());
 }
Пример #9
0
 @Test
 public void testGetLastTaskInRank_story() {
   story.setId(55);
   executeClassSql();
   Task actual = taskDAO.getLastTaskInRank(story, null);
   assertEquals(22, actual.getId());
   assertEquals(666, actual.getRank());
 }
Пример #10
0
 @Test
 public void testGetNextTaskInRank_story() {
   story.setId(55);
   executeClassSql();
   Task actual = taskDAO.getNextTaskInRank(0, null, story);
   assertEquals(1, actual.getRank());
   assertEquals(21, actual.getId());
 }
Пример #11
0
  @Test
  public void testGetNextTaskInRank_story_largeCap() {
    story.setId(55);
    executeClassSql();
    Task actual = taskDAO.getNextTaskInRank(25, null, story);

    assertEquals(22, actual.getId());
    assertEquals(666, actual.getRank());
  }
Пример #12
0
 @Test
 public void testGetStoryTasksWithEffortLeft_notInTimeframe() {
   executeClassSql();
   DateTime start = new DateTime(2008, 6, 10, 1, 0, 0, 0);
   User user = new User();
   user.setId(1);
   Interval interval = new Interval(start, start.plusDays(5));
   List<Task> actual = this.taskDAO.getStoryTasksWithEffortLeft(user, interval);
   assertEquals(0, actual.size());
 }
Пример #13
0
 @Test
 public void testGetUnassignedStoryTasksWithEffortLeftWithNullEffortSpent() {
   executeClassSql();
   DateTime start = new DateTime(2009, 6, 10, 1, 0, 0, 0);
   User user = new User();
   user.setId(3);
   Interval interval = new Interval(start, start.plusDays(5));
   List<UnassignedLoadTO> actual =
       this.taskDAO.getUnassignedStoryTasksWithEffortLeft(user, interval);
   assertTrue(actual.isEmpty());
 }
Пример #14
0
 @Test
 public void testListUsersByEnabledStatus_disabled() {
   executeClassSql();
   List<User> users = userDAO.listUsersByEnabledStatus(false);
   assertEquals(1, users.size());
   List<Integer> foundIds = new ArrayList<Integer>();
   for (User user : users) {
     foundIds.add(user.getId());
   }
   assertTrue(foundIds.contains(3));
 }
Пример #15
0
 @Test
 public void testGetNumOfResponsiblesByTask() {
   executeClassSql();
   Set<Integer> taskIds = new HashSet<Integer>(Arrays.asList(1, 2, 3, 4, 5));
   Map<Integer, Integer> actual = this.taskDAO.getNumOfResponsiblesByTask(taskIds);
   assertEquals(1, (int) actual.get(1));
   assertEquals(2, (int) actual.get(2));
   assertEquals(1, (int) actual.get(3));
   assertEquals(2, (int) actual.get(4));
   assertEquals(1, (int) actual.get(5));
 }
Пример #16
0
  @Test
  public void testGetAllIterationAndStoryTasks_user_hasNoAssigned() {
    executeClassSql();
    DateTime start = new DateTime(2009, 6, 10, 1, 0, 0, 0);
    Interval interval = new Interval(start, start.plusDays(5));
    User user = new User();
    user.setId(4);

    List<Task> actual = this.taskDAO.getAllIterationAndStoryTasks(user, interval);
    assertEquals(0, actual.size());
  }
Пример #17
0
 @Test
 public void testGetUnassignedIterationTasksWithEffortLeft() {
   executeClassSql();
   DateTime start = new DateTime(2009, 6, 10, 1, 0, 0, 0);
   User user = new User();
   user.setId(1);
   Interval interval = new Interval(start, start.plusDays(5));
   List<UnassignedLoadTO> actual =
       this.taskDAO.getUnassignedIterationTasksWithEffortLeft(user, interval);
   assertEquals(2, actual.size());
   assertEquals(970, actual.get(0).effortLeft.intValue());
   assertEquals(100, actual.get(0).availability);
   assertEquals(1, actual.get(0).iterationId);
 }
Пример #18
0
  @Test
  public void testGetAllIterationAndStoryTasks() {
    executeClassSql();
    DateTime start = new DateTime(2009, 6, 10, 1, 0, 0, 0);
    Interval interval = new Interval(start, start.plusDays(5));
    User user = new User();
    user.setId(1);
    List<Task> actual = this.taskDAO.getAllIterationAndStoryTasks(user, interval);

    HashSet<Integer> actualIds = new HashSet<Integer>();
    for (Task t : actual) {
      actualIds.add(t.getId());
    }

    HashSet<Integer> expectedIds = new HashSet<Integer>(Arrays.asList(2, 3, 4));
    assertEquals(expectedIds, actualIds);
  }
Пример #19
0
 @Test
 public void testGetByLoginName() {
   executeClassSql();
   assertEquals(4, userDAO.getByLoginName("user4").getId());
 }
Пример #20
0
 @Test
 public void testGetByLoginNameIgnoreCase_caseInsensitive() {
   executeClassSql();
   assertEquals(4, userDAO.getByLoginNameIgnoreCase("User4").getId());
 }
Пример #21
0
 @Test
 public void testGetByLoginNameIgnoreCase_notFound() {
   executeClassSql();
   assertNull(userDAO.getByLoginNameIgnoreCase("usernotfound"));
 }
Пример #22
0
 @Test
 public void testGetNextTaskInRank_story_notFound() {
   story.setId(55);
   executeClassSql();
   assertNull(taskDAO.getNextTaskInRank(999, null, story));
 }
Пример #23
0
 @Test
 public void testGetByLoginName_ignoreCase() {
   executeClassSql();
   assertNull(userDAO.getByLoginName("User4"));
 }
Пример #24
0
 @Test
 public void testGetNextTaskInRank_iteration_notFound() {
   iter.setId(1);
   executeClassSql();
   assertNull(taskDAO.getNextTaskInRank(999, iter, null));
 }