Skip to content

Commit 61ab40c

Browse files
committed
Upgraded to Commons FileUpload 1.3.1, TestNG 6.8.7, Hibernate 4.2.8, Joda-Time 2.2, Jackson 1.7.9
1 parent 3da9a31 commit 61ab40c

File tree

8 files changed

+112
-133
lines changed

8 files changed

+112
-133
lines changed

build.gradle

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ configure(allprojects) { project ->
1717
// "Class not found: javac1.8" issue with Ant versions prior to 1.9.x
1818
ant.properties["build.compiler"] = "javac1.7"
1919

20-
ext.aspectjVersion = "1.7.2"
20+
ext.aspectjVersion = "1.7.4"
2121
ext.hsqldbVersion = "1.8.0.10"
2222
ext.junitVersion = "4.11"
2323
ext.slf4jVersion = "1.6.6"
@@ -328,11 +328,11 @@ project("spring-context") {
328328
optional("javax.persistence:persistence-api:1.0")
329329
optional("javax.validation:validation-api:1.0.0.GA")
330330
optional("org.hibernate:hibernate-validator:4.3.1.Final")
331-
optional("joda-time:joda-time:2.1")
331+
optional("joda-time:joda-time:2.2")
332332
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
333333
optional("org.codehaus.groovy:groovy-all:1.8.9")
334334
optional("org.beanshell:bsh:2.0b4")
335-
optional("org.jruby:jruby:1.7.2")
335+
optional("org.jruby:jruby:1.7.10")
336336
testCompile("javax.inject:javax.inject-tck:1")
337337
testCompile("commons-dbcp:commons-dbcp:1.3")
338338
testCompile("org.slf4j:slf4j-api:${slf4jVersion}")
@@ -406,7 +406,7 @@ project("spring-jms") {
406406
optional("aopalliance:aopalliance:1.0")
407407
optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
408408
optional("javax.resource:connector-api:1.5")
409-
optional("org.codehaus.jackson:jackson-mapper-asl:1.4.5")
409+
optional("org.codehaus.jackson:jackson-mapper-asl:1.7.9")
410410
optional("com.fasterxml.jackson.core:jackson-databind:2.0.6")
411411
}
412412
}
@@ -444,7 +444,7 @@ project("spring-context-support") {
444444
optional("org.quartz-scheduler:quartz:1.7.3")
445445
optional("org.codehaus.fabric3.api:commonj:1.1.0")
446446
optional("velocity:velocity:1.5")
447-
optional("org.freemarker:freemarker:2.3.19")
447+
optional("org.freemarker:freemarker:2.3.20")
448448
optional("com.lowagie:itext:2.1.7")
449449
optional("jasperreports:jasperreports:2.0.5")
450450
testCompile("org.apache.poi:poi:3.0.2-FINAL")
@@ -477,11 +477,11 @@ project("spring-web") {
477477
optional("javax.xml.soap:saaj-api:1.3")
478478
optional("aopalliance:aopalliance:1.0")
479479
optional("com.caucho:hessian:3.2.1")
480-
optional("commons-fileupload:commons-fileupload:1.2.2")
480+
optional("commons-fileupload:commons-fileupload:1.3.1")
481481
optional("commons-io:commons-io:1.3")
482482
optional("commons-httpclient:commons-httpclient:3.1")
483-
optional("org.apache.httpcomponents:httpclient:4.2")
484-
optional("org.codehaus.jackson:jackson-mapper-asl:1.4.5")
483+
optional("org.apache.httpcomponents:httpclient:4.2.6")
484+
optional("org.codehaus.jackson:jackson-mapper-asl:1.7.9")
485485
optional("com.fasterxml.jackson.core:jackson-databind:2.0.6")
486486
optional("rome:rome:1.0")
487487
optional("taglibs:standard:1.1.2")
@@ -547,8 +547,8 @@ project("spring-orm-hibernate4") {
547547
provided(project(":spring-jdbc"))
548548
provided(project(":spring-tx"))
549549
optional(project(":spring-web"))
550-
optional("org.hibernate:hibernate-core:4.1.9.Final")
551-
optional("org.hibernate:hibernate-entitymanager:4.1.9.Final")
550+
optional("org.hibernate:hibernate-core:4.2.8.Final")
551+
optional("org.hibernate:hibernate-entitymanager:4.2.8.Final")
552552
optional("javax.servlet:servlet-api:2.5")
553553
}
554554
}
@@ -567,16 +567,16 @@ project("spring-webmvc") {
567567
optional(project(":spring-oxm")) // for MarshallingView
568568
optional("javax.servlet.jsp:jsp-api:2.1")
569569
optional("javax.servlet:jstl:1.2")
570-
optional("net.sourceforge.jexcelapi:jxl:2.6.3")
570+
optional("net.sourceforge.jexcelapi:jxl:2.6.12")
571571
optional("org.apache.poi:poi:3.0.2-FINAL")
572572
optional("velocity:velocity:1.5")
573573
optional("velocity-tools:velocity-tools-view:1.4")
574-
optional("org.freemarker:freemarker:2.3.19")
574+
optional("org.freemarker:freemarker:2.3.20")
575575
optional("com.lowagie:itext:2.1.7")
576576
optional("jasperreports:jasperreports:2.0.5") {
577577
exclude group: "xml-apis", module: "xml-apis"
578578
}
579-
optional("org.codehaus.jackson:jackson-mapper-asl:1.4.5")
579+
optional("org.codehaus.jackson:jackson-mapper-asl:1.7.9")
580580
optional("com.fasterxml.jackson.core:jackson-databind:2.0.6")
581581
optional("rome:rome:1.0")
582582
optional("org.apache.tiles:tiles-api:2.1.2")
@@ -602,8 +602,8 @@ project("spring-webmvc") {
602602
}
603603
testCompile("javax.validation:validation-api:1.0.0.GA")
604604
testCompile("org.hibernate:hibernate-validator:4.3.1.Final")
605-
testCompile("org.apache.httpcomponents:httpclient:4.2")
606-
testCompile("commons-fileupload:commons-fileupload:1.2.2")
605+
testCompile("org.apache.httpcomponents:httpclient:4.2.6")
606+
testCompile("commons-fileupload:commons-fileupload:1.3.1")
607607
testCompile("commons-io:commons-io:1.3")
608608
testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
609609
}
@@ -656,7 +656,7 @@ project("spring-webmvc-portlet") {
656656
compile(project(":spring-webmvc"))
657657
provided("javax.servlet:servlet-api:2.5")
658658
provided("javax.portlet:portlet-api:2.0")
659-
optional("commons-fileupload:commons-fileupload:1.2.2")
659+
optional("commons-fileupload:commons-fileupload:1.3.1")
660660
}
661661

662662
// pick up DispatcherPortlet.properties in src/main
@@ -678,7 +678,7 @@ project("spring-test") {
678678
optional(project(":spring-webmvc"))
679679
optional(project(":spring-webmvc-portlet"))
680680
optional("junit:junit:${junitVersion}")
681-
optional("org.testng:testng:6.5.2")
681+
optional("org.testng:testng:6.8.7")
682682
optional("javax.inject:javax.inject:1")
683683
optional("javax.servlet:servlet-api:2.5")
684684
optional("javax.servlet.jsp:jsp-api:2.1")
@@ -732,7 +732,7 @@ project("spring-test-mvc") {
732732
testCompile("javax.mail:mail:1.4.7")
733733
testCompile("org.hibernate:hibernate-validator:4.3.1.Final")
734734
testCompile("com.thoughtworks.xstream:xstream:1.3.1")
735-
testCompile("org.codehaus.jackson:jackson-mapper-asl:1.4.5")
735+
testCompile("org.codehaus.jackson:jackson-mapper-asl:1.7.9")
736736
testCompile("com.fasterxml.jackson.core:jackson-databind:2.0.6")
737737
testCompile("rome:rome:1.0")
738738
testCompile("org.apache.tiles:tiles-request-api:1.0.1")
@@ -865,7 +865,7 @@ configure(rootProject) {
865865
testCompile("javax.inject:javax.inject:1")
866866
testCompile("javax.resource:connector-api:1.5")
867867
testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
868-
testCompile("org.hibernate:hibernate-core:4.1.9.Final")
868+
testCompile("org.hibernate:hibernate-core:4.2.8.Final")
869869
testCompile("hsqldb:hsqldb:${hsqldbVersion}")
870870
}
871871

@@ -899,7 +899,7 @@ configure(rootProject) {
899899

900900
doFirst {
901901
classpath = files(
902-
// ensure Servlet 3.x and Hibernate 4.x have precedence on the Javadoc
902+
// ensure Servlet 3.x and Hibernate 4.x have precedence on the javadoc
903903
// classpath over their respective 2.5 and 3.x variants
904904
project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
905905
rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },

spring-context/src/test/java/org/springframework/format/datetime/joda/JodaTimeFormattingTests.java

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
package org.springframework.format.datetime.joda;
1818

19-
import static org.hamcrest.Matchers.equalTo;
20-
import static org.junit.Assert.assertEquals;
21-
import static org.junit.Assert.assertNotNull;
22-
import static org.junit.Assert.assertThat;
23-
2419
import java.util.ArrayList;
2520
import java.util.Calendar;
2621
import java.util.Date;
@@ -37,6 +32,7 @@
3732
import org.junit.After;
3833
import org.junit.Before;
3934
import org.junit.Test;
35+
4036
import org.springframework.beans.MutablePropertyValues;
4137
import org.springframework.context.i18n.LocaleContextHolder;
4238
import org.springframework.core.convert.TypeDescriptor;
@@ -46,6 +42,9 @@
4642
import org.springframework.format.support.FormattingConversionService;
4743
import org.springframework.validation.DataBinder;
4844

45+
import static org.hamcrest.Matchers.*;
46+
import static org.junit.Assert.*;
47+
4948
/**
5049
* @author Keith Donald
5150
* @author Juergen Hoeller
@@ -236,21 +235,10 @@ public void testBindLocalDateTime() {
236235
@Test
237236
public void testBindLocalDateTimeAnnotated() {
238237
MutablePropertyValues propertyValues = new MutablePropertyValues();
239-
propertyValues.add("localDateTimeAnnotated", "Saturday, October 31, 2009 12:00:00 PM ");
238+
propertyValues.add("localDateTimeAnnotated", "Oct 31, 2009 12:00 PM");
240239
binder.bind(propertyValues);
241240
assertEquals(0, binder.getBindingResult().getErrorCount());
242-
assertEquals("Saturday, October 31, 2009 12:00:00 PM ", binder.getBindingResult().getFieldValue(
243-
"localDateTimeAnnotated"));
244-
}
245-
246-
@Test
247-
public void testBindLocalDateTimeAnnotatedLong() {
248-
MutablePropertyValues propertyValues = new MutablePropertyValues();
249-
propertyValues.add("localDateTimeAnnotatedLong", "October 31, 2009 12:00:00 PM ");
250-
binder.bind(propertyValues);
251-
assertEquals(0, binder.getBindingResult().getErrorCount());
252-
assertEquals("October 31, 2009 12:00:00 PM ", binder.getBindingResult().getFieldValue(
253-
"localDateTimeAnnotatedLong"));
241+
assertEquals("Oct 31, 2009 12:00 PM", binder.getBindingResult().getFieldValue("localDateTimeAnnotated"));
254242
}
255243

256244
@Test
@@ -510,12 +498,9 @@ private static class JodaTimeBean {
510498

511499
private LocalDateTime localDateTime;
512500

513-
@DateTimeFormat(style="FF")
501+
@DateTimeFormat(style="MS")
514502
private LocalDateTime localDateTimeAnnotated;
515503

516-
@DateTimeFormat(style="LL")
517-
private LocalDateTime localDateTimeAnnotatedLong;
518-
519504
private DateTime dateTime;
520505

521506
@DateTimeFormat(style="MS")
@@ -612,14 +597,6 @@ public void setLocalDateTimeAnnotated(LocalDateTime localDateTimeAnnotated) {
612597
this.localDateTimeAnnotated = localDateTimeAnnotated;
613598
}
614599

615-
public LocalDateTime getLocalDateTimeAnnotatedLong() {
616-
return localDateTimeAnnotatedLong;
617-
}
618-
619-
public void setLocalDateTimeAnnotatedLong(LocalDateTime localDateTimeAnnotatedLong) {
620-
this.localDateTimeAnnotatedLong = localDateTimeAnnotatedLong;
621-
}
622-
623600
public DateTime getDateTime() {
624601
return dateTime;
625602
}

spring-jms/src/main/java/org/springframework/jms/support/converter/MappingJacksonMessageConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.springframework.util.ClassUtils;
3939

4040
/**
41-
* Message converter that uses the Jackson library to convert messages to and from JSON.
41+
* Message converter that uses Jackson 1.x to convert messages to and from JSON.
4242
* Maps an object to a {@link BytesMessage}, or to a {@link TextMessage} if the
4343
* {@link #setTargetType targetType} is set to {@link MessageType#TEXT}.
4444
* Converts from a {@link TextMessage} or {@link BytesMessage} to an object.

spring-jms/src/test/java/org/springframework/jms/support/converter/MappingJacksonMessageConverterTests.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
1818

1919
import java.io.ByteArrayInputStream;
2020
import java.util.Collections;
21+
import java.util.Date;
2122
import java.util.HashMap;
2223
import java.util.Map;
2324

@@ -27,6 +28,7 @@
2728

2829
import org.junit.Before;
2930
import org.junit.Test;
31+
3032
import org.mockito.invocation.InvocationOnMock;
3133
import org.mockito.stubbing.Answer;
3234

@@ -43,6 +45,7 @@ public class MappingJacksonMessageConverterTests {
4345

4446
private Session sessionMock;
4547

48+
4649
@Before
4750
public void setUp() throws Exception {
4851
sessionMock = mock(Session.class);
@@ -51,36 +54,34 @@ public void setUp() throws Exception {
5154
converter.setTypeIdPropertyName("__typeid__");
5255
}
5356

57+
5458
@Test
5559
public void toBytesMessage() throws Exception {
5660
BytesMessage bytesMessageMock = mock(BytesMessage.class);
57-
Object toBeMarshalled = new Object();
61+
Date toBeMarshalled = new Date();
5862

5963
given(sessionMock.createBytesMessage()).willReturn(bytesMessageMock);
6064

6165
converter.toMessage(toBeMarshalled, sessionMock);
6266

6367
verify(bytesMessageMock).setStringProperty("__encoding__", "UTF-8");
64-
verify(bytesMessageMock).setStringProperty("__typeid__", Object.class.getName());
68+
verify(bytesMessageMock).setStringProperty("__typeid__", Date.class.getName());
6569
verify(bytesMessageMock).writeBytes(isA(byte[].class));
6670
}
6771

6872
@Test
69-
@SuppressWarnings("serial")
7073
public void fromBytesMessage() throws Exception {
7174
BytesMessage bytesMessageMock = mock(BytesMessage.class);
7275
Map<String, String> unmarshalled = Collections.singletonMap("foo", "bar");
7376

7477
byte[] bytes = "{\"foo\":\"bar\"}".getBytes();
7578
final ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes);
7679

77-
given(bytesMessageMock.getStringProperty("__typeid__")).willReturn(
78-
Object.class.getName());
80+
given(bytesMessageMock.getStringProperty("__typeid__")).willReturn(Object.class.getName());
7981
given(bytesMessageMock.propertyExists("__encoding__")).willReturn(false);
8082
given(bytesMessageMock.getBodyLength()).willReturn(new Long(bytes.length));
8183
given(bytesMessageMock.readBytes(any(byte[].class))).willAnswer(
8284
new Answer<Integer>() {
83-
8485
@Override
8586
public Integer answer(InvocationOnMock invocation) throws Throwable {
8687
return byteStream.read((byte[]) invocation.getArguments()[0]);
@@ -95,13 +96,12 @@ public Integer answer(InvocationOnMock invocation) throws Throwable {
9596
public void toTextMessageWithObject() throws Exception {
9697
converter.setTargetType(MessageType.TEXT);
9798
TextMessage textMessageMock = mock(TextMessage.class);
98-
Object toBeMarshalled = new Object();
99+
Date toBeMarshalled = new Date();
99100

100-
given(sessionMock.createTextMessage(isA(String.class))).willReturn(
101-
textMessageMock);
101+
given(sessionMock.createTextMessage(isA(String.class))).willReturn(textMessageMock);
102102

103103
converter.toMessage(toBeMarshalled, sessionMock);
104-
verify(textMessageMock).setStringProperty("__typeid__", Object.class.getName());
104+
verify(textMessageMock).setStringProperty("__typeid__", Date.class.getName());
105105
}
106106

107107
@Test
@@ -110,11 +110,10 @@ public void toTextMessageWithMap() throws Exception {
110110
TextMessage textMessageMock = mock(TextMessage.class);
111111
Map<String, String> toBeMarshalled = new HashMap<String, String>();
112112
toBeMarshalled.put("foo", "bar");
113-
given(sessionMock.createTextMessage(isA(String.class))).willReturn(
114-
textMessageMock);
115113

116-
converter.toMessage(toBeMarshalled, sessionMock);
114+
given(sessionMock.createTextMessage(isA(String.class))).willReturn(textMessageMock);
117115

116+
converter.toMessage(toBeMarshalled, sessionMock);
118117
verify(textMessageMock).setStringProperty("__typeid__", HashMap.class.getName());
119118
}
120119

@@ -124,8 +123,7 @@ public void fromTextMessageAsObject() throws Exception {
124123
Map<String, String> unmarshalled = Collections.singletonMap("foo", "bar");
125124

126125
String text = "{\"foo\":\"bar\"}";
127-
given(textMessageMock.getStringProperty("__typeid__")).willReturn(
128-
Object.class.getName());
126+
given(textMessageMock.getStringProperty("__typeid__")).willReturn(Object.class.getName());
129127
given(textMessageMock.getText()).willReturn(text);
130128

131129
Object result = converter.fromMessage(textMessageMock);
@@ -138,11 +136,11 @@ public void fromTextMessageAsMap() throws Exception {
138136
Map<String, String> unmarshalled = Collections.singletonMap("foo", "bar");
139137

140138
String text = "{\"foo\":\"bar\"}";
141-
given(textMessageMock.getStringProperty("__typeid__")).willReturn(
142-
HashMap.class.getName());
139+
given(textMessageMock.getStringProperty("__typeid__")).willReturn(HashMap.class.getName());
143140
given(textMessageMock.getText()).willReturn(text);
144141

145142
Object result = converter.fromMessage(textMessageMock);
146143
assertEquals("Invalid result", result, unmarshalled);
147144
}
145+
148146
}

0 commit comments

Comments
 (0)