Skip to content

Commit ce188da

Browse files
committed
Merge branch '2.17' into 2.18
2 parents 5bf126f + 1c656ae commit ce188da

37 files changed

+570
-869
lines changed

src/test/java/com/fasterxml/jackson/core/BaseTest.java

-538
This file was deleted.

src/test/java/com/fasterxml/jackson/core/ComponentVersionsTest.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
import com.fasterxml.jackson.core.testsupport.TestSupport;
88

99
import static org.junit.jupiter.api.Assertions.assertEquals;
10-
import static org.junit.jupiter.api.Assertions.assertTrue;
1110

1211
/**
1312
* Tests to verify functioning of {@link Version} class.
1413
*/
15-
public class ComponentVersionsTest
16-
extends JUnit5TestBase
14+
class ComponentVersionsTest
15+
extends JUnit5TestBase
1716
{
1817
@Test
19-
public void testCoreVersions() throws Exception
18+
void coreVersions() throws Exception
2019
{
2120
final JsonFactory f = new JsonFactory();
2221
assertVersion(f.version());
@@ -30,11 +29,11 @@ public void testCoreVersions() throws Exception
3029
}
3130

3231
@Test
33-
public void testEquality() {
32+
void equality() {
3433
Version unk = Version.unknownVersion();
3534
assertEquals("0.0.0", unk.toString());
3635
assertEquals("//0.0.0", unk.toFullString());
37-
assertTrue(unk.equals(unk));
36+
assertEquals(unk, unk);
3837

3938
Version other = new Version(2, 8, 4, "",
4039
"groupId", "artifactId");
@@ -47,7 +46,7 @@ public void testEquality() {
4746
}
4847

4948
@Test
50-
public void testMisc() {
49+
void misc() {
5150
Version unk = Version.unknownVersion();
5251
int hash = unk.hashCode();
5352
// Happens to be 0 at this point (Jackson 2.16)

src/test/java/com/fasterxml/jackson/core/ErrorReportConfigurationTest.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*
1515
* @since 2.16
1616
*/
17-
public class ErrorReportConfigurationTest
18-
extends JUnit5TestBase
17+
class ErrorReportConfigurationTest
18+
extends JUnit5TestBase
1919
{
2020
/*
2121
/**********************************************************
@@ -30,7 +30,7 @@ public class ErrorReportConfigurationTest
3030
private final ErrorReportConfiguration DEFAULTS = ErrorReportConfiguration.defaults();
3131

3232
@Test
33-
public void testNormalBuild()
33+
void normalBuild()
3434
{
3535
ErrorReportConfiguration config = ErrorReportConfiguration.builder()
3636
.maxErrorTokenLength(1004)
@@ -42,7 +42,7 @@ public void testNormalBuild()
4242
}
4343

4444
@Test
45-
public void testZeroLengths()
45+
void zeroLengths()
4646
{
4747
// boundary tests, because we throw error on negative values
4848
ErrorReportConfiguration config = ErrorReportConfiguration.builder()
@@ -55,7 +55,7 @@ public void testZeroLengths()
5555
}
5656

5757
@Test
58-
public void testInvalidMaxErrorTokenLength()
58+
void invalidMaxErrorTokenLength()
5959
{
6060
ErrorReportConfiguration.Builder builder = ErrorReportConfiguration.builder();
6161
try {
@@ -75,7 +75,7 @@ public void testInvalidMaxErrorTokenLength()
7575
}
7676

7777
@Test
78-
public void testDefaults()
78+
void defaults()
7979
{
8080
// default value
8181
assertEquals(DEFAULT_ERROR_LENGTH, DEFAULTS.getMaxErrorTokenLength());
@@ -86,7 +86,7 @@ public void testDefaults()
8686
}
8787

8888
@Test
89-
public void testOverrideDefaultErrorReportConfiguration()
89+
void overrideDefaultErrorReportConfiguration()
9090
{
9191
// (1) override with null, will be no change
9292
ErrorReportConfiguration.overrideDefaultErrorReportConfiguration(null);
@@ -117,7 +117,7 @@ public void testOverrideDefaultErrorReportConfiguration()
117117
}
118118

119119
@Test
120-
public void testRebuild()
120+
void rebuild()
121121
{
122122
ErrorReportConfiguration config = ErrorReportConfiguration.builder().build();
123123
ErrorReportConfiguration rebuiltConfig = config.rebuild().build();
@@ -127,7 +127,7 @@ public void testRebuild()
127127
}
128128

129129
@Test
130-
public void testBuilderConstructorWithErrorReportConfiguration()
130+
void builderConstructorWithErrorReportConfiguration()
131131
{
132132
ErrorReportConfiguration configA = ErrorReportConfiguration.builder()
133133
.maxErrorTokenLength(1234)
@@ -141,7 +141,7 @@ public void testBuilderConstructorWithErrorReportConfiguration()
141141
}
142142

143143
@Test
144-
public void testWithJsonLocation() throws Exception
144+
void withJsonLocation() throws Exception
145145
{
146146
// Truncated result
147147
_verifyJsonLocationToString("abc", 2, "\"ab\"[truncated 1 chars]");
@@ -152,7 +152,7 @@ public void testWithJsonLocation() throws Exception
152152
}
153153

154154
@Test
155-
public void testWithJsonFactory() throws Exception
155+
void withJsonFactory() throws Exception
156156
{
157157
// default
158158
_verifyJsonProcessingExceptionSourceLength(500,
@@ -175,7 +175,7 @@ public void testWithJsonFactory() throws Exception
175175
}
176176

177177
@Test
178-
public void testExpectedTokenLengthWithConfigurations()
178+
void expectedTokenLengthWithConfigurations()
179179
throws Exception
180180
{
181181
// default
@@ -217,7 +217,7 @@ public void testExpectedTokenLengthWithConfigurations()
217217
}
218218

219219
@Test
220-
public void testNonPositiveErrorTokenConfig()
220+
void nonPositiveErrorTokenConfig()
221221
{
222222
// Zero should be ok
223223
ErrorReportConfiguration.builder().maxErrorTokenLength(0).build();
@@ -234,7 +234,7 @@ public void testNonPositiveErrorTokenConfig()
234234
}
235235

236236
@Test
237-
public void testNullSetterThrowsException() {
237+
void nullSetterThrowsException() {
238238
try {
239239
newStreamFactory().setErrorReportConfiguration(null);
240240
fail();

src/test/java/com/fasterxml/jackson/core/ExceptionsTest.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
import static org.junit.jupiter.api.Assertions.*;
1111

12-
public class ExceptionsTest
13-
extends JUnit5TestBase
12+
class ExceptionsTest
13+
extends JUnit5TestBase
1414
{
1515
private final JsonFactory JSON_F = newStreamFactory();
1616

1717
// For [core#10]
1818
@Test
19-
public void testOriginalMesssage()
19+
void originalMesssage()
2020
{
2121
JsonProcessingException exc = new JsonParseException(null, "Foobar", JsonLocation.NA);
2222
String msg = exc.getMessage();
@@ -41,7 +41,7 @@ public void testOriginalMesssage()
4141

4242
// [core#198]
4343
@Test
44-
public void testAccessToParser() throws Exception
44+
void accessToParser() throws Exception
4545
{
4646
JsonParser p = JSON_F.createParser("{}");
4747
assertToken(JsonToken.START_OBJECT, p.nextToken());
@@ -57,7 +57,7 @@ public void testAccessToParser() throws Exception
5757

5858
// [core#198]
5959
@Test
60-
public void testAccessToGenerator() throws Exception
60+
void accessToGenerator() throws Exception
6161
{
6262
StringWriter w = new StringWriter();
6363
JsonGenerator g = JSON_F.createGenerator(w);
@@ -70,13 +70,13 @@ public void testAccessToGenerator() throws Exception
7070

7171
// [core#281]: new eof exception
7272
@Test
73-
public void testEofExceptionsBytes() throws Exception {
73+
void eofExceptionsBytes() throws Exception {
7474
_testEofExceptions(MODE_INPUT_STREAM);
7575
}
7676

7777
// [core#281]: new eof exception
7878
@Test
79-
public void testEofExceptionsChars() throws Exception {
79+
void eofExceptionsChars() throws Exception {
8080
_testEofExceptions(MODE_READER);
8181
}
8282

@@ -132,7 +132,7 @@ private void _testEofExceptions(int mode) throws Exception
132132
}
133133

134134
@Test
135-
public void testContentSnippetWithOffset() throws Exception
135+
void contentSnippetWithOffset() throws Exception
136136
{
137137
final JsonFactory jsonF = streamFactoryBuilder()
138138
.enable(StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION)

src/test/java/com/fasterxml/jackson/core/JDKSerializabilityTest.java

+15-15
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
/**
1515
* Unit tests for [core#31] (https://github.com/FasterXML/jackson-core/issues/31)
1616
*/
17-
public class JDKSerializabilityTest
18-
extends JUnit5TestBase
17+
class JDKSerializabilityTest
18+
extends JUnit5TestBase
1919
{
2020
/*
2121
/**********************************************************************
@@ -24,7 +24,7 @@ public class JDKSerializabilityTest
2424
*/
2525

2626
@Test
27-
public void testJsonFactorySerializable() throws Exception
27+
void jsonFactorySerializable() throws Exception
2828
{
2929
JsonFactory f = new JsonFactory();
3030
String origJson = "{\"simple\":[1,true,{}]}";
@@ -47,7 +47,7 @@ public void testJsonFactorySerializable() throws Exception
4747
*/
4848

4949
@Test
50-
public void testBase64Variant() throws Exception
50+
void base64Variant() throws Exception
5151
{
5252
{
5353
Base64Variant orig = Base64Variants.PEM;
@@ -65,8 +65,8 @@ public void testBase64Variant() throws Exception
6565
Base64Variant mod = orig.withWritePadding(true);
6666
assertTrue(mod.usesPadding());
6767
assertNotSame(orig, mod);
68-
assertFalse(orig.equals(mod));
69-
assertFalse(mod.equals(orig));
68+
assertNotEquals(orig, mod);
69+
assertNotEquals(mod, orig);
7070

7171
final String exp = _encodeBase64(mod);
7272
byte[] stuff = jdkSerialize(mod);
@@ -79,7 +79,7 @@ public void testBase64Variant() throws Exception
7979
}
8080

8181
@Test
82-
public void testPrettyPrinter() throws Exception
82+
void prettyPrinter() throws Exception
8383
{
8484
PrettyPrinter p = new DefaultPrettyPrinter();
8585
byte[] stuff = jdkSerialize(p);
@@ -89,7 +89,7 @@ public void testPrettyPrinter() throws Exception
8989
}
9090

9191
@Test
92-
public void testLocation() throws Exception
92+
void location() throws Exception
9393
{
9494
JsonFactory jf = new JsonFactory();
9595
JsonParser jp = jf.createParser(" { }");
@@ -106,7 +106,7 @@ public void testLocation() throws Exception
106106
}
107107

108108
@Test
109-
public void testSourceReference() throws Exception
109+
void sourceReference() throws Exception
110110
{
111111
ContentReference ref = ContentReference.construct(true, "text",
112112
ErrorReportConfiguration.defaults());
@@ -124,7 +124,7 @@ public void testSourceReference() throws Exception
124124
*/
125125

126126
@Test
127-
public void testRecyclerPools() throws Exception
127+
void recyclerPools() throws Exception
128128
{
129129
// First: shared/global pools that will always remain/become globally
130130
// shared instances
@@ -160,15 +160,15 @@ private <T extends RecyclerPool<?>> T _testRecyclerPoolNonShared(T pool) throws
160160
assertNotSame(pool, result);
161161
return result;
162162
}
163-
163+
164164
/*
165165
/**********************************************************************
166166
/* Exception types
167167
/**********************************************************************
168168
*/
169169

170170
@Test
171-
public void testParseException() throws Exception
171+
void parseException() throws Exception
172172
{
173173
JsonFactory jf = new JsonFactory();
174174
JsonParser p = jf.createParser(" { garbage! }");
@@ -187,7 +187,7 @@ public void testParseException() throws Exception
187187
}
188188

189189
@Test
190-
public void testGenerationException() throws Exception
190+
void generationException() throws Exception
191191
{
192192
JsonFactory jf = new JsonFactory();
193193
JsonGenerator g = jf.createGenerator(new ByteArrayOutputStream());
@@ -212,7 +212,7 @@ public void testGenerationException() throws Exception
212212
*/
213213

214214
@Test
215-
public void testPointerSerializationNonEmpty() throws Exception
215+
void pointerSerializationNonEmpty() throws Exception
216216
{
217217
// First, see that we can write and read a general JsonPointer
218218
final String INPUT = "/Image/15/name";
@@ -243,7 +243,7 @@ public void testPointerSerializationNonEmpty() throws Exception
243243
}
244244

245245
@Test
246-
public void testPointerSerializationEmpty() throws Exception
246+
void pointerSerializationEmpty() throws Exception
247247
{
248248
// and then verify that "empty" instance gets canonicalized
249249
final JsonPointer emptyP = JsonPointer.empty();

src/test/java/com/fasterxml/jackson/core/JUnit5TestBase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import static org.junit.jupiter.api.Assertions.fail;
1616

1717
/**
18-
* Intended replacement for {@link BaseTest}
18+
* Replacement of JUnit4-based {@code BaseTest}
1919
*/
2020
public class JUnit5TestBase
2121
{

0 commit comments

Comments
 (0)