org.springframework.security
diff --git a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/JaxbJacksonObjectMapper.java b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/JaxbJacksonObjectMapper.java
index 74bfe3b93..f1dd9d102 100644
--- a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/JaxbJacksonObjectMapper.java
+++ b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/JaxbJacksonObjectMapper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,10 +15,11 @@
*/
package org.springframework.integration.samples.rest.json;
-import org.codehaus.jackson.map.AnnotationIntrospector;
-import org.codehaus.jackson.map.DeserializationConfig;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
+import com.fasterxml.jackson.databind.AnnotationIntrospector;
+import com.fasterxml.jackson.databind.DeserializationConfig;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
+
/**
* JaxbJacksonObjectMapper.java: This is the custom JAXB JSON ObjectMapper
@@ -27,22 +28,26 @@
* http://hillert.blogspot.com/2011/01/marshal-json-data-using-jackson-in.html.
* I modified a little bit to use the latest {@link DeserializationConfig} API
* instead of deprecated ones.
- * *
+ *
+ * Updated to Jackson2.
+ *
* @author Vigil Bose
+ * @author Gary Russell
*/
+@SuppressWarnings("serial")
public class JaxbJacksonObjectMapper extends ObjectMapper {
/**
- * Annotation introspector to use for serialization process
+ * Annotation introspector to use for serialization process
* is configured separately for serialization and deserialization purposes
*/
public JaxbJacksonObjectMapper() {
final AnnotationIntrospector introspector
= new JacksonAnnotationIntrospector();
super.getDeserializationConfig()
- .withAnnotationIntrospector(introspector);
+ .with(introspector);
super.getSerializationConfig()
- .withAnnotationIntrospector(introspector);
-
+ .with(introspector);
+
}
}
diff --git a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/view/ExtendedMappingJacksonJsonView.java b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/view/ExtendedMappingJacksonJsonView.java
index 6c817c70a..8a47a2a63 100644
--- a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/view/ExtendedMappingJacksonJsonView.java
+++ b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/json/view/ExtendedMappingJacksonJsonView.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,17 +17,18 @@
import java.util.Map;
-import org.springframework.web.servlet.view.json.MappingJacksonJsonView;
+import org.springframework.web.servlet.view.json.MappingJackson2JsonView;
/**
* ExtendedMappingJacksonJsonView.java: This class extends the Spring's MappingJacksonJsonView
*
* Note: The source code for this class is taken from the forum posted by AhungerArtist
* at http://forum.springsource.org/archive/index.php/t-84006.html
- *
+ *
* @author Vigil Bose
+ * @author Gary Russell
*/
-public class ExtendedMappingJacksonJsonView extends MappingJacksonJsonView {
+public class ExtendedMappingJacksonJsonView extends MappingJackson2JsonView {
@SuppressWarnings({"rawtypes" })
@Override
@@ -36,10 +37,10 @@ protected Object filterModel(Map model){
if (!(result instanceof Map)){
return result;
}
-
+
Map map = (Map) result;
if (map.size() == 1){
- return map.values().toArray()[0];
+ return map.values().toArray()[0];
}
return map;
}
diff --git a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/service/EmployeeSearchService.java b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/service/EmployeeSearchService.java
index 88b42eadb..d618135b3 100644
--- a/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/service/EmployeeSearchService.java
+++ b/intermediate/rest-http/src/main/java/org/springframework/integration/samples/rest/service/EmployeeSearchService.java
@@ -19,9 +19,9 @@
import java.util.Map;
import org.apache.log4j.Logger;
-import org.springframework.integration.Message;
-import org.springframework.integration.MessageHeaders;
-import org.springframework.integration.message.GenericMessage;
+import org.springframework.messaging.Message;
+import org.springframework.messaging.MessageHeaders;
+import org.springframework.messaging.support.GenericMessage;
import org.springframework.integration.samples.rest.domain.Employee;
import org.springframework.integration.samples.rest.domain.EmployeeList;
import org.springframework.security.access.annotation.Secured;
diff --git a/intermediate/rest-http/src/main/resources/META-INF/spring/integration/applicationContext-http-int.xml b/intermediate/rest-http/src/main/resources/META-INF/spring/integration/applicationContext-http-int.xml
index 9f9a8ec21..1f8963c26 100644
--- a/intermediate/rest-http/src/main/resources/META-INF/spring/integration/applicationContext-http-int.xml
+++ b/intermediate/rest-http/src/main/resources/META-INF/spring/integration/applicationContext-http-int.xml
@@ -61,7 +61,7 @@
-
+
(EmployeeList.class, restTemplate.getMessageConverters());
-
+
Map properties = new HashMap();
properties.put(javax.xml.bind.Marshaller.JAXB_ENCODING, "UTF-8");
properties.put(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setMarshallerProperties(properties);
}
/**
- *
+ *
* @throws Exception
*/
@Test
@@ -107,21 +110,23 @@ private Map getEmployeeSearchMap(String id) {
employeeSearchMap.put("id", id);
return employeeSearchMap;
}
-
+
@Test
public void testGetEmployeeAsJson() throws Exception{
Map employeeSearchMap = getEmployeeSearchMap("0");
-
+
final String fullUrl = "http://localhost:8080/rest-http/services/employee/{id}/search?format=json";
HttpHeaders headers = getHttpHeadersWithUserCredentials(new HttpHeaders());
headers.add("Accept", "application/json");
HttpEntity request = new HttpEntity(headers);
-
+
ResponseEntity> httpResponse = restTemplate.exchange(fullUrl, HttpMethod.GET, request, EmployeeList.class, employeeSearchMap);
logger.info("Return Status :"+httpResponse.getHeaders().get("X-Return-Status"));
logger.info("Return Status Message :"+httpResponse.getHeaders().get("X-Return-Status-Msg"));
assertTrue(httpResponse.getStatusCode().equals(HttpStatus.OK));
- jaxbJacksonObjectMapper.writeValue(System.out, httpResponse.getBody());
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ jaxbJacksonObjectMapper.writeValue(out, httpResponse.getBody());
+ logger.info(new String(out.toByteArray()));
}
private HttpHeaders getHttpHeadersWithUserCredentials(ClientHttpRequest request){
diff --git a/intermediate/rest-http/src/test/resources/META-INF/spring/integration/http-outbound-config.xml b/intermediate/rest-http/src/test/resources/META-INF/spring/integration/http-outbound-config.xml
index 6538278f3..81ae6f987 100644
--- a/intermediate/rest-http/src/test/resources/META-INF/spring/integration/http-outbound-config.xml
+++ b/intermediate/rest-http/src/test/resources/META-INF/spring/integration/http-outbound-config.xml
@@ -19,7 +19,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
diff --git a/intermediate/retry-and-more/pom.xml b/intermediate/retry-and-more/pom.xml
index 6c1bc35b9..d68cc6ae5 100644
--- a/intermediate/retry-and-more/pom.xml
+++ b/intermediate/retry-and-more/pom.xml
@@ -14,8 +14,8 @@
UTF-8
- 3.0.2.RELEASE
- 3.2.8.RELEASE
+ 4.0.0.RC1
+ 4.0.3.RELEASE
1.2.17
4.10
diff --git a/intermediate/splitter-aggregator-reaper/pom.xml b/intermediate/splitter-aggregator-reaper/pom.xml
index c494004eb..f32686516 100644
--- a/intermediate/splitter-aggregator-reaper/pom.xml
+++ b/intermediate/splitter-aggregator-reaper/pom.xml
@@ -20,11 +20,11 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.16
4.10
1
- 3.2.8.RELEASE
+ 4.0.3.RELEASE
diff --git a/intermediate/splitter-aggregator-reaper/src/test/java/org/springframework/integration/samples/splitteraggregator/TestSplitterAggregator.java b/intermediate/splitter-aggregator-reaper/src/test/java/org/springframework/integration/samples/splitteraggregator/TestSplitterAggregator.java
index 48171dada..215475718 100644
--- a/intermediate/splitter-aggregator-reaper/src/test/java/org/springframework/integration/samples/splitteraggregator/TestSplitterAggregator.java
+++ b/intermediate/splitter-aggregator-reaper/src/test/java/org/springframework/integration/samples/splitteraggregator/TestSplitterAggregator.java
@@ -23,6 +23,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.integration.samples.splitteraggregator.support.TestUtils;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -35,6 +36,7 @@
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:META-INF/spring/integration/spring-integration-context.xml"})
+@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
public class TestSplitterAggregator {
@Inject
diff --git a/intermediate/stored-procedures-derby/pom.xml b/intermediate/stored-procedures-derby/pom.xml
index bfa3f17d5..1267c77e3 100644
--- a/intermediate/stored-procedures-derby/pom.xml
+++ b/intermediate/stored-procedures-derby/pom.xml
@@ -16,7 +16,7 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
diff --git a/intermediate/stored-procedures-ms/pom.xml b/intermediate/stored-procedures-ms/pom.xml
index 684fbff26..e0f63f77c 100644
--- a/intermediate/stored-procedures-ms/pom.xml
+++ b/intermediate/stored-procedures-ms/pom.xml
@@ -17,7 +17,7 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
diff --git a/intermediate/stored-procedures-oracle/pom.xml b/intermediate/stored-procedures-oracle/pom.xml
index 8bb7915b6..4b21e4f76 100644
--- a/intermediate/stored-procedures-oracle/pom.xml
+++ b/intermediate/stored-procedures-oracle/pom.xml
@@ -16,7 +16,7 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
diff --git a/intermediate/stored-procedures-postgresql/pom.xml b/intermediate/stored-procedures-postgresql/pom.xml
index 759ebe05f..027bdafb9 100644
--- a/intermediate/stored-procedures-postgresql/pom.xml
+++ b/intermediate/stored-procedures-postgresql/pom.xml
@@ -16,7 +16,7 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
diff --git a/intermediate/tcp-client-server-multiplex/pom.xml b/intermediate/tcp-client-server-multiplex/pom.xml
index 504e15230..dad27d6e6 100644
--- a/intermediate/tcp-client-server-multiplex/pom.xml
+++ b/intermediate/tcp-client-server-multiplex/pom.xml
@@ -14,8 +14,8 @@
UTF-8
- 3.2.8.RELEASE
- 3.0.2.RELEASE
+ 4.0.3.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
diff --git a/intermediate/travel/pom.xml b/intermediate/travel/pom.xml
index 7cc940391..bd25a77d0 100644
--- a/intermediate/travel/pom.xml
+++ b/intermediate/travel/pom.xml
@@ -12,10 +12,10 @@
UTF-8
- 3.0.2.RELEASE
+ 4.0.0.RC1
1.2.17
4.10
- 3.2.8.RELEASE
+ 4.0.3.RELEASE
org.springframework.integration.samples.travel.Main
diff --git a/intermediate/tx-synch/pom.xml b/intermediate/tx-synch/pom.xml
index 83b9bdf39..96cd3bf6a 100755
--- a/intermediate/tx-synch/pom.xml
+++ b/intermediate/tx-synch/pom.xml
@@ -14,8 +14,8 @@
UTF-8
- 3.0.2.RELEASE
- 3.2.8.RELEASE
+ 4.0.0.RC1
+ 4.0.3.RELEASE
1.2.17
4.10