Permalink
Browse files

Merge commit '90b3e20'

  • Loading branch information...
2 parents 733409f + 90b3e20 commit 7fa41381ed6649b9b59b349a5b2dd054518eae60 @lekksi lekksi committed Jan 19, 2012
@@ -79,9 +79,6 @@ public IterationHistoryEntry retrieveLatest(int iterationId) {
private Pair<ExactEstimate, ExactEstimate> calculateCurrentHistoryData_tasksInsideStory(int iterationId) {
Criteria crit = getCurrentSession().createCriteria(Task.class);
- //TODO JB - change this to deferred
- crit.add(Restrictions.ne("state", TaskState.BLOCKED));
-
crit.setProjection(Projections.projectionList().add(
Projections.sum("effortLeft")).add(
Projections.sum("originalEstimate")));
@@ -225,7 +225,7 @@ public void testGetIterationMetrics() {
expect(backlogBusiness.calculateDoneStoryPointSum(iteration.getId())).andReturn(10);
expect(hourEntryBusiness.calculateSumOfIterationsHourEntries(iteration))
.andReturn(expectedSpentEffort);
- expect(iterationDAO.getCountOfDoneAndAllTasks(iteration)).andReturn(
+ expect(iterationDAO.getCountOfDoneAndNonDeferred(iteration)).andReturn(
Pair.create(2, 4));
expect(iterationDAO.getCountOfDoneAndAllStories(iteration)).andReturn(
Pair.create(1, 2));
@@ -263,7 +263,7 @@ public void testGetIterationMetrics() {
public void testGetIterationMetricsZeroTotals() {
expect(iterationHistoryEntryBusiness.retrieveLatest(iteration))
.andReturn(null).times(2);
- expect(iterationDAO.getCountOfDoneAndAllTasks(iteration)).andReturn(
+ expect(iterationDAO.getCountOfDoneAndNonDeferred(iteration)).andReturn(
Pair.create(0, 0));
expect(iterationDAO.getCountOfDoneAndAllStories(iteration)).andReturn(
Pair.create(0, 0));
@@ -292,7 +292,7 @@ public void testGetIterationMetricsZeroTotals() {
public void testGetIterationMetrics_nullLatestHistoryEntry() {
expect(iterationHistoryEntryBusiness.retrieveLatest(iteration))
.andReturn(null).times(2);
- expect(iterationDAO.getCountOfDoneAndAllTasks(iteration)).andReturn(
+ expect(iterationDAO.getCountOfDoneAndNonDeferred(iteration)).andReturn(
Pair.create(2, 4));
expect(iterationDAO.getCountOfDoneAndAllStories(iteration)).andReturn(
Pair.create(1, 3));
@@ -337,7 +337,7 @@ public void testGetIterationMetrics_withInterval() {
expect(backlogBusiness.calculateDoneStoryPointSum(iter.getId())).andReturn(5);
expect(hourEntryBusiness.calculateSumOfIterationsHourEntries(iter))
.andReturn((long) 10);
- expect(iterationDAO.getCountOfDoneAndAllTasks(iter)).andReturn(
+ expect(iterationDAO.getCountOfDoneAndNonDeferred(iter)).andReturn(
Pair.create(2, 4));
expect(iterationDAO.getCountOfDoneAndAllStories(iter)).andReturn(
Pair.create(1, 2));
@@ -44,6 +44,7 @@
StoryDAO storyDAO;
IterationDAO iterationDAO;
UserDAO userDAO;
+ IterationHistoryEntryBusiness iterationBusiness;
BacklogBusiness backlogBusiness;
BacklogHistoryEntryBusiness blheBusiness;
@@ -178,6 +179,9 @@ public void moveStoryToBacklog(Story story, Backlog backlog) {
userDAO = createMock(UserDAO.class);
storyBusiness.setUserDAO(userDAO);
+ iterationBusiness = createMock(IterationHistoryEntryBusiness.class);
+ storyBusiness.setIterationHistoryEntryBusiness(iterationBusiness);
+
blheBusiness = createMock(BacklogHistoryEntryBusiness.class);
storyBusiness.setBacklogHistoryEntryBusiness(blheBusiness);
}
@@ -249,6 +253,7 @@ public void testStore_tasksToDone() {
@Test
public void testStore_dontSetTasksToDone() {
+ this.store_createMockStoryBusiness();
Task task1 = new Task();
task1.setId(11);
task1.setState(TaskState.BLOCKED);
@@ -263,7 +268,6 @@ public void testStore_dontSetTasksToDone() {
expect(storyDAO.get(story1.getId())).andReturn(story1);
storyDAO.store(story1);
blheBusiness.updateHistory(story1.getBacklog().getId());
-
replayAll();
Story actual = storyBusiness.store(story1.getId(), story1, null, null, false);
verifyAll();
@@ -179,6 +179,11 @@ TaskModel.prototype._saveData = function(id, changedData) {
if ((data.storyToStarted || PageController.getInstance().getCurrentUser().getMarkStoryStarted() === "always")&& me.relations.story) {
me.relations.story.callListeners(new DynamicsEvents.EditEvent(me.relations.story));
}
+ // Reload the metrics.
+ if (me.getStory())
+ me.getStory().reloadMetrics();
+ if (PageController.getInstance().mainController instanceof IterationController)
+ PageController.getInstance().mainController.reloadMetricsBox();
},
error: function(xhr, status, error) {
MessageDisplay.Error("Error saving task", xhr);

0 comments on commit 7fa4138

Please sign in to comment.