INT-3518: Upgrade versions and some cleanup

JIRA: https://jira.spring.io/browse/INT-3518
This commit is contained in:
Artem Bilan
2014-09-12 17:23:34 +03:00
committed by Gary Russell
parent 30b58836e5
commit 2587ed6bd0
8 changed files with 71 additions and 103 deletions

View File

@@ -67,31 +67,30 @@ subprojects { subproject ->
targetCompatibility=1.6
ext {
activeMqVersion = '5.9.0'
aspectjVersion = '1.8.0'
activeMqVersion = '5.10.0'
aspectjVersion = '1.8.2'
apacheSshdVersion = '0.10.1'
boonVersion = '0.22'
boonVersion = '0.25'
commonsDbcpVersion = '1.4'
commonsIoVersion = '2.4'
commonsNetVersion = '3.3'
httpClientVersion = '3.1'
derbyVersion = '10.10.1.1'
derbyVersion = '10.10.2.0'
eclipseLinkVersion = '2.4.2'
ftpServerVersion = '1.0.6'
groovyVersion = '2.3.1'
groovyVersion = '2.3.6'
guavaVersion = '16.0.1'
hamcrestVersion = '1.3'
hibernateVersion = '4.2.11.Final'
hibernateVersion = '4.3.6.Final'
hsqldbVersion = '2.3.2'
h2Version = '1.3.175'
jackson2Version = '2.3.2'
h2Version = '1.4.180'
jackson2Version = '2.4.2'
javaxActivationVersion = '1.1.1'
javaxMailVersion = '1.4.7'
jedisVersion = '2.4.2'
jettyVersion = '9.2.1.v20140609'
javaxMailVersion = '1.5.2'
jedisVersion = '2.5.2'
jettyVersion = '9.2.2.v20140723'
jmsApiVersion = '1.1-rev-1'
jpaApiVersion = '2.0.0'
jrubyVersion = '1.7.12'
jrubyVersion = '1.7.15'
jschVersion = '0.1.51'
jsonpathVersion = '0.9.1'
junitVersion = '4.11'
@@ -105,7 +104,6 @@ subprojects { subproject ->
reactorVersion = '1.1.4.RELEASE'
reactorSpringVersion = '1.1.3.RELEASE'
romeToolsVersion = '1.5.0'
romeVersion = '1.0.0'
saajApiVersion = '1.3.5'
saajImplVersion = '1.3.23'
servletApiVersion = '3.1.0'
@@ -113,10 +111,10 @@ subprojects { subproject ->
smack3Version = '3.2.1'
smackVersion = '4.0.0'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.4.0.M1'
springDataMongoVersion = '1.5.0.RELEASE'
springDataRedisVersion = '1.3.0.RELEASE'
springGemfireVersion = '1.4.0.RELEASE'
springSecurityVersion = '3.2.4.RELEASE'
springDataMongoVersion = '1.6.0.RELEASE'
springDataRedisVersion = '1.4.0.RELEASE'
springGemfireVersion = '1.5.0.RELEASE'
springSecurityVersion = '3.2.5.RELEASE'
springSocialTwitterVersion = '1.1.0.RELEASE'
springRetryVersion = '1.1.1.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.1.0.RELEASE'
@@ -224,7 +222,6 @@ project('spring-integration-amqp') {
description = 'Spring Integration AMQP Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-tx:$springVersion"
compile("org.springframework.amqp:spring-rabbit:$springAmqpVersion") {
exclude group: 'org.springframework', module: 'spring-aop'
exclude group: 'org.springframework', module: 'spring-context'
@@ -258,7 +255,6 @@ project('spring-integration-event') {
description = 'Spring Integration ApplicationEvent Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
}
}
@@ -266,11 +262,7 @@ project('spring-integration-feed') {
description = 'Spring Integration RSS Feed Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
compile ("net.java.dev.rome:rome-fetcher:$romeVersion") {
exclude group: 'junit', module: 'junit'
}
compile "net.java.dev.rome:rome:$romeVersion"
compile "com.rometools:rome-fetcher:$romeToolsVersion"
}
}
@@ -278,7 +270,6 @@ project('spring-integration-file') {
description = 'Spring Integration File Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
compile "commons-io:commons-io:$commonsIoVersion"
testCompile project(":spring-integration-redis")
testCompile project(":spring-integration-redis").sourceSets.test.output
@@ -314,7 +305,6 @@ project('spring-integration-gemfire') {
exclude group: 'org.springframework', module: 'spring-core'
exclude group: 'org.springframework', module: 'spring-tx'
}
compile "org.springframework:spring-tx:$springVersion"
testCompile project(":spring-integration-stream")
}
@@ -336,16 +326,8 @@ project('spring-integration-http') {
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-webmvc:$springVersion"
compile("net.java.dev.rome:rome-fetcher:$romeVersion") {
optional
exclude group: 'junit', module: 'junit'
}
compile("com.rometools:rome:$romeToolsVersion", optional) //For spring-web-4.1
compile("com.rometools:rome:$romeToolsVersion", optional)
compile("javax.servlet:javax.servlet-api:$servletApiVersion", provided)
testCompile "commons-httpclient:commons-httpclient:$httpClientVersion"
}
}
@@ -353,7 +335,6 @@ project('spring-integration-ip') {
description = 'Spring Integration IP Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
testCompile project(":spring-integration-stream")
}
}
@@ -362,15 +343,13 @@ project('spring-integration-jdbc') {
description = 'Spring Integration JDBC Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "com.google.guava:guava:$guavaVersion"
testCompile "com.h2database:h2:$h2Version"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.apache.derby:derbyclient:$derbyVersion"
testCompile "postgresql:postgresql:$postgresVersion"
testCompile "mysql:mysql-connector-java:$mysqlVersion"
testCompile "commons-dbcp:commons-dbcp:$commonsDbcpVersion"
@@ -386,7 +365,6 @@ project('spring-integration-jms') {
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-jms:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile ("javax.jms:jms-api:$jmsApiVersion", provided)
testCompile("org.apache.activemq:activemq-broker:$activeMqVersion")
testCompile("org.apache.activemq:activemq-kahadb-store:$activeMqVersion") {
@@ -400,7 +378,6 @@ project('spring-integration-jmx') {
description = 'Spring Integration JMX Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
}
}
@@ -409,9 +386,7 @@ project('spring-integration-jpa') {
description = 'Spring Integration JPA Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.eclipse.persistence:javax.persistence:$jpaApiVersion"
testCompile "com.h2database:h2:$h2Version"
@@ -456,7 +431,6 @@ project('spring-integration-mongodb') {
description = 'Spring Integration MongoDB Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-tx:$springVersion"
compile("org.springframework.data:spring-data-mongodb:$springDataMongoVersion") {
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-context'
@@ -479,7 +453,6 @@ project('spring-integration-redis') {
description = 'Spring Integration Redis Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-tx:$springVersion"
compile ("org.springframework.data:spring-data-redis:$springDataRedisVersion") {
exclude group: 'org.springframework', module: 'spring-beans'
exclude group: 'org.springframework', module: 'spring-context'
@@ -496,8 +469,6 @@ project('spring-integration-rmi') {
description = 'Spring Integration RMI Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-context:$springVersion"
}
}
@@ -515,8 +486,6 @@ project('spring-integration-security') {
description = 'Spring Integration Security Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile("org.springframework.security:spring-security-core:$springSecurityVersion") {
exclude group: 'org.springframework', module: 'spring-support'
}
@@ -529,7 +498,6 @@ project('spring-integration-security') {
project('spring-integration-sftp') {
description = 'Spring Integration SFTP Support'
dependencies {
compile project(":spring-integration-core")
compile project(":spring-integration-file")
compile project(":spring-integration-stream")
compile "com.jcraft:jsch:$jschVersion"
@@ -543,7 +511,6 @@ project('spring-integration-stream') {
description = 'Spring Integration Stream Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
}
}
@@ -565,7 +532,6 @@ project('spring-integration-test') {
compile ("org.mockito:mockito-core:$mockitoVersion") {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-test:$springVersion"
}
}
@@ -615,7 +581,6 @@ project('spring-integration-ws') {
description = 'Spring Integration Web Services Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-expression:$springVersion"
compile "org.springframework:spring-oxm:$springVersion"
compile "org.springframework:spring-webmvc:$springVersion"
compile ("org.springframework.ws:spring-ws-core:$springWsVersion") {
@@ -655,7 +620,6 @@ project('spring-integration-xml') {
description = 'Spring Integration XML Support'
dependencies {
compile project(":spring-integration-core")
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-oxm:$springVersion"
compile ("org.springframework.ws:spring-xml:$springWsVersion") {
exclude group: 'org.springframework', module: 'spring-beans'

View File

@@ -36,13 +36,13 @@ import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.fetcher.FeedFetcher;
import com.sun.syndication.fetcher.FetcherEvent;
import com.sun.syndication.fetcher.FetcherListener;
import com.sun.syndication.fetcher.impl.HashMapFeedInfoCache;
import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.FetcherEvent;
import com.rometools.fetcher.FetcherListener;
import com.rometools.fetcher.impl.HashMapFeedInfoCache;
import com.rometools.fetcher.impl.HttpURLFeedFetcher;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndFeed;
/**
* This implementation of {@link MessageSource} will produce individual
@@ -81,7 +81,6 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
* Creates a FeedEntryMessageSource that will use a HttpURLFeedFetcher to read feeds from the given URL.
* If the feed URL has a protocol other than http*, consider providing a custom implementation of the
* {@link FeedFetcher} via the alternate constructor.
*
* @param feedUrl The URL.
* @param metadataKey The metadata key.
*/
@@ -91,7 +90,6 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
/**
* Creates a FeedEntryMessageSource that will use the provided FeedFetcher to read from the given feed URL.
*
* @param feedUrl The URL.
* @param metadataKey The metadata key.
* @param feedFetcher The feed fetcher.
@@ -118,7 +116,8 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
@Override
public Message<SyndEntry> receive() {
Assert.isTrue(this.initialized, "'FeedEntryReaderMessageSource' must be initialized before it can produce Messages.");
Assert.isTrue(this.initialized,
"'FeedEntryReaderMessageSource' must be initialized before it can produce Messages.");
SyndEntry entry = doReceive();
if (entry == null) {
return null;
@@ -176,7 +175,6 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
return next;
}
@SuppressWarnings("unchecked")
private void populateEntryList() {
SyndFeed syndFeed = this.getFeed();
if (syndFeed != null) {
@@ -244,7 +242,7 @@ public class FeedEntryMessageSource extends IntegrationObjectSupport implements
private class FeedQueueUpdatingFetcherListener implements FetcherListener {
/**
* @see com.sun.syndication.fetcher.FetcherListener#fetcherEvent(com.sun.syndication.fetcher.FetcherEvent)
* @see FetcherListener#fetcherEvent(FetcherEvent)
*/
@Override
public void fetcherEvent(final FetcherEvent event) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 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.
@@ -36,20 +36,20 @@ import org.mockito.Mockito;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessagingException;
import org.springframework.integration.channel.DirectChannel;
import org.springframework.messaging.MessageHandler;
import org.springframework.integration.endpoint.SourcePollingChannelAdapter;
import org.springframework.integration.feed.inbound.FeedEntryMessageSource;
import org.springframework.integration.history.MessageHistory;
import org.springframework.integration.metadata.MetadataStore;
import org.springframework.integration.test.util.TestUtils;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessagingException;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.fetcher.impl.AbstractFeedFetcher;
import com.sun.syndication.fetcher.impl.HttpURLFeedFetcher;
import com.rometools.fetcher.impl.AbstractFeedFetcher;
import com.rometools.fetcher.impl.HttpURLFeedFetcher;
import com.rometools.rome.feed.synd.SyndEntry;
/**
* @author Oleg Zhurakousky
@@ -175,6 +175,7 @@ public class FeedInboundChannelAdapterParserTests {
public void receiveFeedEntry(SyndEntry entry) {
latch.countDown();
}
}
@@ -191,6 +192,7 @@ public class FeedInboundChannelAdapterParserTests {
public String remove(String key) {
return null;
}
}
}

View File

@@ -31,8 +31,8 @@ import org.springframework.beans.factory.BeanFactory;
import org.springframework.integration.metadata.PropertiesPersistingMetadataStore;
import org.springframework.messaging.Message;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.fetcher.FeedFetcher;
import com.rometools.fetcher.FeedFetcher;
import com.rometools.rome.feed.synd.SyndEntry;
/**
* @author Oleg Zhurakousky
@@ -47,7 +47,8 @@ public class FeedEntryMessageSourceTests {
@Before
public void prepare() {
File metadataStoreFile = new File(System.getProperty("java.io.tmpdir") + "/spring-integration/", "metadata-store.properties");
File metadataStoreFile = new File(System.getProperty("java.io.tmpdir") + "/spring-integration/",
"metadata-store.properties");
if (metadataStoreFile.exists()) {
metadataStoreFile.delete();
}

View File

@@ -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.
@@ -25,26 +25,29 @@ import java.util.zip.GZIPInputStream;
import org.springframework.util.Assert;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.fetcher.FetcherEvent;
import com.sun.syndication.fetcher.FetcherException;
import com.sun.syndication.fetcher.impl.AbstractFeedFetcher;
import com.sun.syndication.fetcher.impl.SyndFeedInfo;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedInput;
import com.sun.syndication.io.XmlReader;
import com.rometools.fetcher.FeedFetcher;
import com.rometools.fetcher.FetcherEvent;
import com.rometools.fetcher.FetcherException;
import com.rometools.fetcher.impl.AbstractFeedFetcher;
import com.rometools.fetcher.impl.SyndFeedInfo;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
/**
* @author Oleg Zhurakousky
* @author Mark Fisher
* @author Artem Bilan
* @since 2.0
*/
class FileUrlFeedFetcher extends AbstractFeedFetcher {
/**
* Retrieve a SyndFeed for the given URL.
* @see com.sun.syndication.fetcher.FeedFetcher#retrieveFeed(java.net.URL)
* @see FeedFetcher#retrieveFeed(java.net.URL)
*/
@Override
public SyndFeed retrieveFeed(URL feedUrl) throws IOException, FeedException, FetcherException {
Assert.notNull(feedUrl, "feedUrl must not be null");
URLConnection connection = feedUrl.openConnection();
@@ -53,7 +56,14 @@ class FileUrlFeedFetcher extends AbstractFeedFetcher {
return syndFeedInfo.getSyndFeed();
}
private void refreshFeedInfo(URL feedUrl, SyndFeedInfo syndFeedInfo, URLConnection connection) throws IOException, FeedException {
@Override
public SyndFeed retrieveFeed(String userAgent, URL url)
throws IllegalArgumentException, IOException, FeedException, FetcherException {
return retrieveFeed(url);
}
private void refreshFeedInfo(URL feedUrl, SyndFeedInfo syndFeedInfo, URLConnection connection)
throws IOException, FeedException {
// need to always set the URL because this may have changed due to 3xx redirects
syndFeedInfo.setUrl(connection.getURL());
@@ -62,7 +72,7 @@ class FileUrlFeedFetcher extends AbstractFeedFetcher {
syndFeedInfo.setId(feedUrl.toString());
// This will be 0 if the server doesn't support or isn't setting the last modified header
syndFeedInfo.setLastModified(new Long(connection.getLastModified()));
syndFeedInfo.setLastModified(connection.getLastModified());
// get the contents
InputStream inputStream = null;
@@ -81,7 +91,8 @@ class FileUrlFeedFetcher extends AbstractFeedFetcher {
}
}
private SyndFeed readFeedFromStream(InputStream inputStream, URLConnection connection) throws IOException, FeedException {
private SyndFeed readFeedFromStream(InputStream inputStream, URLConnection connection)
throws IOException, FeedException {
BufferedInputStream bufferedInputStream;
if ("gzip".equalsIgnoreCase(connection.getContentEncoding())) {
// handle gzip encoded content

View File

@@ -111,15 +111,9 @@ import org.springframework.web.servlet.HandlerMapping;
public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewaySupport
implements OrderlyShutdownCapable {
private static final boolean spring41Present = ClassUtils.isPresent("org.springframework.http.RequestEntity",
HttpRequestHandlingEndpointSupport.class.getClassLoader());
private static final boolean jaxb2Present = ClassUtils.isPresent("javax.xml.bind.Binder",
HttpRequestHandlingEndpointSupport.class.getClassLoader());
private static boolean romePresent = ClassUtils.isPresent("com.sun.syndication.feed.atom.Feed",
HttpRequestHandlingEndpointSupport.class.getClassLoader());
private static boolean romeToolsPresent = ClassUtils.isPresent("com.rometools.rome.feed.atom.Feed",
HttpRequestHandlingEndpointSupport.class.getClassLoader());
@@ -184,9 +178,7 @@ public abstract class HttpRequestHandlingEndpointSupport extends MessagingGatewa
logger.debug("'MappingJackson2HttpMessageConverter' was added to the 'defaultMessageConverters'.");
}
}
//The 'rometools' has been introduced since Spring Framework 4.1, hence we should check the version
// of Spring Framework using the class 'org.springframework.http.RequestEntity' from that version.
if ((spring41Present && romeToolsPresent) || romePresent) {
if (romeToolsPresent) {
this.defaultMessageConverters.add(new AtomFeedHttpMessageConverter());
this.defaultMessageConverters.add(new RssChannelHttpMessageConverter());
if (logger.isDebugEnabled()) {

View File

@@ -23,7 +23,7 @@
rest-template="restTemplate"
encode-uri="false"
expected-response-type-expression="T (org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandlerTests).testParameterizedTypeReference()">
<uri-variable name="param" expression="T(org.apache.commons.httpclient.util.URIUtil).encodeWithinQuery('http Outbound Gateway Within Chain')"/>
<uri-variable name="param" expression="T(java.net.URLEncoder).encode('http Outbound Gateway Within Chain', 'UTF-8')"/>
</outbound-gateway>
</si:chain>

View File

@@ -719,7 +719,7 @@ public class HttpRequestExecutingMessageHandlerTests {
RestTemplate restTemplate = ctx.getBean("restTemplate", RestTemplate.class);
channel.send(MessageBuilder.withPayload("test").build());
Mockito.verify(restTemplate).exchange(Mockito.eq(new URI("http://localhost/test1/%2f")), Mockito.eq(HttpMethod.POST),
Mockito.any(HttpEntity.class), Mockito.eq((Class<?>) null));
Mockito.any(HttpEntity.class), Mockito.<Class<Object>>eq(null));
}
@Test //INT-1029
@@ -733,7 +733,7 @@ public class HttpRequestExecutingMessageHandlerTests {
Message<?> receive = output.receive();
assertEquals(HttpStatus.OK, ((ResponseEntity<?>) receive.getPayload()).getStatusCode());
Mockito.verify(restTemplate)
.exchange(Mockito.eq(new URI("http://localhost:51235/%2f/testApps?param=http%20Outbound%20Gateway%20Within%20Chain")),
.exchange(Mockito.eq(new URI("http://localhost:51235/%2f/testApps?param=http+Outbound+Gateway+Within+Chain")),
Mockito.eq(HttpMethod.POST), Mockito.any(HttpEntity.class), Mockito.eq(new ParameterizedTypeReference<List<String>>() {
}));