forked from deephaven/deephaven-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d71f9f
commit bcf302b
Showing
6 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
clock-impl/src/test/java/io/deephaven/base/clock/SystemClockJdkInternalMiscVmTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.base.clock; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.Instant; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class SystemClockJdkInternalMiscVmTest { | ||
|
||
private SystemClockJdkInternalMiscVm SUT; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
SUT = new SystemClockJdkInternalMiscVm(); | ||
} | ||
|
||
@Test | ||
void currentTimeMillis() { | ||
assertThat(SUT.currentTimeMillis()).isPositive(); | ||
} | ||
|
||
@Test | ||
void currentTimeMicros() { | ||
assertThat(SUT.currentTimeMicros()).isPositive(); | ||
} | ||
|
||
@Test | ||
void currentTimeNanos() { | ||
assertThat(SUT.currentTimeNanos()).isPositive(); | ||
} | ||
|
||
@Test | ||
void instantMillis() { | ||
assertThat(SUT.instantMillis()).isAfter(Instant.EPOCH); | ||
} | ||
|
||
@Test | ||
void instantNanos() { | ||
assertThat(SUT.instantNanos()).isAfter(Instant.EPOCH); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
clock-impl/src/test/java/io/deephaven/base/clock/SystemClockTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.base.clock; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.lang.reflect.InvocationTargetException; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class SystemClockTest { | ||
@Test | ||
void of() throws ClassNotFoundException, InvocationTargetException, NoSuchMethodException, | ||
InstantiationException, IllegalAccessException { | ||
assertThat(SystemClock.of()).isExactlyInstanceOf(SystemClockJdkInternalMiscVm.class); | ||
} | ||
|
||
@Test | ||
void serviceLoader() { | ||
assertThat(SystemClock.serviceLoader()).get().isExactlyInstanceOf(SystemClockJdkInternalMiscVm.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
hotspot-impl/src/test/java/io/deephaven/hotspot/HotSpotTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.hotspot; | ||
|
||
import io.deephaven.hotspot.impl.HotSpotImpl; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class HotSpotTest { | ||
|
||
@Test | ||
void loadImpl() { | ||
assertThat(HotSpot.loadImpl()).get().isExactlyInstanceOf(HotSpotImpl.class); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
hotspot-impl/src/test/java/io/deephaven/hotspot/impl/HotSpotImplTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.hotspot.impl; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class HotSpotImplTest { | ||
|
||
private HotSpotImpl SUT; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
SUT = new HotSpotImpl(); | ||
} | ||
|
||
@Test | ||
void getSafepointCount() { | ||
assertThat(SUT.getSafepointCount()).isNotNegative(); | ||
} | ||
|
||
@Test | ||
void getTotalSafepointTimeMillis() { | ||
assertThat(SUT.getTotalSafepointTimeMillis()).isNotNegative(); | ||
} | ||
|
||
@Test | ||
void getSafepointSyncTimeMillis() { | ||
assertThat(SUT.getSafepointSyncTimeMillis()).isNotNegative(); | ||
} | ||
} |