diff options
author | 2018-09-11 11:39:12 -0400 | |
---|---|---|
committer | 2018-09-11 11:42:19 -0400 | |
commit | 69135296d0c23ad73efb813e56da65cf309c5986 (patch) | |
tree | b29823f2c0b978327d892e87c844dcd2d28acc72 /glance-model/src/test/java/com/woorea/openstack | |
parent | 7f05d1c3f153e89fa78c2bb97b950e42f6b30b38 (diff) |
Use fasterxml jackson implementation in so/libs
NexusIQ issue: org.codehaus.jackson
This commit changes so/libs from the old codehaus jackson
implementation to the fasterxml implementation.
2.8.10 is the latest version compatible with the 1.5.13.RELEASE
springboot version used in SO.
Change-Id: I3b1167dd0efeb3463efb7e01fac26d0f312d7aad
Issue-ID: SO-864
Signed-off-by: Rob Daugherty <rd472p@att.com>
Diffstat (limited to 'glance-model/src/test/java/com/woorea/openstack')
6 files changed, 62 insertions, 58 deletions
diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMemberTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMemberTest.java index 155aac0..e8323d9 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMemberTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMemberTest.java @@ -20,11 +20,11 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.ImageMember; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -40,9 +40,10 @@ public class ImageMemberTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMembersTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMembersTest.java index 0b9e94c..513791a 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMembersTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageMembersTest.java @@ -20,13 +20,13 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.ImageMember; -import com.woorea.openstack.glance.model.ImageMembers; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import java.util.List; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -47,9 +47,10 @@ public class ImageMembersTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageTest.java index 4e54413..8e8914c 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImageTest.java @@ -20,13 +20,14 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.Image; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import java.util.Calendar; import java.util.Map; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -65,11 +66,12 @@ public class ImageTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(SerializationConfig.Feature.WRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(SerializationFeature.WRAP_ROOT_VALUE) + .enable(DeserializationFeature.UNWRAP_ROOT_VALUE) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImagesTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImagesTest.java index 913fa01..1ba0907 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/ImagesTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/ImagesTest.java @@ -20,13 +20,13 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.Image; -import com.woorea.openstack.glance.model.Images; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import java.util.List; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -89,9 +89,10 @@ public class ImagesTest { + "}"; private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImageTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImageTest.java index f1348ee..41805cb 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImageTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImageTest.java @@ -20,28 +20,26 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.SharedImage; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; -import org.junit.Assert; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; public class SharedImageTest { - private static final String EOL = System.lineSeparator(); - private static final String JSON_FULL = "{ }"; // FAIL_ON_EMPTY_BEANS set to false to conform to legacy behavior private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { diff --git a/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImagesTest.java b/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImagesTest.java index f888fb2..7695f54 100644 --- a/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImagesTest.java +++ b/glance-model/src/test/java/com/woorea/openstack/glance/model/SharedImagesTest.java @@ -20,13 +20,13 @@ package com.woorea.openstack.glance.model; -import com.woorea.openstack.glance.model.SharedImage; -import com.woorea.openstack.glance.model.SharedImages; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + import java.util.List; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; + import org.junit.Assert; import org.junit.Test; import org.skyscreamer.jsonassert.JSONAssert; @@ -42,10 +42,11 @@ public class SharedImagesTest { // FAIL_ON_EMPTY_BEANS set to false to conform to legacy behavior private ObjectMapper objectMapper = new ObjectMapper() - .setSerializationInclusion(Inclusion.NON_NULL) - .enable(SerializationConfig.Feature.INDENT_OUTPUT) - .disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) - .enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + .setSerializationInclusion(Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); @Test public void testSerialization() throws Exception { |