Skip to content

Commit

Permalink
Remove hard-coded StreamReadConstraints test variables to isolate c…
Browse files Browse the repository at this point in the history
…hange in `jackson-core` itself (FasterXML#3930)
  • Loading branch information
JooHyukKim committed May 15, 2023
1 parent 6f81a4e commit e5bdcfb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class DeepJsonNodeDeser3397Test extends BaseMapTest
// ... currently gets a bit slow at 1M but passes.
// But test with 100k as practical limit, to guard against regression
// private final static int TOO_DEEP_NESTING = 1_000_000;
private final static int TOO_DEEP_NESTING = 10_000;
private final static int TOO_DEEP_NESTING = StreamReadConstraints.DEFAULT_MAX_DEPTH * 10;

private final JsonFactory jsonFactory = JsonFactory.builder()
.streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class DeepNestingUntypedDeserTest extends BaseMapTest
// 31-May-2022, tatu: But no more! Can handle much much larger
// nesting levels, bounded by memory usage not stack. Tested with
// 1 million (!) nesting levels, but to keep tests fast use 100k
private final static int TOO_DEEP_NESTING = 100_000;
private final static int TOO_DEEP_NESTING = StreamReadConstraints.DEFAULT_MAX_DEPTH * 100;

private final JsonFactory jsonFactory = JsonFactory.builder()
.streamReadConstraints(StreamReadConstraints.builder().maxNestingDepth(Integer.MAX_VALUE).build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void setString(String string) {
/**********************************************************************
*/

private final static int TOO_LONG_STRING_VALUE = 20_100_000;
private final static int TOO_LONG_STRING_VALUE = StreamReadConstraints.DEFAULT_MAX_STRING_LEN + 100;

private final ObjectMapper MAPPER = newJsonMapper();

Expand Down

0 comments on commit e5bdcfb

Please sign in to comment.