File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
src/test/java/com/fasterxml/jackson/databind Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ public void testProviderConfig() throws Exception
150
150
assertEquals (4 , m ._deserializationContext ._cache .cachedDeserializersCount ());
151
151
}
152
152
153
- // [Issue #28]: ObjectMapper.copy()
153
+ // [databind #28]: ObjectMapper.copy()
154
154
public void testCopy () throws Exception
155
155
{
156
156
ObjectMapper m = new ObjectMapper ();
@@ -263,4 +263,22 @@ public void testEmptyBeanSerializability()
263
263
assertTrue (MAPPER .writer ().without (SerializationFeature .FAIL_ON_EMPTY_BEANS )
264
264
.canSerialize (EmptyBean .class ));
265
265
}
266
+
267
+ // for [databind#1074]
268
+ public void testCopyOfParserFeatures () throws Exception
269
+ {
270
+ // ensure we have "fresh" instance to start with
271
+ ObjectMapper mapper = new ObjectMapper ();
272
+ assertFalse (mapper .isEnabled (JsonParser .Feature .ALLOW_COMMENTS ));
273
+ mapper .configure (JsonParser .Feature .ALLOW_COMMENTS , true );
274
+ assertTrue (mapper .isEnabled (JsonParser .Feature .ALLOW_COMMENTS ));
275
+
276
+ ObjectMapper copy = mapper .copy ();
277
+ assertTrue (copy .isEnabled (JsonParser .Feature .ALLOW_COMMENTS ));
278
+
279
+ // also verify there's no back-linkage
280
+ copy .configure (JsonParser .Feature .ALLOW_COMMENTS , false );
281
+ assertFalse (copy .isEnabled (JsonParser .Feature .ALLOW_COMMENTS ));
282
+ assertTrue (mapper .isEnabled (JsonParser .Feature .ALLOW_COMMENTS ));
283
+ }
266
284
}
You can’t perform that action at this time.
0 commit comments