Skip to content

Commit c2afa58

Browse files
Fixed changes to match code conventions
1 parent 8d6370b commit c2afa58

2 files changed

Lines changed: 22 additions & 23 deletions

File tree

utils/src/main/java/com/cloud/utils/Profiler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public class Profiler {
2424
private static final long MILLIS_FACTOR = 1000l;
2525
private static final double EXPONENT = 2d;
2626

27-
2827
private Long startTickNanoSeconds;
2928
private Long stopTickNanoSeconds;
3029

utils/src/test/java/com/cloud/utils/TestProfiler.java

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ public class TestProfiler extends Log4jEnabledTestCase {
3535

3636
private static final long SLEEP_TIME_NANO = 1000000000L;
3737
private static Profiler pf;
38-
38+
3939
@Before
40-
public void setUp(){
41-
pf = new Profiler();
42-
PowerMockito.mockStatic(System.class);
43-
PowerMockito.when(System.nanoTime()).thenReturn(0L, SLEEP_TIME_NANO);
40+
public void setUp() {
41+
pf = new Profiler();
42+
PowerMockito.mockStatic(System.class);
43+
PowerMockito.when(System.nanoTime()).thenReturn(0L, SLEEP_TIME_NANO);
4444
}
45-
45+
4646
@Test
4747
public void testProfilerInMillis() {
4848
//Given
4949
final long sleepTimeMillis = SLEEP_TIME_NANO / 1000000L;
50-
50+
5151
//When
5252
pf.start();
5353
pf.stop();
@@ -58,11 +58,11 @@ public void testProfilerInMillis() {
5858

5959
@Test
6060
public void testProfilerInNano() {
61-
//Given
62-
final long sleepTimeNano = SLEEP_TIME_NANO;
63-
64-
//When
65-
pf.start();
61+
//Given
62+
final long sleepTimeNano = SLEEP_TIME_NANO;
63+
64+
//When
65+
pf.start();
6666
pf.stop();
6767

6868
//Then
@@ -71,26 +71,26 @@ public void testProfilerInNano() {
7171

7272
@Test
7373
public void testProfilerNoStart() {
74-
//Given
75-
final long expectedAnswer = -1;
74+
//Given
75+
final long expectedAnswer = -1;
7676

77-
//When
78-
pf.stop();
77+
//When
78+
pf.stop();
7979

80-
//Then
80+
//Then
8181
Assert.assertTrue(pf.getDurationInMillis() == expectedAnswer);
8282
Assert.assertFalse(pf.isStarted());
8383
}
8484

8585
@Test
8686
public void testProfilerNoStop() {
87-
//Given
88-
final long expectedAnswer = -1;
87+
//Given
88+
final long expectedAnswer = -1;
8989

90-
//When
91-
pf.start();
90+
//When
91+
pf.start();
9292

93-
//Then
93+
//Then
9494
Assert.assertTrue(pf.getDurationInMillis() == expectedAnswer);
9595
Assert.assertFalse(pf.isStopped());
9696
}

0 commit comments

Comments
 (0)