Skip to content

Commit

Permalink
Merge branch '2.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 26, 2023
2 parents 3d73290 + 51acb5a commit 872ba22
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions src/test/java/tools/jackson/core/testsupport/TestSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,40 @@

/**
* Container for various factories needed by (unit) tests.
*
* @since 2.16
*/
public class TestSupport
{
/**
* Factory method for creating {@link IOContext}s for tests
*/
public static IOContext testIOContext() {
return new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(),
ErrorReportConfiguration.defaults(),
new BufferRecycler(), ContentReference.unknown(), false,
JsonEncoding.UTF8);
return testIOContext(StreamReadConstraints.defaults(),
StreamWriteConstraints.defaults(),
ErrorReportConfiguration.defaults());
}

/**
* Factory method for creating {@link IOContext}s for tests
*/
public static IOContext testIOContext(StreamReadConstraints src) {
return testIOContext(src,
StreamWriteConstraints.defaults(),
ErrorReportConfiguration.defaults());
}

/**
* Factory method for creating {@link IOContext}s for tests
*/
public static IOContext testIOContext(StreamWriteConstraints swc) {
return new IOContext(StreamReadConstraints.defaults(), swc,
ErrorReportConfiguration.defaults(),
return testIOContext(StreamReadConstraints.defaults(),
swc,
ErrorReportConfiguration.defaults());
}

private static IOContext testIOContext(StreamReadConstraints src,
StreamWriteConstraints swc,
ErrorReportConfiguration erc) {
return new IOContext(src, swc, erc,
new BufferRecycler(), ContentReference.unknown(), false,
JsonEncoding.UTF8);
}
Expand Down

0 comments on commit 872ba22

Please sign in to comment.