This is an automated email from the ASF dual-hosted git repository.
vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git
The following commit(s) were added to refs/heads/master by this push:
new 89255174ed Used Junit 5 assertions to keep it consistent
89255174ed is described below
commit 89255174ed7488e8cb87c5752745fe6af992119b
Author: SampathKumarAmex <[email protected]>
AuthorDate: Thu Aug 25 15:37:02 2022 +0100
Used Junit 5 assertions to keep it consistent
---
.../org/apache/jmeter/timers/SyncTimerTest.java | 33 +++++++++++-----------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git
a/src/components/src/test/java/org/apache/jmeter/timers/SyncTimerTest.java
b/src/components/src/test/java/org/apache/jmeter/timers/SyncTimerTest.java
index 9efd2ce1aa..ceee196ba5 100644
--- a/src/components/src/test/java/org/apache/jmeter/timers/SyncTimerTest.java
+++ b/src/components/src/test/java/org/apache/jmeter/timers/SyncTimerTest.java
@@ -17,12 +17,13 @@
package org.apache.jmeter.timers;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import org.apache.jmeter.control.LoopController;
import org.apache.jmeter.threads.JMeterContextService;
import org.apache.jmeter.threads.JMeterThread;
import org.apache.jorphan.collections.ListedHashTree;
-import org.junit.Assert;
-import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class SyncTimerTest {
@@ -35,10 +36,9 @@ public class SyncTimerTest {
timer.setGroupSize(2);
timer.testStarted();
long duration = timeDelay(timer);
- Assert.assertTrue(
- "Calculating delay takes less then " + schedulerDuration * 2
- + " ms (took: " + duration + " ms)",
- duration < schedulerDuration * 2);
+ assertTrue(duration < schedulerDuration * 2,
+ "Calculating delay takes less then " + schedulerDuration * 2
+ + " ms (took: " + duration + " ms)");
}
@Test
@@ -51,10 +51,9 @@ public class SyncTimerTest {
timer.testStarted();
timer.setTimeoutInMs(timerTimeout);
long duration = timeDelay(timer);
- Assert.assertTrue(
- "Calculating delay takes less then " + timerTimeout * 2
- + " ms (took: " + duration + " ms)",
- duration < timerTimeout * 2);
+ assertTrue(duration < timerTimeout * 2,
+ "Calculating delay takes less then " + timerTimeout * 2
+ + " ms (took: " + duration + " ms)");
}
@Test
@@ -67,10 +66,10 @@ public class SyncTimerTest {
timer.testStarted();
timer.setTimeoutInMs(timerTimeout);
long duration = timeDelay(timer);
- Assert.assertTrue(
- "Calculating delay takes less then " + schedulerDuration * 2
- + " ms (took: " + duration + " ms)",
- duration < schedulerDuration * 2);
+ assertTrue(
+ duration < schedulerDuration * 2,
+ "Calculating delay takes less then " + schedulerDuration * 2
+ + " ms (took: " + duration + " ms)");
}
@Test
@@ -82,9 +81,9 @@ public class SyncTimerTest {
timer.setGroupSize(2);
timer.testStarted();
timer.setTimeoutInMs(timerTimeout);
- Assertions.assertThrows(
- IllegalArgumentException.class,
- timer::delay);
+ assertThrows(
+ IllegalArgumentException.class,
+ timer::delay);
}
private long timeDelay(SyncTimer timer) {