Merge remote-tracking branch 'upstream/master' into 4.0.0-WIP
Conflicts: spring-integration-core/src/main/java/org/springframework/integration/MessageHeaders.java spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java spring-integration-core/src/main/java/org/springframework/integration/json/JsonToObjectTransformer.java spring-integration-core/src/main/java/org/springframework/integration/mapping/AbstractHeaderMapper.java spring-integration-core/src/main/java/org/springframework/integration/metadata/package-info.java spring-integration-feed/src/test/java/org/springframework/integration/feed/inbound/FeedEntryMessageSourceTests.java spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisInboundChannelAdapter.java spring-integration-redis/src/main/java/org/springframework/integration/redis/outbound/RedisPublishingMessageHandler.java spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisOutboundChannelAdapterParserTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpointTests.java spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java spring-integration-test/src/main/java/org/springframework/integration/test/matcher/HeaderMatcher.java spring-integration-test/src/main/java/org/springframework/integration/test/matcher/MockitoMessageMatchers.java spring-integration-test/src/main/java/org/springframework/integration/test/matcher/PayloadMatcher.java spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceTests.java spring-integration-twitter/src/test/java/org/springframework/integration/twitter/inbound/SearchReceivingMessageSourceWithRedisTests.java Resolved.
This commit is contained in:
@@ -21,6 +21,6 @@
|
||||
|
||||
<bean id="fileUrlFeedFetcher" class="org.springframework.integration.feed.inbound.FileUrlFeedFetcher"/>
|
||||
|
||||
<bean id="metadataStore" class="org.springframework.integration.store.metadata.PropertiesPersistingMetadataStore"/>
|
||||
<bean id="metadataStore" class="org.springframework.integration.metadata.PropertiesPersistingMetadataStore"/>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
|
||||
xmlns:int-feed="http://www.springframework.org/schema/integration/feed"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
|
||||
http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd">
|
||||
|
||||
<int-feed:inbound-channel-adapter channel="feedChannelUsage"
|
||||
url="file:src/test/java/org/springframework/integration/feed/sample.rss"
|
||||
feed-fetcher="fileUrlFeedFetcher">
|
||||
<int:poller fixed-rate="10000" max-messages-per-poll="100"/>
|
||||
</int-feed:inbound-channel-adapter>
|
||||
|
||||
<int:service-activator id="sampleActivator" input-channel="feedChannelUsage">
|
||||
<bean class="org.springframework.integration.feed.config.FeedInboundChannelAdapterParserTests$SampleServiceNoHistory" />
|
||||
</int:service-activator>
|
||||
|
||||
<bean id="fileUrlFeedFetcher" class="org.springframework.integration.feed.inbound.FileUrlFeedFetcher"/>
|
||||
|
||||
</beans>
|
||||
@@ -33,6 +33,7 @@ import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mockito.Mockito;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -43,7 +44,7 @@ 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.store.metadata.MetadataStore;
|
||||
import org.springframework.integration.metadata.MetadataStore;
|
||||
import org.springframework.integration.test.util.TestUtils;
|
||||
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
@@ -83,6 +84,7 @@ public class FeedInboundChannelAdapterParserTests {
|
||||
context.destroy();
|
||||
}
|
||||
|
||||
|
||||
public void validateSuccessfulHttpConfigurationWithCustomMetadataStore() {
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"FeedInboundChannelAdapterParserTests-http-context.xml", this.getClass());
|
||||
@@ -98,7 +100,7 @@ public class FeedInboundChannelAdapterParserTests {
|
||||
|
||||
@Test
|
||||
public void validateSuccessfulNewsRetrievalWithFileUrlAndMessageHistory() throws Exception {
|
||||
File persisterFile = new File(System.getProperty("java.io.tmpdir") + "/spring-integration/", "message-store.properties");
|
||||
File persisterFile = new File(System.getProperty("java.io.tmpdir") + "/spring-integration/", "metadata-store.properties");
|
||||
if (persisterFile.exists()) {
|
||||
persisterFile.delete();
|
||||
}
|
||||
@@ -120,26 +122,6 @@ public class FeedInboundChannelAdapterParserTests {
|
||||
context.destroy();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void validateSuccessfulNewsRetrievalWithFileUrlNoPersistentIdentifier() throws Exception{
|
||||
//Test file samples.rss has 3 news items
|
||||
latch = spy(new CountDownLatch(3));
|
||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"FeedInboundChannelAdapterParserTests-file-usage-noid-context.xml", this.getClass());
|
||||
latch.await(5, TimeUnit.SECONDS);
|
||||
verify(latch, times(3)).countDown();
|
||||
context.destroy();
|
||||
|
||||
// since we are not deleting the persister file
|
||||
// in this iteration no new feeds will be received and the latch will timeout
|
||||
latch = spy(new CountDownLatch(3));
|
||||
context = new ClassPathXmlApplicationContext(
|
||||
"FeedInboundChannelAdapterParserTests-file-usage-noid-context.xml", this.getClass());
|
||||
latch.await(5, TimeUnit.SECONDS);
|
||||
verify(latch, times(3)).countDown();
|
||||
context.destroy();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // goes against the real feed
|
||||
public void validateSuccessfulNewsRetrievalWithHttpUrl() throws Exception{
|
||||
@@ -204,6 +186,11 @@ public class FeedInboundChannelAdapterParserTests {
|
||||
public String get(String key) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String remove(String key) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ import java.net.URL;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.integration.metadata.PropertiesPersistingMetadataStore;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.integration.store.metadata.PropertiesPersistingMetadataStore;
|
||||
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.fetcher.FeedFetcher;
|
||||
@@ -52,14 +53,14 @@ public class FeedEntryMessageSourceTests {
|
||||
@Test(expected=IllegalArgumentException.class)
|
||||
public void testFailureWhenNotInitialized() throws Exception {
|
||||
URL url = new URL("file:src/test/java/org/springframework/integration/feed/sample.rss");
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url);
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, "foo");
|
||||
feedEntrySource.receive();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReceiveFeedWithNoEntries() throws Exception {
|
||||
URL url = new URL("file:src/test/java/org/springframework/integration/feed/empty.rss");
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
feedEntrySource.setBeanName("feedReader");
|
||||
feedEntrySource.afterPropertiesSet();
|
||||
assertNull(feedEntrySource.receive());
|
||||
@@ -68,7 +69,7 @@ public class FeedEntryMessageSourceTests {
|
||||
@Test
|
||||
public void testReceiveFeedWithEntriesSorted() throws Exception {
|
||||
URL url = new URL("file:src/test/java/org/springframework/integration/feed/sample.rss");
|
||||
FeedEntryMessageSource source = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
FeedEntryMessageSource source = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
source.setComponentName("feedReader");
|
||||
source.afterPropertiesSet();
|
||||
Message<SyndEntry> message1 = source.receive();
|
||||
@@ -87,7 +88,7 @@ public class FeedEntryMessageSourceTests {
|
||||
@Test
|
||||
public void testReceiveFeedWithRealEntriesAndRepeatWithPersistentMetadataStore() throws Exception {
|
||||
URL url = new URL("file:src/test/java/org/springframework/integration/feed/sample.rss");
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
feedEntrySource.setBeanName("feedReader");
|
||||
PropertiesPersistingMetadataStore metadataStore = new PropertiesPersistingMetadataStore();
|
||||
metadataStore.afterPropertiesSet();
|
||||
@@ -111,7 +112,7 @@ public class FeedEntryMessageSourceTests {
|
||||
metadataStore.afterPropertiesSet();
|
||||
|
||||
// now test that what's been read is no longer retrieved
|
||||
feedEntrySource = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
feedEntrySource = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
feedEntrySource.setBeanName("feedReader");
|
||||
metadataStore = new PropertiesPersistingMetadataStore();
|
||||
metadataStore.afterPropertiesSet();
|
||||
@@ -127,7 +128,7 @@ public class FeedEntryMessageSourceTests {
|
||||
@Test
|
||||
public void testReceiveFeedWithRealEntriesAndRepeatNoPersistentMetadataStore() throws Exception {
|
||||
URL url = new URL("file:src/test/java/org/springframework/integration/feed/sample.rss");
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
FeedEntryMessageSource feedEntrySource = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
feedEntrySource.setBeanName("feedReader");
|
||||
feedEntrySource.afterPropertiesSet();
|
||||
SyndEntry entry1 = feedEntrySource.receive().getPayload();
|
||||
@@ -146,7 +147,7 @@ public class FeedEntryMessageSourceTests {
|
||||
|
||||
// UNLIKE the previous test
|
||||
// now test that what's been read is read AGAIN
|
||||
feedEntrySource = new FeedEntryMessageSource(url, this.feedFetcher);
|
||||
feedEntrySource = new FeedEntryMessageSource(url, "foo", this.feedFetcher);
|
||||
feedEntrySource.setBeanName("feedReader");
|
||||
feedEntrySource.afterPropertiesSet();
|
||||
entry1 = feedEntrySource.receive().getPayload();
|
||||
|
||||
Reference in New Issue
Block a user