You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2016/02/23 21:20:01 UTC

[6/8] storm git commit: STORM-1255: missed a couple of finally

STORM-1255: missed a couple of finally


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0ca49ab4
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0ca49ab4
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0ca49ab4

Branch: refs/heads/master
Commit: 0ca49ab4fdb73ad8b920bb9c8a942fefebd6543c
Parents: d912d50
Author: Alessandro Bellina <ab...@yahoo-inc.com>
Authored: Thu Feb 18 22:17:25 2016 -0600
Committer: Alessandro Bellina <ab...@yahoo-inc.com>
Committed: Thu Feb 18 22:17:25 2016 -0600

----------------------------------------------------------------------
 .../jvm/org/apache/storm/utils/TimeTest.java    | 22 +++++++++++++-------
 1 file changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0ca49ab4/storm-core/test/jvm/org/apache/storm/utils/TimeTest.java
----------------------------------------------------------------------
diff --git a/storm-core/test/jvm/org/apache/storm/utils/TimeTest.java b/storm-core/test/jvm/org/apache/storm/utils/TimeTest.java
index d27b4b8..f4b3977 100644
--- a/storm-core/test/jvm/org/apache/storm/utils/TimeTest.java
+++ b/storm-core/test/jvm/org/apache/storm/utils/TimeTest.java
@@ -88,19 +88,25 @@ public class TimeTest {
     @Test
     public void deltaSecsConvertsToSecondsTest() {
         Time.startSimulating();
-        int current = Time.currentTimeSecs();
-        Time.advanceTime(1000);
-        Assert.assertEquals(Time.deltaSecs(current), 1);
-        Time.stopSimulating();
+        try {
+            int current = Time.currentTimeSecs();
+            Time.advanceTime(1000);
+            Assert.assertEquals(Time.deltaSecs(current), 1);
+        } finally {
+            Time.stopSimulating();
+        }
     }
 
     @Test
     public void deltaSecsTruncatesFractionalSecondsTest() {
         Time.startSimulating();
-        int current = Time.currentTimeSecs();
-        Time.advanceTime(1500);
-        Assert.assertEquals(Time.deltaSecs(current), 1, 0);
-        Time.stopSimulating();
+        try {
+            int current = Time.currentTimeSecs();
+            Time.advanceTime(1500);
+            Assert.assertEquals(Time.deltaSecs(current), 1, 0);
+        } finally {
+            Time.stopSimulating();
+        }
     }
 
 }