From 14d1ffbb0f3cc826adb77d6c9c9dcadc9b307f36 Mon Sep 17 00:00:00 2001 From: "Kim, Joo Hyuk" Date: Wed, 22 Jan 2025 09:50:17 +0900 Subject: [PATCH] [JSTEP-10] migrate `hppc`, `eclipse-collections`, `pcollections` to JUnit 5 (#177) --- .../eclipsecollections/DeserializerTest.java | 73 ++++++++++--------- .../eclipsecollections/Fuzz124_64629Test.java | 10 +-- .../eclipsecollections/ModuleTestBase.java | 2 +- .../eclipsecollections/SerializerTest.java | 42 ++++++----- guava/pom.xml | 7 ++ .../jackson/datatype/hppc/HppcTestBase.java | 4 +- .../jackson/datatype/hppc/TestVersions.java | 2 + .../deser/TestContainerDeserializers.java | 18 +++-- .../hppc/ser/TestContainerSerializers.java | 14 +++- .../datatype/pcollections/ModuleTestBase.java | 2 +- .../pcollections/TestPCollections.java | 5 +- pom.xml | 16 ++-- 12 files changed, 112 insertions(+), 83 deletions(-) diff --git a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/DeserializerTest.java b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/DeserializerTest.java index f990e2f6..28e9a1e6 100644 --- a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/DeserializerTest.java +++ b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/DeserializerTest.java @@ -167,21 +167,22 @@ import org.eclipse.collections.impl.factory.primitive.ShortSets; import org.eclipse.collections.impl.tuple.Tuples; import org.eclipse.collections.impl.tuple.primitive.PrimitiveTuples; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; public final class DeserializerTest extends ModuleTestBase { private void testCollection(T expected, String json, TypeReference type) throws IOException { ObjectMapper objectMapper = mapperWithModule(); T value = objectMapper.readValue(json, type); - Assert.assertEquals(expected, value); - Assert.assertTrue(objectMapper.getTypeFactory().constructType(type).getRawClass().isInstance(value)); + assertEquals(expected, value); + assertTrue(objectMapper.getTypeFactory().constructType(type).getRawClass().isInstance(value)); } private void testCollection(T expected, String json, Class type) throws IOException { T value = mapperWithModule().readValue(json, type); - Assert.assertEquals(expected, value); - Assert.assertTrue(type.isInstance(value)); + assertEquals(expected, value); + assertTrue(type.isInstance(value)); } @Test @@ -465,7 +466,7 @@ static void primitiveMaps0(ObjectMapper mapper, boolean serialize) throws Except .getMethod("ofAll", baseMapType) .invoke(immutableFactory, mutableSample); - Assert.assertEquals(mutableSample, immutableSample); + assertEquals(mutableSample, immutableSample); Function, JavaType> generify; if (key == Object.class || value == Object.class) { @@ -483,21 +484,21 @@ static void primitiveMaps0(ObjectMapper mapper, boolean serialize) throws Except mapper.writerFor(generify.apply(baseMapType)).writeValueAsString(mutableSample); String polyPrinted = mapper.writeValueAsString(mutableSample); // compare trees so property order doesn't matter - Assert.assertEquals(mapper.readTree(json), mapper.readTree(mutablePrinted)); - Assert.assertEquals(mapper.readTree(json), mapper.readTree(immutablePrinted)); - Assert.assertEquals(mapper.readTree(json), mapper.readTree(basePrinted)); - Assert.assertEquals(mapper.readTree(json), mapper.readTree(polyPrinted)); + assertEquals(mapper.readTree(json), mapper.readTree(mutablePrinted)); + assertEquals(mapper.readTree(json), mapper.readTree(immutablePrinted)); + assertEquals(mapper.readTree(json), mapper.readTree(basePrinted)); + assertEquals(mapper.readTree(json), mapper.readTree(polyPrinted)); } else { Object mutableParsed = mapper.readValue(json, generify.apply(mutableMapType)); Object immutableParsed = mapper.readValue(json, generify.apply(immutableMapType)); Object baseParsed = mapper.readValue(json, generify.apply(baseMapType)); - Assert.assertEquals(mutableSample, mutableParsed); - Assert.assertEquals(immutableSample, immutableParsed); - Assert.assertEquals(mutableSample, baseParsed); + assertEquals(mutableSample, mutableParsed); + assertEquals(immutableSample, immutableParsed); + assertEquals(mutableSample, baseParsed); - Assert.assertTrue(mutableMapType.isInstance(mutableParsed)); - Assert.assertTrue(immutableMapType.isInstance(immutableParsed)); - Assert.assertTrue(baseMapType.isInstance(baseParsed)); + assertTrue(mutableMapType.isInstance(mutableParsed)); + assertTrue(immutableMapType.isInstance(immutableParsed)); + assertTrue(baseMapType.isInstance(baseParsed)); } } } @@ -509,19 +510,19 @@ private static String capitalize(String simpleName) { @Test public void objectObjectMaps() throws IOException { - Assert.assertEquals( + assertEquals( mapperWithModule().readValue("{\"abc\":\"def\"}", new TypeReference>() {}), Maps.mutable.of("abc", "def") ); - Assert.assertEquals( + assertEquals( mapperWithModule().readValue("{\"abc\":\"def\"}", new TypeReference>() {}), Maps.immutable.of("abc", "def") ); - Assert.assertEquals( + assertEquals( mapperWithModule().readValue("{\"abc\":\"def\"}", new TypeReference>() {}), Maps.mutable.of("abc", "def") ); - Assert.assertEquals( + assertEquals( mapperWithModule().readValue("{\"abc\":\"def\"}", new TypeReference>() {}), Maps.mutable.of("abc", "def") @@ -544,7 +545,7 @@ private static Object randomSample(Class type) { @Test public void typeInfoObjectMap() throws IOException { - Assert.assertEquals( + assertEquals( mapperWithModule() .readValue("{\"map\":{\"0\":{\"@c\":\".DeserializerTest$B\"}}}", Container.class).map, IntObjectMaps.immutable.of(0, new B()) @@ -581,7 +582,7 @@ public void typeInfoNestedMapList() throws IOException { // test case for jackson-datatypes-collections#71 ImmutableMap> property = Maps.immutable.of("foo", Lists.immutable.of(new B())); - Assert.assertEquals( + assertEquals( mapperWithModule().readValue( "{\"foo\": [{\"@c\": \".DeserializerTest$B\"}]}", new TypeReference>>() {}), @@ -594,7 +595,7 @@ public void typeInfoNestedMapMap() throws IOException { // auxiliary test case for jackson-datatypes-collections#71 - also worked before fix ImmutableMap> property = Maps.immutable.of("foo", Maps.immutable.of("bar", new B())); - Assert.assertEquals( + assertEquals( mapperWithModule().readValue( "{\"foo\": {\"bar\": {\"@c\": \".DeserializerTest$B\"}}}", new TypeReference>>() {}), @@ -656,8 +657,8 @@ public void primitivePairs() throws Exception { + ",\"two\":" + mapperWithModule().writeValueAsString(sampleTwo) + "}"; Object samplePair = factory.invoke(null, sampleOne, sampleTwo); - Assert.assertEquals(expectedJson, mapperWithModule().writeValueAsString(samplePair)); - Assert.assertEquals(samplePair, mapperWithModule().readValue(expectedJson, pairType)); + assertEquals(expectedJson, mapperWithModule().writeValueAsString(samplePair)); + assertEquals(samplePair, mapperWithModule().readValue(expectedJson, pairType)); } } } @@ -670,8 +671,8 @@ public void twin() throws Exception { String expectedJson = "{\"one\":" + mapper.writeValueAsString(sampleOne) + ",\"two\":" + mapper.writeValueAsString(sampleTwo) + "}"; Twin twin = Tuples.twin((String) sampleOne, (String) sampleTwo); - Assert.assertEquals(expectedJson, mapper.writeValueAsString(twin)); - Assert.assertEquals(twin, mapper.readValue(expectedJson, new TypeReference>() {})); + assertEquals(expectedJson, mapper.writeValueAsString(twin)); + assertEquals(twin, mapper.readValue(expectedJson, new TypeReference>() {})); } @Test @@ -681,8 +682,8 @@ public void pairTyped() throws Exception { final String actJson = mapper.writerFor(new TypeReference>() {}) .writeValueAsString(pair); String expJson = "{\"one\":{\"@c\":\".DeserializerTest$B\"},\"two\":5}"; - Assert.assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); - Assert.assertEquals(pair, + assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); + assertEquals(pair, mapper.readValue(actJson, new TypeReference>() {}) ); } @@ -693,8 +694,8 @@ public void nestedMap() throws Exception { String json = "{\"a\":{\"b\":\"c\"}}"; TypeReference>> type = new TypeReference>>() {}; - Assert.assertEquals(json, mapperWithModule().writerFor(type).writeValueAsString(pair)); - Assert.assertEquals(pair, mapperWithModule().readValue(json, type)); + assertEquals(json, mapperWithModule().writerFor(type).writeValueAsString(pair)); + assertEquals(pair, mapperWithModule().readValue(json, type)); } @Test @@ -704,8 +705,8 @@ public void triple() throws Exception { String actJson = mapper.writerFor(new TypeReference>() {}) .writeValueAsString(triple); String expJson = "{\"one\":\"a\",\"two\":2,\"three\":false}"; - Assert.assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); - Assert.assertEquals( + assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); + assertEquals( triple, mapper.readValue(actJson, new TypeReference>() {}) ); @@ -718,8 +719,8 @@ public void triplet() throws Exception { String actJson = mapper.writerFor(new TypeReference>() {}) .writeValueAsString(triple); String expJson = "{\"one\":\"a\",\"two\":\"b\",\"three\":\"c\"}"; - Assert.assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); - Assert.assertEquals( + assertEquals(mapper.readTree(expJson), mapper.readTree(actJson)); + assertEquals( triple, mapper.readValue(actJson, new TypeReference>() {}) ); diff --git a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/Fuzz124_64629Test.java b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/Fuzz124_64629Test.java index f9cee32d..72a2810b 100644 --- a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/Fuzz124_64629Test.java +++ b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/Fuzz124_64629Test.java @@ -1,15 +1,13 @@ package com.fasterxml.jackson.datatype.eclipsecollections; -import static org.junit.Assert.assertTrue; - -import org.junit.Assert; -import org.junit.Test; - import org.eclipse.collections.api.map.primitive.MutableCharCharMap; +import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.MismatchedInputException; +import static org.junit.jupiter.api.Assertions.*; + /** * Unit tests for verifying the fixes for OSS-Fuzz issues * work as expected @@ -25,7 +23,7 @@ public void testOSSFuzzIssue64629() throws Exception // Invalid token {"x?":[x?]: where ? is not ascii characters final char[] invalid = {123, 34, 824, 34, 58, 91, 120, 7, 93}; - MismatchedInputException e = Assert.assertThrows( + MismatchedInputException e = assertThrows( MismatchedInputException.class, () -> MAPPER.readValue(new String(invalid), MutableCharCharMap.class)); assertTrue(e.getMessage().contains("Cannot convert a JSON Null into a char element of map")); diff --git a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/ModuleTestBase.java b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/ModuleTestBase.java index 3acbd1e6..6082a6a2 100644 --- a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/ModuleTestBase.java +++ b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/ModuleTestBase.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.Arrays; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; public abstract class ModuleTestBase { diff --git a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/SerializerTest.java b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/SerializerTest.java index 600727a6..6b6375f2 100644 --- a/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/SerializerTest.java +++ b/eclipse-collections/src/test/java/com/fasterxml/jackson/datatype/eclipsecollections/SerializerTest.java @@ -24,13 +24,15 @@ import org.eclipse.collections.impl.factory.primitive.IntObjectMaps; import org.eclipse.collections.impl.factory.primitive.LongLists; import org.eclipse.collections.impl.factory.primitive.ShortLists; -import org.junit.Assert; -import org.junit.Test; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; public final class SerializerTest extends ModuleTestBase { @Test public void ref() throws IOException { - Assert.assertEquals( + assertEquals( "[\"a\",\"b\",\"c\"]", mapperWithModule().writeValueAsString(Sets.immutable.of("a", "b", "c")) ); @@ -38,26 +40,26 @@ public void ref() throws IOException { @Test public void primitive() throws IOException { - Assert.assertEquals("[true,false,true]", mapperWithModule().writeValueAsString( + assertEquals("[true,false,true]", mapperWithModule().writeValueAsString( BooleanLists.immutable.of(true, false, true))); - Assert.assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( + assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( ShortLists.immutable.of((short) 1, (short) 2, (short) 3))); - Assert.assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( + assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( IntLists.immutable.of(1, 2, 3))); - Assert.assertEquals("[1.1,2.3,3.5]", mapperWithModule().writeValueAsString( + assertEquals("[1.1,2.3,3.5]", mapperWithModule().writeValueAsString( FloatLists.immutable.of(1.1F, 2.3F, 3.5F))); - Assert.assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( + assertEquals("[1,2,3]", mapperWithModule().writeValueAsString( LongLists.immutable.of(1, 2, 3))); - Assert.assertEquals("[1.1,2.3,3.5]", mapperWithModule().writeValueAsString( + assertEquals("[1.1,2.3,3.5]", mapperWithModule().writeValueAsString( DoubleLists.immutable.of(1.1, 2.3, 3.5))); - Assert.assertEquals( + assertEquals( mapperWithModule().writeValueAsString(new byte[]{ 1, 2, 3 }), mapperWithModule().writeValueAsString(ByteLists.immutable.of((byte) 1, (byte) 2, (byte) 3))); - Assert.assertEquals( + assertEquals( mapperWithModule().writeValueAsString(new char[]{ '1', '2', '3' }), mapperWithModule().writeValueAsString(CharLists.immutable.of('1', '2', '3'))); - Assert.assertEquals( + assertEquals( mapperWithModule().configure(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true) .writeValueAsString(new char[]{ '1', '2', '3' }), mapperWithModule().configure(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true) @@ -82,7 +84,7 @@ class Wrapper { Wrapper wrapper = new Wrapper(); wrapper.object = iterable; - Assert.assertEquals("{\"object\":[\"" + iterable.getClass().getName() + "\"," + data + "]}", + assertEquals("{\"object\":[\"" + iterable.getClass().getName() + "\"," + data + "]}", objectMapper.writeValueAsString(wrapper)); } @@ -117,27 +119,27 @@ public void primitiveMaps() throws Exception @Test public void objectObjectMaps() throws IOException { - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writerFor(MutableMap.class).writeValueAsString(Maps.mutable.of("abc", "def")) ); - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writerFor(ImmutableMap.class).writeValueAsString(Maps.immutable.of("abc", "def")) ); - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writerFor(MapIterable.class).writeValueAsString(Maps.immutable.of("abc", "def")) ); - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writerFor(MutableMapIterable.class).writeValueAsString(Maps.mutable.of("abc", "def")) ); - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writeValueAsString(Maps.immutable.of("abc", "def")) ); - Assert.assertEquals( + assertEquals( "{\"abc\":\"def\"}", mapperWithModule().writerFor(new TypeReference>() {}) .writeValueAsString(Maps.immutable.of("abc", "def")) @@ -146,7 +148,7 @@ public void objectObjectMaps() throws IOException { @Test public void typeInfoObjectMap() throws IOException { - Assert.assertEquals( + assertEquals( "{\"map\":{\"0\":{\"@c\":\".SerializerTest$B\"}}}", mapperWithModule().writeValueAsString(new Container()) ); diff --git a/guava/pom.xml b/guava/pom.xml index ce5cf18a..f02d0119 100644 --- a/guava/pom.xml +++ b/guava/pom.xml @@ -66,6 +66,13 @@ com.google.common.*;version="${version.guava.osgi}", guava ${version.guava} + + + + junit + junit + test + diff --git a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/HppcTestBase.java b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/HppcTestBase.java index fd5be18f..6c010472 100644 --- a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/HppcTestBase.java +++ b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/HppcTestBase.java @@ -4,7 +4,9 @@ import com.fasterxml.jackson.databind.ObjectMapper; -public abstract class HppcTestBase extends junit.framework.TestCase +import static org.junit.jupiter.api.Assertions.fail; + +public abstract class HppcTestBase { protected HppcTestBase() { } diff --git a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/TestVersions.java b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/TestVersions.java index d9ce645e..f0f25b19 100644 --- a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/TestVersions.java +++ b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/TestVersions.java @@ -2,6 +2,8 @@ import java.io.*; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class TestVersions extends HppcTestBase { public void testMapperVersions() throws IOException diff --git a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/deser/TestContainerDeserializers.java b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/deser/TestContainerDeserializers.java index bae112eb..52787efc 100644 --- a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/deser/TestContainerDeserializers.java +++ b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/deser/TestContainerDeserializers.java @@ -4,36 +4,40 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import org.junit.Assert; - import com.carrotsearch.hppc.*; +import org.junit.jupiter.api.Test; + import com.fasterxml.jackson.datatype.hppc.HppcTestBase; +import static org.junit.jupiter.api.Assertions.*; + public class TestContainerDeserializers extends HppcTestBase { + + @Test public void testIntDeserializers() throws Exception { ObjectMapper mapper = mapperWithModule(); // first, direct IntArrayList array = mapper.readValue("[1,-3]", IntArrayList.class); - Assert.assertArrayEquals(new int[] { 1, -3 }, array.toArray()); + assertArrayEquals(new int[] { 1, -3 }, array.toArray()); IntHashSet set = mapper.readValue("[-1234,0]", IntHashSet.class); // 08-Apr-2014, tatu: Order indeterminate actually, has change between 0.4 and 0.5 _assertSets(new int[] { -1234, 0 }, set.toArray()); IntArrayDeque dq = mapper.readValue("[0,13]", IntArrayDeque.class); - Assert.assertArrayEquals(new int[] { -0, 13 }, dq.toArray()); + assertArrayEquals(new int[] { -0, 13 }, dq.toArray()); // then via abstract class defaulting IntIndexedContainer array2 = mapper.readValue("[1,-3]", IntIndexedContainer.class); - Assert.assertArrayEquals(new int[] { 1, -3 }, array2.toArray()); + assertArrayEquals(new int[] { 1, -3 }, array2.toArray()); IntSet set2 = mapper.readValue("[-1234,0]", IntSet.class); _assertSets(new int[] { -1234, 0 }, set2.toArray()); IntDeque dq2 = mapper.readValue("[0,13]", IntDeque.class); - Assert.assertArrayEquals(new int[] { -0, 13 }, dq2.toArray()); + assertArrayEquals(new int[] { -0, 13 }, dq2.toArray()); } private void _assertSets(int[] exp, int[] actual) @@ -46,6 +50,6 @@ private void _assertSets(int[] exp, int[] actual) Arrays.sort(exp2); Arrays.sort(act2); - Assert.assertArrayEquals(exp2, act2); + assertArrayEquals(exp2, act2); } } diff --git a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/ser/TestContainerSerializers.java b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/ser/TestContainerSerializers.java index 86b9bfa5..493ce20e 100644 --- a/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/ser/TestContainerSerializers.java +++ b/hppc/src/test/java/com/fasterxml/jackson/datatype/hppc/ser/TestContainerSerializers.java @@ -3,11 +3,15 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.carrotsearch.hppc.*; +import org.junit.jupiter.api.Test; import com.fasterxml.jackson.datatype.hppc.HppcTestBase; +import static org.junit.jupiter.api.Assertions.*; + public class TestContainerSerializers extends HppcTestBase { + @Test public void testByteSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -35,6 +39,7 @@ public void testByteSerializer() throws Exception */ } + @Test public void testShortSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -51,6 +56,7 @@ public void testShortSerializer() throws Exception } } + @Test public void testIntSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -67,6 +73,7 @@ public void testIntSerializer() throws Exception } } + @Test public void testLongSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -83,6 +90,7 @@ public void testLongSerializer() throws Exception } } + @Test public void testCharSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -99,6 +107,7 @@ public void testCharSerializer() throws Exception } } + @Test public void testFloatSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -117,6 +126,7 @@ public void testFloatSerializer() throws Exception */ } + @Test public void testDoubleSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -141,6 +151,7 @@ public void testDoubleSerializer() throws Exception /********************************************************************** */ + @Test public void testObjectContainerSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); @@ -153,7 +164,8 @@ public void testObjectContainerSerializer() throws Exception // TODO: polymorphic case (@JsonTypeInfo and/or default typing) } - + + @Test public void testBitSetSerializer() throws Exception { ObjectMapper mapper = mapperWithModule(); diff --git a/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/ModuleTestBase.java b/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/ModuleTestBase.java index a543e9de..fada1a53 100644 --- a/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/ModuleTestBase.java +++ b/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/ModuleTestBase.java @@ -4,7 +4,7 @@ import java.util.Arrays; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.fail; public abstract class ModuleTestBase { diff --git a/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/TestPCollections.java b/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/TestPCollections.java index 4cbe84c5..622d2995 100644 --- a/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/TestPCollections.java +++ b/pcollections/src/test/java/com/fasterxml/jackson/datatype/pcollections/TestPCollections.java @@ -9,10 +9,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.exc.InvalidDefinitionException; -import org.junit.Test; import org.pcollections.*; -import static org.junit.Assert.*; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; /** * Unit tests for verifying that various PCollection types diff --git a/pom.xml b/pom.xml index 6db2dc13..453487ab 100644 --- a/pom.xml +++ b/pom.xml @@ -50,10 +50,15 @@ jackson-databind - + - junit - junit + org.junit.jupiter + junit-jupiter + test + + + org.junit.jupiter + junit-jupiter-api test @@ -88,11 +93,6 @@ org.apache.maven.plugins maven-surefire-plugin - - - com/fasterxml/jackson/**/failing/*.java - -