You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sw...@apache.org on 2016/04/18 14:31:23 UTC
[2/3] git commit: updated refs/heads/master to 749b716
Fixed changes to match code conventions
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c2afa584
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c2afa584
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c2afa584
Branch: refs/heads/master
Commit: c2afa584ae68f52cdf55a7204c01ed66a5be1912
Parents: 8d6370b
Author: Alexandre Limas Santana <al...@gmail.com>
Authored: Sun Mar 20 11:49:04 2016 -0300
Committer: Alexandre Limas Santana <al...@gmail.com>
Committed: Sun Mar 20 11:49:04 2016 -0300
----------------------------------------------------------------------
.../src/main/java/com/cloud/utils/Profiler.java | 1 -
.../test/java/com/cloud/utils/TestProfiler.java | 44 ++++++++++----------
2 files changed, 22 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c2afa584/utils/src/main/java/com/cloud/utils/Profiler.java
----------------------------------------------------------------------
diff --git a/utils/src/main/java/com/cloud/utils/Profiler.java b/utils/src/main/java/com/cloud/utils/Profiler.java
index b08e7c9..addee2d 100644
--- a/utils/src/main/java/com/cloud/utils/Profiler.java
+++ b/utils/src/main/java/com/cloud/utils/Profiler.java
@@ -24,7 +24,6 @@ public class Profiler {
private static final long MILLIS_FACTOR = 1000l;
private static final double EXPONENT = 2d;
-
private Long startTickNanoSeconds;
private Long stopTickNanoSeconds;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c2afa584/utils/src/test/java/com/cloud/utils/TestProfiler.java
----------------------------------------------------------------------
diff --git a/utils/src/test/java/com/cloud/utils/TestProfiler.java b/utils/src/test/java/com/cloud/utils/TestProfiler.java
index ad48d78..0e68175 100644
--- a/utils/src/test/java/com/cloud/utils/TestProfiler.java
+++ b/utils/src/test/java/com/cloud/utils/TestProfiler.java
@@ -35,19 +35,19 @@ public class TestProfiler extends Log4jEnabledTestCase {
private static final long SLEEP_TIME_NANO = 1000000000L;
private static Profiler pf;
-
+
@Before
- public void setUp(){
- pf = new Profiler();
- PowerMockito.mockStatic(System.class);
- PowerMockito.when(System.nanoTime()).thenReturn(0L, SLEEP_TIME_NANO);
+ public void setUp() {
+ pf = new Profiler();
+ PowerMockito.mockStatic(System.class);
+ PowerMockito.when(System.nanoTime()).thenReturn(0L, SLEEP_TIME_NANO);
}
-
+
@Test
public void testProfilerInMillis() {
//Given
final long sleepTimeMillis = SLEEP_TIME_NANO / 1000000L;
-
+
//When
pf.start();
pf.stop();
@@ -58,11 +58,11 @@ public class TestProfiler extends Log4jEnabledTestCase {
@Test
public void testProfilerInNano() {
- //Given
- final long sleepTimeNano = SLEEP_TIME_NANO;
-
- //When
- pf.start();
+ //Given
+ final long sleepTimeNano = SLEEP_TIME_NANO;
+
+ //When
+ pf.start();
pf.stop();
//Then
@@ -71,26 +71,26 @@ public class TestProfiler extends Log4jEnabledTestCase {
@Test
public void testProfilerNoStart() {
- //Given
- final long expectedAnswer = -1;
+ //Given
+ final long expectedAnswer = -1;
- //When
- pf.stop();
+ //When
+ pf.stop();
- //Then
+ //Then
Assert.assertTrue(pf.getDurationInMillis() == expectedAnswer);
Assert.assertFalse(pf.isStarted());
}
@Test
public void testProfilerNoStop() {
- //Given
- final long expectedAnswer = -1;
+ //Given
+ final long expectedAnswer = -1;
- //When
- pf.start();
+ //When
+ pf.start();
- //Then
+ //Then
Assert.assertTrue(pf.getDurationInMillis() == expectedAnswer);
Assert.assertFalse(pf.isStopped());
}