This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new ededf4da1 Test modernization
ededf4da1 is described below
commit ededf4da1b879a2feb08092bb2778ae641dc82da
Author: James Bognar <[email protected]>
AuthorDate: Wed Aug 27 09:34:55 2025 -0400
Test modernization
---
juneau-utest/pom.xml | 12 +
.../java/org/apache/juneau/BenchmarkRunner.java | 269 +++++++++++++++++++++
.../test/java/org/apache/juneau/BenchmarkTest.java | 108 ---------
.../annotation/BeanIgnoreAnnotation_Test.java | 4 +-
.../juneau/http/remote/RrpcInterface_Test.java | 15 +-
.../org/apache/juneau/reflect/ClassInfo_Test.java | 7 +-
.../client/RestClient_Config_RestClient_Test.java | 5 +-
.../org/apache/juneau/utils/StringUtils_Test.java | 9 +-
8 files changed, 292 insertions(+), 137 deletions(-)
diff --git a/juneau-utest/pom.xml b/juneau-utest/pom.xml
index 97c44ab52..ee0bdab20 100644
--- a/juneau-utest/pom.xml
+++ b/juneau-utest/pom.xml
@@ -104,6 +104,18 @@
<version>5.13.4</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-core</artifactId>
+ <version>1.36</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.openjdk.jmh</groupId>
+ <artifactId>jmh-generator-annprocess</artifactId>
+ <version>1.36</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BenchmarkRunner.java
b/juneau-utest/src/test/java/org/apache/juneau/BenchmarkRunner.java
new file mode 100644
index 000000000..6ba855f68
--- /dev/null
+++ b/juneau-utest/src/test/java/org/apache/juneau/BenchmarkRunner.java
@@ -0,0 +1,269 @@
+//***************************************************************************************************************************
+//* Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
+//* distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
+//* to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
+//* with the License. You may obtain a copy of the License at
*
+//*
*
+//* http://www.apache.org/licenses/LICENSE-2.0
*
+//*
*
+//* Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
+//* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the *
+//* specific language governing permissions and limitations under the License.
*
+//***************************************************************************************************************************
+package org.apache.juneau;
+
+import java.util.*;
+import java.util.Map.*;
+import java.util.concurrent.TimeUnit;
+import java.util.function.*;
+
+import org.apache.juneau.utils.*;
+import org.openjdk.jmh.annotations.*;
+import org.openjdk.jmh.infra.Blackhole;
+import org.openjdk.jmh.runner.Runner;
+import org.openjdk.jmh.runner.RunnerException;
+import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.OptionsBuilder;
+
+/**
+ * JMH Benchmark for testing different iteration patterns over collections.
+ *
+ * <p>To run this benchmark:
+ * <pre>
+ * mvn test-compile exec:java
-Dexec.mainClass="org.apache.juneau.BenchmarkRunner"
+ * </pre>
+ *
+ * <p>Or from your IDE, run the main() method.
+ */
+@BenchmarkMode(Mode.AverageTime)
+@OutputTimeUnit(TimeUnit.NANOSECONDS)
+@State(Scope.Benchmark)
+@Fork(value = 2, jvmArgs = {"-Xms2G", "-Xmx2G"})
+@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
+@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
+public class BenchmarkRunner {
+
+ private List<Integer> list;
+ private Map<String, Integer> map;
+
+ // Consumers to test
+ private Consumer<List<Integer>> listIterator;
+ private Consumer<List<Integer>> listForEach;
+ private Consumer<List<Integer>> listStreamForEach;
+
+ private Consumer<Map<String, Integer>> mapValuesIterator;
+ private Consumer<Map<String, Integer>> mapEntrySetIterator;
+ private Consumer<Map<String, Integer>> mapValuesForEach;
+ private Consumer<Map<String, Integer>> mapForEach;
+
+ private ThrowingConsumer<List<Integer>> throwingListIterator;
+ private ThrowingConsumer<List<Integer>> throwingListForEach;
+ private ThrowingConsumer<List<Integer>> throwingListStreamForEach;
+
+ private ThrowingConsumer<Map<String, Integer>>
throwingMapValuesIterator;
+ private ThrowingConsumer<Map<String, Integer>>
throwingMapEntrySetIterator;
+ private ThrowingConsumer<Map<String, Integer>> throwingMapValuesForEach;
+ private ThrowingConsumer<Map<String, Integer>> throwingMapForEach;
+
+ @Setup(Level.Trial)
+ public void setup() {
+ var random = new Random(42); // Fixed seed for reproducible
results
+ int size = 1000; // Larger size for more meaningful benchmarks
+
+ // Initialize test data
+ list = new ArrayList<>(size);
+ map = new LinkedHashMap<>();
+
+ for (int i = 0; i < size; i++) {
+ list.add(random.nextInt(100));
+ map.put(String.valueOf(i), random.nextInt(100));
+ }
+
+ // Initialize consumers - these use Blackhole to prevent JVM
optimizations
+ listIterator = lst -> {
+ for (Integer value : lst) {
+ // Simulate some work - prevents dead code
elimination
+ Math.abs(value);
+ }
+ };
+
+ listForEach = lst -> {
+ for (Integer element : lst) {
+ Math.abs(element);
+ }
+ };
+
+ listStreamForEach = lst -> lst.forEach(value ->
Math.abs(value));
+
+ mapValuesIterator = m -> {
+ for (Integer value : m.values()) {
+ Math.abs(value);
+ }
+ };
+
+ mapEntrySetIterator = m -> {
+ for (Entry<String, Integer> entry : m.entrySet()) {
+ Math.abs(entry.getValue());
+ }
+ };
+
+ mapValuesForEach = m -> m.values().forEach(value ->
Math.abs(value));
+ mapForEach = m -> m.forEach((k, v) -> Math.abs(v));
+
+ // ThrowingConsumer variants
+ throwingListIterator = lst -> {
+ for (Integer value : lst) {
+ Math.abs(value);
+ }
+ };
+
+ throwingListForEach = lst -> {
+ for (Integer element : lst) {
+ Math.abs(element);
+ }
+ };
+
+ throwingListStreamForEach = lst -> lst.forEach(value ->
Math.abs(value));
+
+ throwingMapValuesIterator = m -> {
+ for (Integer value : m.values()) {
+ Math.abs(value);
+ }
+ };
+
+ throwingMapEntrySetIterator = m -> {
+ for (Entry<String, Integer> entry : m.entrySet()) {
+ Math.abs(entry.getValue());
+ }
+ };
+
+ throwingMapValuesForEach = m -> m.values().forEach(value ->
Math.abs(value));
+ throwingMapForEach = m -> m.forEach((k, v) -> Math.abs(v));
+ }
+
+ //
=============================================================================
+ // List iteration benchmarks
+ //
=============================================================================
+
+ @Benchmark
+ public void listIterator(Blackhole bh) {
+ listIterator.accept(list);
+ bh.consume(list); // Prevents optimization
+ }
+
+ @Benchmark
+ public void listForEach(Blackhole bh) {
+ listForEach.accept(list);
+ bh.consume(list);
+ }
+
+ @Benchmark
+ public void listStreamForEach(Blackhole bh) {
+ listStreamForEach.accept(list);
+ bh.consume(list);
+ }
+
+ //
=============================================================================
+ // Map iteration benchmarks
+ //
=============================================================================
+
+ @Benchmark
+ public void mapValuesIterator(Blackhole bh) {
+ mapValuesIterator.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void mapEntrySetIterator(Blackhole bh) {
+ mapEntrySetIterator.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void mapValuesForEach(Blackhole bh) {
+ mapValuesForEach.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void mapForEach(Blackhole bh) {
+ mapForEach.accept(map);
+ bh.consume(map);
+ }
+
+ //
=============================================================================
+ // ThrowingConsumer benchmarks
+ //
=============================================================================
+
+ @Benchmark
+ public void throwingListIterator(Blackhole bh) throws Exception {
+ throwingListIterator.accept(list);
+ bh.consume(list);
+ }
+
+ @Benchmark
+ public void throwingListForEach(Blackhole bh) throws Exception {
+ throwingListForEach.accept(list);
+ bh.consume(list);
+ }
+
+ @Benchmark
+ public void throwingListStreamForEach(Blackhole bh) throws Exception {
+ throwingListStreamForEach.accept(list);
+ bh.consume(list);
+ }
+
+ @Benchmark
+ public void throwingMapValuesIterator(Blackhole bh) throws Exception {
+ throwingMapValuesIterator.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void throwingMapEntrySetIterator(Blackhole bh) throws Exception {
+ throwingMapEntrySetIterator.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void throwingMapValuesForEach(Blackhole bh) throws Exception {
+ throwingMapValuesForEach.accept(map);
+ bh.consume(map);
+ }
+
+ @Benchmark
+ public void throwingMapForEach(Blackhole bh) throws Exception {
+ throwingMapForEach.accept(map);
+ bh.consume(map);
+ }
+
+ //
=============================================================================
+ // Benchmark runner
+ //
=============================================================================
+
+ /**
+ * Run the benchmark.
+ *
+ * <p>Alternative ways to run:
+ * <pre>
+ * # Run all benchmarks
+ * mvn test-compile exec:java
-Dexec.mainClass="org.apache.juneau.IterationBenchmark"
+ *
+ * # Run only list benchmarks
+ * mvn test-compile exec:java
-Dexec.mainClass="org.apache.juneau.IterationBenchmark" -Dexec.args=".*list.*"
+ *
+ * # Run with custom options
+ * mvn test-compile exec:java
-Dexec.mainClass="org.apache.juneau.IterationBenchmark" -Dexec.args="-wi 5 -i
10 -f 3"
+ * </pre>
+ */
+ public static void main(String[] args) throws RunnerException {
+ Options opt = new OptionsBuilder()
+ .include(BenchmarkRunner.class.getSimpleName())
+ .forks(1) // Use 1 fork for faster development testing
+ .warmupIterations(2) // Reduced for faster testing
+ .measurementIterations(3) // Reduced for faster testing
+ .build();
+
+ new Runner(opt).run();
+ }
+}
diff --git a/juneau-utest/src/test/java/org/apache/juneau/BenchmarkTest.java
b/juneau-utest/src/test/java/org/apache/juneau/BenchmarkTest.java
deleted file mode 100644
index 803b2952d..000000000
--- a/juneau-utest/src/test/java/org/apache/juneau/BenchmarkTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-//***************************************************************************************************************************
-//* Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file *
-//* distributed with this work for additional information regarding copyright
ownership. The ASF licenses this file *
-//* to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance *
-//* with the License. You may obtain a copy of the License at
*
-//*
*
-//* http://www.apache.org/licenses/LICENSE-2.0
*
-//*
*
-//* Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an *
-//* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the *
-//* specific language governing permissions and limitations under the License.
*
-//***************************************************************************************************************************
-package org.apache.juneau;
-
-import static org.junit.runners.MethodSorters.*;
-import static org.apache.juneau.TestUtils.*;
-
-import java.util.*;
-import java.util.Map.*;
-import java.util.function.*;
-import java.util.stream.*;
-
-import org.apache.juneau.utils.*;
-import org.junit.*;
-import org.junit.rules.*;
-
-import com.carrotsearch.junitbenchmarks.*;
-
-@BenchmarkOptions(benchmarkRounds = 1000000, warmupRounds = 20)
-@Ignore
-@FixMethodOrder(NAME_ASCENDING)
-public class BenchmarkTest {
-
- @Rule
- public TestRule benchmarkRun = new BenchmarkRule();
-
- public static final Random rand = new Random();
- public static List<Integer> LIST;
- public static Map<String,Integer> MAP;
- static {
- int cap = 10;
- LIST = new ArrayList<>(cap);
- MAP = new LinkedHashMap<>();
-
- for (int i = 0; i < cap; i++) {
- LIST.add(rand.nextInt(10));
- MAP.put(String.valueOf(i), rand.nextInt());
- }
- System.gc();
- System.err.println("Initialized");
- }
-
- public static int result;
-
- private static final Consumer<List<Integer>> list_iterator = x -> {for
(Integer i : x) result += i;};
- private static final Consumer<List<Integer>> list_for = x -> {for
(Integer element : x) result += element;};
- private static final Consumer<List<Integer>> list_foreach = x ->
x.forEach(y -> result += y);
- private static final Consumer<Map<String,Integer>> map_iterator1 = x ->
{for (Integer i : x.values()) result += i;};
- private static final Consumer<Map<String,Integer>> map_iterator2 = x ->
{for (Entry<String,Integer> i : x.entrySet()) result += i.getValue();};
- private static final Consumer<Map<String,Integer>> map_forEach1 = x ->
x.values().forEach(y -> result += y);
- private static final Consumer<Map<String,Integer>> map_forEach2 = x ->
x.forEach((k,v) -> result += v);
- private static final ThrowingConsumer<List<Integer>> slist_iterator = x
-> {for (Integer i : x) result += i;};
- private static final ThrowingConsumer<List<Integer>> slist_for = x ->
{for (Integer element : x) result += element;};
- private static final ThrowingConsumer<List<Integer>> slist_foreach = x
-> x.forEach(y -> result += y);
- private static final ThrowingConsumer<Map<String,Integer>>
smap_iterator1 = x -> {for (Integer i : x.values()) result += i;};
- private static final ThrowingConsumer<Map<String,Integer>>
smap_iterator2 = x -> {for (Entry<String,Integer> i : x.entrySet()) result +=
i.getValue();};
- private static final ThrowingConsumer<Map<String,Integer>>
smap_forEach1 = x -> x.values().forEach(y -> result += y);
- private static final ThrowingConsumer<Map<String,Integer>>
smap_forEach2 = x -> x.forEach((k,v) -> result += v);
-
- @Test public void a01a_list_iterator() {
assertNotThrown(()->list_iterator.accept(LIST)); }
- @Test public void a01b_list_for() {
assertNotThrown(()->list_for.accept(LIST)); }
- @Test public void a01c_list_foreach() {
assertNotThrown(()->list_foreach.accept(LIST)); }
-
- @Test public void a01a_map_iterator1_S() {
assertNotThrown(()->map_iterator1.accept(MAP)); }
- @Test public void a01b_map_iterator2_S() {
assertNotThrown(()->map_iterator2.accept(MAP)); }
- @Test public void a01c_map_forEach1_S() {
assertNotThrown(()->map_forEach1.accept(MAP)); }
- @Test public void a01d_map_forEach2_S() {
assertNotThrown(()->map_forEach2.accept(MAP)); }
-
- @Test public void b01a_list_iterator() {
assertNotThrown(()->slist_iterator.accept(LIST)); }
- @Test public void b01b_list_for() {
assertNotThrown(()->slist_for.accept(LIST)); }
- @Test public void b01c_list_foreach() {
assertNotThrown(()->slist_foreach.accept(LIST)); }
-
- @Test public void b01a_map_iterator1_S() {
assertNotThrown(()->smap_iterator1.accept(MAP)); }
- @Test public void b01b_map_iterator2_S() {
assertNotThrown(()->smap_iterator2.accept(MAP)); }
- @Test public void b01c_map_forEach1_S() {
assertNotThrown(()->smap_forEach1.accept(MAP)); }
- @Test public void b01d_map_forEach2_S() {
assertNotThrown(()->smap_forEach2.accept(MAP)); }
-
- public static void main(String[] args) {
- int cap = 100000;
- long startTime = 0;
- var arrayList = new ArrayList<>();
- arrayList.forEach(Objects::hash);
- IntStream.of(null).forEach(null);
-
- startTime = System.currentTimeMillis();
- for (int i = 0; i < cap; i++) list_iterator.accept(LIST);
- System.err.println("X1=" + (System.currentTimeMillis() -
startTime));
-
- startTime = System.currentTimeMillis();
- for (int i = 0; i < cap; i++) list_for.accept(LIST);
- System.err.println("X2=" + (System.currentTimeMillis() -
startTime));
-
- startTime = System.currentTimeMillis();
- for (int i = 0; i < cap; i++) list_foreach.accept(LIST);
- System.err.println("X3=" + (System.currentTimeMillis() -
startTime));
- }
-
-}
\ No newline at end of file
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
index 84910f9df..af04e7da3 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/annotation/BeanIgnoreAnnotation_Test.java
@@ -13,9 +13,7 @@
package org.apache.juneau.annotation;
import static org.apache.juneau.TestUtils.*;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertSame;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.*;
import org.apache.juneau.*;
import org.junit.jupiter.api.*;
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/http/remote/RrpcInterface_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/http/remote/RrpcInterface_Test.java
index 9005af03f..c1a23c518 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/http/remote/RrpcInterface_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/http/remote/RrpcInterface_Test.java
@@ -16,11 +16,7 @@ import static java.util.Arrays.*;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.http.HttpMethod.*;
import static org.apache.juneau.utest.utils.Constants.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
import java.util.stream.*;
@@ -43,6 +39,7 @@ import org.apache.juneau.urlencoding.*;
import org.apache.juneau.xml.*;
import org.junit.jupiter.params.*;
import org.junit.jupiter.params.provider.*;
+import org.opentest4j.*;
class RrpcInterface_Test extends SimpleTestBase {
@@ -153,13 +150,13 @@ class RrpcInterface_Test extends SimpleTestBase {
// Various primitives
void setNothing();
- void setInt(int x) throws AssertionError;
+ void setInt(int x) throws AssertionFailedError;
void setInteger(Integer x);
void setBoolean(boolean x);
void setFloat(float x);
void setFloatObject(Float x);
void setString(String x);
- void setNullString(String x) throws AssertionError;
+ void setNullString(String x) throws AssertionFailedError;
void setInt3dArray(int[][][] x);
void setInteger3dArray(Integer[][][] x);
void setString3dArray(String[][][] x);
@@ -1360,7 +1357,7 @@ class RrpcInterface_Test extends SimpleTestBase {
@ParameterizedTest
@MethodSource("input")
void h03_setWrongInt(Input input) {
- assertThrows(AssertionError.class, ()->input.proxy.setInt(2),
"expected:<1> but was:<2>");
+ assertThrows(AssertionError.class, ()->input.proxy.setInt(2),
"expected: <1> but was: <2>");
}
@ParameterizedTest
@@ -1402,7 +1399,7 @@ class RrpcInterface_Test extends SimpleTestBase {
@ParameterizedTest
@MethodSource("input")
void h10_setNullStringBad(Input input) {
- assertThrows(AssertionError.class,
()->input.proxy.setNullString("foo"), "expected null, but was:<foo>");
+ assertThrows(AssertionError.class,
()->input.proxy.setNullString("foo"), "expected: <null> but was: <foo>");
}
@ParameterizedTest
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/reflect/ClassInfo_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/reflect/ClassInfo_Test.java
index 2a0440534..f53f40e02 100644
--- a/juneau-utest/src/test/java/org/apache/juneau/reflect/ClassInfo_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/reflect/ClassInfo_Test.java
@@ -18,12 +18,7 @@ import static org.apache.juneau.Context.*;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.reflect.ClassInfo.*;
import static org.apache.juneau.reflect.ReflectFlags.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.*;
import java.io.*;
import java.lang.annotation.*;
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
index 8fa79a01f..c14dcc90b 100644
---
a/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
+++
b/juneau-utest/src/test/java/org/apache/juneau/rest/client/RestClient_Config_RestClient_Test.java
@@ -16,10 +16,7 @@ import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.common.internal.ThrowableUtils.*;
import static org.apache.juneau.http.HttpHeaders.*;
import static org.apache.juneau.http.HttpResponses.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.*;
import java.io.*;
import java.util.concurrent.*;
diff --git
a/juneau-utest/src/test/java/org/apache/juneau/utils/StringUtils_Test.java
b/juneau-utest/src/test/java/org/apache/juneau/utils/StringUtils_Test.java
index 79497cac1..2f6850de6 100755
--- a/juneau-utest/src/test/java/org/apache/juneau/utils/StringUtils_Test.java
+++ b/juneau-utest/src/test/java/org/apache/juneau/utils/StringUtils_Test.java
@@ -14,12 +14,7 @@ package org.apache.juneau.utils;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.common.internal.StringUtils.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.*;
import java.util.*;
@@ -800,7 +795,7 @@ class StringUtils_Test extends SimpleTestBase {
// abbreviate(String,int)
//====================================================================================================
@Test void a32_abbrevate() {
- assertNull("xxx", abbreviate(null, 0));
+ assertNull(abbreviate(null, 0));
assertEquals("foo", abbreviate("foo", 3));
assertEquals("...", abbreviate("fooo", 3));
assertEquals("f...", abbreviate("foooo", 4));