Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Commit

Permalink
modularize commit for #777
Browse files Browse the repository at this point in the history
  • Loading branch information
anshooarora committed Feb 16, 2017
1 parent 7d4f252 commit 81ae994
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -22,11 +22,14 @@ public void setTest(Test test) {
if (testList == null)
testList = new ArrayList<>();

updateTestStatusCounts(test);
testList.add(test);
}

private void updateTestStatusCounts(Test test) {
passed += test.getStatus() == Status.PASS ? 1 : 0;
failed += test.getStatus() == Status.FAIL || test.getStatus() == Status.FATAL ? 1 : 0;
others += test.getStatus() != Status.PASS && test.getStatus() != Status.FAIL ? 1 : 0;

testList.add(test);
}

public void refreshTestStatusCounts() {
Expand All @@ -35,9 +38,7 @@ public void refreshTestStatusCounts() {
others = 0;

testList.forEach(x -> {
passed += x.getStatus() == Status.PASS ? 1 : 0;
failed += x.getStatus() == Status.FAIL || x.getStatus() == Status.FATAL ? 1 : 0;
others += x.getStatus() != Status.PASS && x.getStatus() != Status.FAIL ? 1 : 0;
updateTestStatusCounts(x);
});
}

Expand Down

0 comments on commit 81ae994

Please sign in to comment.