Browse Source

Upgrade to Jackson 2.8 RC1, Undertow 1.4 CR1, Netty 4.1.1

Issue: SPR-14340
Issue: SPR-14328
Issue: SPR-14143
pull/1073/merge
Juergen Hoeller 9 years ago
parent
commit
8fc84e2d6f
  1. 6
      build.gradle
  2. 10
      spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilderTests.java
  3. 3
      spring-web/src/test/java/org/springframework/http/converter/json/SpringHandlerInstantiatorTests.java

6
build.gradle

@ -52,7 +52,7 @@ configure(allprojects) { project ->
ext.hsqldbVersion = "2.3.4" ext.hsqldbVersion = "2.3.4"
ext.httpasyncVersion = "4.1.1" ext.httpasyncVersion = "4.1.1"
ext.httpclientVersion = "4.5.2" ext.httpclientVersion = "4.5.2"
ext.jackson2Version = "2.7.4" ext.jackson2Version = "2.8.0.rc1"
ext.jasperreportsVersion = "6.2.1" ext.jasperreportsVersion = "6.2.1"
ext.javamailVersion = "1.5.5" ext.javamailVersion = "1.5.5"
ext.jettyVersion = "9.3.9.v20160517" ext.jettyVersion = "9.3.9.v20160517"
@ -60,7 +60,7 @@ configure(allprojects) { project ->
ext.jrubyVersion = "1.7.25" // JRuby 9000 only supported through JSR-223 (StandardScriptFactory) ext.jrubyVersion = "1.7.25" // JRuby 9000 only supported through JSR-223 (StandardScriptFactory)
ext.jtaVersion = "1.2" ext.jtaVersion = "1.2"
ext.junitVersion = "4.12" ext.junitVersion = "4.12"
ext.nettyVersion = "4.1.0.Final" ext.nettyVersion = "4.1.1.Final"
ext.okhttpVersion = "2.7.5" ext.okhttpVersion = "2.7.5"
ext.okhttp3Version = "3.3.1" ext.okhttp3Version = "3.3.1"
ext.openjpaVersion = "2.4.1" ext.openjpaVersion = "2.4.1"
@ -75,7 +75,7 @@ configure(allprojects) { project ->
ext.tiles3Version = "3.0.5" ext.tiles3Version = "3.0.5"
ext.tomcatVersion = "8.5.2" ext.tomcatVersion = "8.5.2"
ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support ext.tyrusVersion = "1.3.5" // constrained by WebLogic 12.1.3 support
ext.undertowVersion = "1.4.0.Beta1" ext.undertowVersion = "1.4.0.CR1"
ext.xmlunitVersion = "1.6" ext.xmlunitVersion = "1.6"
ext.xstreamVersion = "1.4.9" ext.xstreamVersion = "1.4.9"

10
spring-web/src/test/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilderTests.java

@ -64,7 +64,6 @@ import com.fasterxml.jackson.databind.ser.std.ClassSerializer;
import com.fasterxml.jackson.databind.ser.std.NumberSerializer; import com.fasterxml.jackson.databind.ser.std.NumberSerializer;
import com.fasterxml.jackson.databind.type.SimpleType; import com.fasterxml.jackson.databind.type.SimpleType;
import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import kotlin.ranges.IntRange; import kotlin.ranges.IntRange;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
@ -253,7 +252,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertEquals(timestamp.toString(), new String(objectMapper.writeValueAsBytes(dateTime), "UTF-8")); assertEquals(timestamp.toString(), new String(objectMapper.writeValueAsBytes(dateTime), "UTF-8"));
Path file = Paths.get("foo"); Path file = Paths.get("foo");
assertEquals("\"foo\"", new String(objectMapper.writeValueAsBytes(file), "UTF-8")); assertTrue(new String(objectMapper.writeValueAsBytes(file), "UTF-8").endsWith("foo\""));
Optional<String> optional = Optional.of("test"); Optional<String> optional = Optional.of("test");
assertEquals("\"test\"", new String(objectMapper.writeValueAsBytes(optional), "UTF-8")); assertEquals("\"test\"", new String(objectMapper.writeValueAsBytes(optional), "UTF-8"));
@ -263,7 +262,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertEquals("{\"start\":1,\"end\":3}", new String(objectMapper.writeValueAsBytes(range), "UTF-8")); assertEquals("{\"start\":1,\"end\":3}", new String(objectMapper.writeValueAsBytes(range), "UTF-8"));
} }
@Test // SPR-12634 @Test // SPR-12634
public void customizeWellKnownModulesWithModule() throws JsonProcessingException, UnsupportedEncodingException { public void customizeWellKnownModulesWithModule() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json() ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
.modulesToInstall(new CustomIntegerModule()).build(); .modulesToInstall(new CustomIntegerModule()).build();
@ -272,7 +271,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid")); assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid"));
} }
@Test // SPR-12634 @Test // SPR-12634
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void customizeWellKnownModulesWithModuleClass() throws JsonProcessingException, UnsupportedEncodingException { public void customizeWellKnownModulesWithModuleClass() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(CustomIntegerModule.class).build(); ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json().modulesToInstall(CustomIntegerModule.class).build();
@ -281,7 +280,7 @@ public class Jackson2ObjectMapperBuilderTests {
assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid")); assertThat(new String(objectMapper.writeValueAsBytes(new Integer(4)), "UTF-8"), containsString("customid"));
} }
@Test // SPR-12634 @Test // SPR-12634
public void customizeWellKnownModulesWithSerializer() throws JsonProcessingException, UnsupportedEncodingException { public void customizeWellKnownModulesWithSerializer() throws JsonProcessingException, UnsupportedEncodingException {
ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json() ObjectMapper objectMapper = Jackson2ObjectMapperBuilder.json()
.serializerByType(Integer.class, new CustomIntegerSerializer()).build(); .serializerByType(Integer.class, new CustomIntegerSerializer()).build();
@ -520,6 +519,7 @@ public class Jackson2ObjectMapperBuilderTests {
} }
} }
public static class ListContainer<T> { public static class ListContainer<T> {
private List<T> list; private List<T> list;

3
spring-web/src/test/java/org/springframework/http/converter/json/SpringHandlerInstantiatorTests.java

@ -47,7 +47,6 @@ import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
import com.fasterxml.jackson.databind.jsontype.TypeSerializer; import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
import com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder; import com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder;
import com.fasterxml.jackson.databind.type.TypeFactory; import com.fasterxml.jackson.databind.type.TypeFactory;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -197,7 +196,7 @@ public class SpringHandlerInstantiatorTests {
return JsonTypeInfo.Id.CUSTOM; return JsonTypeInfo.Id.CUSTOM;
} }
@Override // Only needed when compiling against Jackson 2.7; gone in 2.8
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public JavaType typeFromId(String s) { public JavaType typeFromId(String s) {
return TypeFactory.defaultInstance().constructFromCanonical(s); return TypeFactory.defaultInstance().constructFromCanonical(s);

Loading…
Cancel
Save