INT-3217 Update Default Spring to 3.2.5
JIRA: https://jira.springsource.org/browse/INT-3217 INT-3217 Polishing PR Comments Also fixes some other warnings (mainly unused imports).
This commit is contained in:
committed by
Artem Bilan
parent
db32486d35
commit
4a3ba5abd0
@@ -59,7 +59,7 @@ subprojects { subproject ->
|
||||
ftpServerVersion = '1.0.6'
|
||||
|
||||
|
||||
springVersionDefault = '3.1.4.RELEASE'
|
||||
springVersionDefault = '3.2.5.RELEASE'
|
||||
springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
|
||||
|
||||
springAmqpVersion = '1.2.0.RELEASE'
|
||||
@@ -294,6 +294,9 @@ project('spring-integration-http') {
|
||||
}
|
||||
compile ("net.java.dev.rome:rome:1.0.0", optional)
|
||||
testCompile project(":spring-integration-test")
|
||||
|
||||
// suppress deprecation warnings (@SuppressWarnings("deprecation") is not enough for javac)
|
||||
compileJava.options.compilerArgs = ["${xLintArg},-deprecation"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,12 +171,14 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper<MessagePropert
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Object replyCorrelation = amqpMessageProperties.getHeaders().get(AmqpHeaders.STACKED_CORRELATION_HEADER);
|
||||
if (replyCorrelation instanceof String) {
|
||||
if (StringUtils.hasText((String) replyCorrelation)) {
|
||||
headers.put(AmqpHeaders.SPRING_REPLY_CORRELATION, replyCorrelation);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
Object replyToStack = amqpMessageProperties.getHeaders().get(AmqpHeaders.STACKED_REPLY_TO_HEADER);
|
||||
if (replyToStack instanceof String) {
|
||||
if (StringUtils.hasText((String) replyToStack)) {
|
||||
@@ -195,6 +197,7 @@ public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper<MessagePropert
|
||||
/**
|
||||
* Extract user-defined headers from an AMQP MessageProperties instance.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected Map<String, Object> extractUserDefinedHeaders(MessageProperties amqpMessageProperties) {
|
||||
Map<String, Object> headers = amqpMessageProperties.getHeaders();
|
||||
|
||||
@@ -16,13 +16,18 @@
|
||||
|
||||
package org.springframework.integration.amqp.config;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.core.MessageListener;
|
||||
import org.springframework.amqp.core.MessageProperties;
|
||||
import org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
@@ -35,11 +40,6 @@ import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* @author Mark Fisher
|
||||
* @author Artem Bilan
|
||||
|
||||
@@ -19,7 +19,6 @@ package org.springframework.integration.file;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
@@ -40,7 +39,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.file.FileHeaders;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -16,9 +16,19 @@
|
||||
|
||||
package org.springframework.integration.file.recursive;
|
||||
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.springframework.integration.test.matcher.PayloadMatcher.hasPayload;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
@@ -27,16 +37,6 @@ import org.springframework.test.annotation.DirtiesContext.ClassMode;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.hamcrest.CoreMatchers.hasItems;
|
||||
import static org.springframework.integration.test.matcher.PayloadMatcher.hasPayload;
|
||||
|
||||
/**
|
||||
* @author Iwein Fuld
|
||||
* @author Gunnar Hillert
|
||||
|
||||
@@ -1056,8 +1056,8 @@ public class RemoteFileOutboundGatewayTests {
|
||||
return null;
|
||||
}
|
||||
}).when(session).write(any(InputStream.class), anyString());
|
||||
File file1 = tempFolder.newFile("baz.txt");
|
||||
File file2 = tempFolder.newFile("qux.txt");
|
||||
tempFolder.newFile("baz.txt");
|
||||
tempFolder.newFile("qux.txt");
|
||||
Message<File> requestMessage = MessageBuilder.withPayload(tempFolder.getRoot())
|
||||
.build();
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
@@ -40,10 +40,11 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* An {@link HttpMessageConverter} implementation that delegates to an instance of
|
||||
* {@link XmlAwareFormHttpMessageConverter} while adding the capability to <i>read</i>
|
||||
* <code>multipart/form-data</code> content in an HTTP request.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @since 2.0
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class MultipartAwareFormHttpMessageConverter implements HttpMessageConverter<MultiValueMap<String, ?>> {
|
||||
|
||||
private volatile MultipartFileReader<?> multipartFileReader = new DefaultMultipartFileReader();
|
||||
@@ -66,10 +67,12 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver
|
||||
this.multipartFileReader = multipartFileReader;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MediaType> getSupportedMediaTypes() {
|
||||
return this.wrappedConverter.getSupportedMediaTypes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRead(Class<?> clazz, MediaType mediaType) {
|
||||
if (!(MultiValueMap.class.isAssignableFrom(clazz) || byte[].class.isAssignableFrom(clazz))) {
|
||||
return false;
|
||||
@@ -83,10 +86,12 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
|
||||
return this.wrappedConverter.canWrite(clazz, mediaType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiValueMap<String, ?> read(Class<? extends MultiValueMap<String, ?>> clazz,
|
||||
HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException {
|
||||
|
||||
@@ -118,6 +123,7 @@ public class MultipartAwareFormHttpMessageConverter implements HttpMessageConver
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(MultiValueMap<String, ?> map, MediaType contentType, HttpOutputMessage outputMessage)
|
||||
throws IOException, HttpMessageNotWritableException {
|
||||
this.wrappedConverter.write(map, contentType, outputMessage);
|
||||
|
||||
@@ -116,30 +116,37 @@ public final class IntegrationRequestMappingHandlerMapping extends RequestMappin
|
||||
|
||||
org.springframework.web.bind.annotation.RequestMapping requestMappingAnnotation =
|
||||
new org.springframework.web.bind.annotation.RequestMapping() {
|
||||
@Override
|
||||
public String[] value() {
|
||||
return requestMapping.getPathPatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestMethod[] method() {
|
||||
return requestMapping.getRequestMethods();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] params() {
|
||||
return requestMapping.getParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] headers() {
|
||||
return requestMapping.getHeaders();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] consumes() {
|
||||
return requestMapping.getConsumes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] produces() {
|
||||
return requestMapping.getProduces();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends Annotation> annotationType() {
|
||||
return org.springframework.web.bind.annotation.RequestMapping.class;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ import java.net.URISyntaxException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.DateFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -30,9 +30,9 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -265,6 +265,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
|
||||
|
||||
private volatile String userDefinedHeaderPrefix = "X-";
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
@@ -326,6 +327,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
|
||||
* Depending on which type of adapter is using this mapper, the HttpHeaders might be
|
||||
* for an HTTP request (outbound adapter) or for an HTTP response (inbound adapter).
|
||||
*/
|
||||
@Override
|
||||
public void fromHeaders(MessageHeaders headers, HttpHeaders target) {
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug(MessageFormat.format("outboundHeaderNames={0}", CollectionUtils.arrayToList(outboundHeaderNames)));
|
||||
@@ -356,6 +358,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
|
||||
* Depending on which type of adapter is using this mapper, the HttpHeaders might be
|
||||
* from an HTTP request (inbound adapter) or from an HTTP response (outbound adapter).
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> toHeaders(HttpHeaders source) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(MessageFormat.format("inboundHeaderNames={0}", CollectionUtils.arrayToList(inboundHeaderNames)));
|
||||
@@ -389,6 +392,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (this.beanFactory != null){
|
||||
this.conversionService = IntegrationContextUtils.getConversionService(this.beanFactory);
|
||||
@@ -901,6 +905,7 @@ public class DefaultHttpHeaderMapper implements HeaderMapper<HttpHeaders>, BeanF
|
||||
return source.getIfNoneMatch();
|
||||
}
|
||||
else if (IF_MODIFIED_SINCE.equalsIgnoreCase(name)) {
|
||||
@SuppressWarnings("deprecation")
|
||||
long modifiedSince = source.getIfNotModifiedSince();
|
||||
return (modifiedSince > -1) ? modifiedSince : null;
|
||||
}
|
||||
|
||||
@@ -107,11 +107,12 @@ public class HttpProxyScenarioTests {
|
||||
RestTemplate template = Mockito.spy(new RestTemplate());
|
||||
|
||||
Mockito.doAnswer(new Answer<ResponseEntity<?>>() {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public ResponseEntity<?> answer(InvocationOnMock invocation) throws Throwable {
|
||||
URI uri = (URI) invocation.getArguments()[0];
|
||||
assertEquals(new URI("http://testServer/test?foo=bar&FOO=BAR"), uri);
|
||||
HttpEntity<?> httpEntity = (HttpEntity) invocation.getArguments()[2];
|
||||
HttpEntity<?> httpEntity = (HttpEntity<?>) invocation.getArguments()[2];
|
||||
HttpHeaders httpHeaders = httpEntity.getHeaders();
|
||||
assertEquals(ifModifiedSince, httpHeaders.getIfNotModifiedSince());
|
||||
assertEquals(ifUnmodifiedSinceValue, httpHeaders.getFirst("If-Unmodified-Since"));
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.integration.http.config;
|
||||
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -28,6 +28,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
@@ -167,7 +168,6 @@ public class HttpOutboundChannelAdapterParserTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("uchecked")
|
||||
public void withUrlAndTemplate() {
|
||||
DirectFieldAccessor endpointAccessor = new DirectFieldAccessor(this.withUrlAndTemplate);
|
||||
RestTemplate restTemplate =
|
||||
@@ -257,10 +257,12 @@ public class HttpOutboundChannelAdapterParserTests {
|
||||
|
||||
public static class StubErrorHandler implements ResponseErrorHandler {
|
||||
|
||||
@Override
|
||||
public boolean hasError(ClientHttpResponse response) throws IOException {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleError(ClientHttpResponse response) throws IOException {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package org.springframework.integration.http.support;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.net.URI;
|
||||
import java.text.ParseException;
|
||||
@@ -33,10 +33,10 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.support.ConversionServiceFactory;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -577,6 +577,7 @@ public class DefaultHttpHeaderMapperFromMessageInboundTests {
|
||||
|
||||
public static class TestClassConverter implements Converter<TestClass, String>{
|
||||
|
||||
@Override
|
||||
public String convert(TestClass source) {
|
||||
return "TestClass.class";
|
||||
}
|
||||
|
||||
@@ -386,6 +386,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
|
||||
|
||||
// If-Modified-Since tests
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void validateIfModifiedSinceAsNumber() throws ParseException{
|
||||
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
|
||||
@@ -399,6 +400,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
|
||||
assertEquals(simpleDateFormat.parse("Thu, 01 Jan 1970 03:25:45 GMT").getTime(), headers.getIfNotModifiedSince());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void validateIfModifiedSinceAsString() throws ParseException{
|
||||
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
|
||||
@@ -411,6 +413,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
|
||||
|
||||
assertEquals(simpleDateFormat.parse("Thu, 01 Jan 1970 03:25:45 GMT").getTime(), headers.getIfNotModifiedSince());
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Test
|
||||
public void validateIfModifiedSinceAsDate() throws ParseException{
|
||||
HeaderMapper<HttpHeaders> mapper = DefaultHttpHeaderMapper.outboundMapper();
|
||||
@@ -673,6 +676,7 @@ public class DefaultHttpHeaderMapperFromMessageOutboundTests {
|
||||
assertEquals(0, messageHeaders.size());
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void testInt2995IfModifiedSince() throws Exception{
|
||||
Date ifModifiedSince = new Date();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", Locale.US);
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.core.serializer.Deserializer;
|
||||
import org.springframework.core.serializer.Serializer;
|
||||
@@ -308,6 +309,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa
|
||||
return null;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
@ManagedAttribute
|
||||
public long getMessageCount() {
|
||||
@@ -365,6 +367,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa
|
||||
public MessageGroup addMessageToGroup(Object groupId, Message<?> message) {
|
||||
final String groupKey = getKey(groupId);
|
||||
final String messageId = getKey(message.getHeaders().getId());
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean groupNotExist = jdbcTemplate.queryForInt(this.getQuery(Query.GROUP_EXISTS), groupKey, region) < 1;
|
||||
|
||||
final Timestamp updatedDate = new Timestamp(System.currentTimeMillis());
|
||||
@@ -402,18 +405,21 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
@ManagedAttribute
|
||||
public int getMessageGroupCount() {
|
||||
return jdbcTemplate.queryForInt(getQuery(Query.COUNT_ALL_GROUPS), region);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
@ManagedAttribute
|
||||
public int getMessageCountForAllMessageGroups() {
|
||||
return jdbcTemplate.queryForInt(getQuery(Query.COUNT_ALL_MESSAGES_IN_GROUPS), region);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
@ManagedAttribute
|
||||
public int messageGroupSize(Object groupId) {
|
||||
|
||||
@@ -220,6 +220,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* Method not implemented.
|
||||
* @throws UnsupportedOperationException
|
||||
*/
|
||||
@Override
|
||||
public void setLastReleasedSequenceNumberForGroup(Object groupId, final int sequenceNumber) {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
@@ -367,6 +368,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Assert.state(jdbcTemplate != null, "A DataSource or JdbcTemplate must be provided");
|
||||
Assert.notNull(this.channelMessageStoreQueryProvider, "A channelMessageStoreQueryProvider must be provided.");
|
||||
@@ -391,6 +393,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* @param groupId the group id to store the message under
|
||||
* @param message a message
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public MessageGroup addMessageToGroup(Object groupId, Message<?> message) {
|
||||
|
||||
@@ -408,6 +411,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
final byte[] messageBytes = serializer.convert(result);
|
||||
|
||||
jdbcTemplate.update(getQuery(channelMessageStoreQueryProvider.getCreateMessageQuery()), new PreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps) throws SQLException {
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Inserting message with id key=" + messageId);
|
||||
@@ -427,6 +431,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* Method not implemented.
|
||||
* @throws UnsupportedOperationException
|
||||
*/
|
||||
@Override
|
||||
public void completeGroup(Object groupId) {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
@@ -524,6 +529,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
/**
|
||||
* Not fully used. Only wraps the provided group id.
|
||||
*/
|
||||
@Override
|
||||
public MessageGroup getMessageGroup(Object groupId) {
|
||||
return new SimpleMessageGroup(groupId);
|
||||
}
|
||||
@@ -561,6 +567,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* Method not implemented.
|
||||
* @throws UnsupportedOperationException
|
||||
*/
|
||||
@Override
|
||||
public Iterator<MessageGroup> iterator() {
|
||||
throw new UnsupportedOperationException("Not implemented");
|
||||
}
|
||||
@@ -569,6 +576,8 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* Returns the number of messages persisted for the specified channel id (groupId)
|
||||
* and the specified region ({@link #setRegion(String)}).
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
@ManagedAttribute
|
||||
public int messageGroupSize(Object groupId) {
|
||||
final String key = getKey(groupId);
|
||||
@@ -579,6 +588,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* Polls the database for a new message that is persisted for the given
|
||||
* group id which represents the channel identifier.
|
||||
*/
|
||||
@Override
|
||||
public Message<?> pollMessageFromGroup(Object groupId) {
|
||||
|
||||
final String key = getKey(groupId);
|
||||
@@ -600,6 +610,7 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
* @param messageToRemove The message to remove
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public MessageGroup removeMessageFromGroup(Object groupId, Message<?> messageToRemove) {
|
||||
|
||||
this.doRemoveMessageFromGroup(groupId, messageToRemove);
|
||||
@@ -661,11 +672,13 @@ public class JdbcChannelMessageStore extends AbstractMessageGroupStore implement
|
||||
/**
|
||||
* Will remove all messages from the message channel.
|
||||
*/
|
||||
@Override
|
||||
public void removeMessageGroup(Object groupId) {
|
||||
|
||||
final String groupKey = getKey(groupId);
|
||||
|
||||
jdbcTemplate.update(getQuery(channelMessageStoreQueryProvider.getDeleteMessageGroupQuery()), new PreparedStatementSetter() {
|
||||
@Override
|
||||
public void setValues(PreparedStatement ps) throws SQLException {
|
||||
if (logger.isDebugEnabled()){
|
||||
logger.debug("Marking messages with group key=" + groupKey);
|
||||
|
||||
@@ -94,18 +94,22 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
"select * from item where status=:status");
|
||||
adapter.setSelectSqlParameterSource(new SqlParameterSource() {
|
||||
|
||||
@Override
|
||||
public boolean hasValue(String name) {
|
||||
return "status".equals(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(String name) throws IllegalArgumentException {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeName(String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSqlType(String name) {
|
||||
return Types.INTEGER;
|
||||
}
|
||||
@@ -162,12 +166,14 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
assertEquals("Wrong id", 1, item.getId());
|
||||
assertEquals("Wrong status", 2, item.getStatus());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTwo = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 2");
|
||||
assertEquals(
|
||||
"Status not updated incorect number of rows with status 2", 0,
|
||||
countOfStatusTwo);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTen = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 10");
|
||||
assertEquals(
|
||||
@@ -198,12 +204,14 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
assertEquals("Wrong id", 1, item.getId());
|
||||
assertEquals("Wrong status", 2, item.getStatus());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTwo = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 2");
|
||||
assertEquals(
|
||||
"Status not updated incorect number of rows with status 2", 0,
|
||||
countOfStatusTwo);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTen = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 10");
|
||||
assertEquals(
|
||||
@@ -237,12 +245,14 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
assertEquals("Wrong id", 2, item.getId());
|
||||
assertEquals("Wrong status", 2, item.getStatus());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTwo = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 2");
|
||||
assertEquals(
|
||||
"Status not updated incorect number of rows with status 2", 2,
|
||||
countOfStatusTwo);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTen = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from copy where status = 10");
|
||||
assertEquals(
|
||||
@@ -275,12 +285,14 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
assertEquals("Wrong id", 2, item.getId());
|
||||
assertEquals("Wrong status", 2, item.getStatus());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTwo = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 2");
|
||||
assertEquals(
|
||||
"Status not updated incorect number of rows with status 2", 0,
|
||||
countOfStatusTwo);
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
int countOfStatusTen = this.jdbcTemplate
|
||||
.queryForInt("select count(*) from item where status = 10");
|
||||
assertEquals(
|
||||
@@ -328,6 +340,7 @@ public class JdbcPollingChannelAdapterIntegrationTests {
|
||||
|
||||
private static class ItemRowMapper implements RowMapper<Item> {
|
||||
|
||||
@Override
|
||||
public Item mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
Item item = new Item();
|
||||
item.setId(rs.getInt(1));
|
||||
|
||||
@@ -31,8 +31,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.annotation.ServiceActivator;
|
||||
@@ -44,8 +44,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* @author Gunnar Hillert
|
||||
* @author Artem Bilan
|
||||
|
||||
@@ -12,13 +12,12 @@
|
||||
*/
|
||||
package org.springframework.integration.jdbc.config;
|
||||
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
@@ -26,13 +25,13 @@ import javax.sql.DataSource;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.core.MessageHandler;
|
||||
import org.springframework.integration.core.MessagingTemplate;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
import org.springframework.integration.endpoint.PollingConsumer;
|
||||
|
||||
@@ -13,40 +13,21 @@
|
||||
|
||||
package org.springframework.integration.jdbc.config;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.sql.Types;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.DirectFieldAccessor;
|
||||
|
||||
import org.springframework.beans.factory.config.PropertiesFactoryBean;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.context.support.GenericApplicationContext;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.MessageHandler;
|
||||
import org.springframework.integration.endpoint.EventDrivenConsumer;
|
||||
import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
|
||||
import org.springframework.integration.jdbc.storedproc.ProcedureParameter;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.jdbc.core.SqlInOutParameter;
|
||||
import org.springframework.jdbc.core.SqlOutParameter;
|
||||
import org.springframework.jdbc.core.SqlParameter;
|
||||
|
||||
/**
|
||||
* @author Artem Bilan
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
package org.springframework.integration.jpa.outbound;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.FlushModeType;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -33,7 +31,6 @@ import org.springframework.integration.MessagingException;
|
||||
import org.springframework.integration.core.MessageHandler;
|
||||
import org.springframework.integration.core.SubscribableChannel;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.RedisSerializer;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.redis.outbound.RedisQueueOutboundChannelAdapter;
|
||||
import org.springframework.integration.redis.rules.RedisAvailable;
|
||||
import org.springframework.integration.redis.rules.RedisAvailableTests;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
|
||||
package org.springframework.integration.xml.source;
|
||||
|
||||
import static org.custommonkey.xmlunit.XMLAssert.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<para>
|
||||
The default dependency used by <emphasis>Spring Integration</emphasis>
|
||||
<emphasis role="strong">3.0.0.RELEASE</emphasis> is
|
||||
<emphasis>Spring Framework</emphasis> <emphasis role="strong">3.1.4.RELEASE</emphasis>.
|
||||
<emphasis>Spring Framework</emphasis> <emphasis role="strong">3.2.x</emphasis>.
|
||||
</para>
|
||||
<para>
|
||||
Generally, <emphasis>Spring Integration</emphasis> <emphasis role="strong">3.0.x</emphasis>
|
||||
|
||||
Reference in New Issue
Block a user