Search in sources :

Example 1 with MentionsReceivingMessageSource

use of org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource in project spring-integration by spring-projects.

the class TestReceivingMessageSourceParserTests method testReceivingAdapterConfigurationAutoStartup.

@Test
public void testReceivingAdapterConfigurationAutoStartup() {
    ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("TestReceivingMessageSourceParser-context.xml", getClass());
    SourcePollingChannelAdapter spca = ac.getBean("mentionAdapter", SourcePollingChannelAdapter.class);
    MentionsReceivingMessageSource ms = TestUtils.getPropertyValue(spca, "source", MentionsReceivingMessageSource.class);
    assertEquals(Integer.valueOf(23), TestUtils.getPropertyValue(ms, "pageSize", Integer.class));
    assertNotNull(ms);
    spca = ac.getBean("dmAdapter", SourcePollingChannelAdapter.class);
    DirectMessageReceivingMessageSource dms = TestUtils.getPropertyValue(spca, "source", DirectMessageReceivingMessageSource.class);
    assertNotNull(dms);
    assertEquals(Integer.valueOf(45), TestUtils.getPropertyValue(dms, "pageSize", Integer.class));
    spca = ac.getBean("updateAdapter", SourcePollingChannelAdapter.class);
    TimelineReceivingMessageSource tms = TestUtils.getPropertyValue(spca, "source", TimelineReceivingMessageSource.class);
    assertEquals(Integer.valueOf(67), TestUtils.getPropertyValue(tms, "pageSize", Integer.class));
    assertNotNull(tms);
    ac.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) MentionsReceivingMessageSource(org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource) DirectMessageReceivingMessageSource(org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) TimelineReceivingMessageSource(org.springframework.integration.twitter.inbound.TimelineReceivingMessageSource) SourcePollingChannelAdapter(org.springframework.integration.endpoint.SourcePollingChannelAdapter) Test(org.junit.Test)

Example 2 with MentionsReceivingMessageSource

use of org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource in project spring-integration by spring-projects.

the class TestReceivingMessageSourceParserTests method testThatMessageSourcesAreRegisteredAsBeans.

@Test
public void testThatMessageSourcesAreRegisteredAsBeans() {
    ConfigurableApplicationContext ac = new ClassPathXmlApplicationContext("TestReceivingMessageSourceParser-context.xml", this.getClass());
    MentionsReceivingMessageSource ms = ac.getBean("mentionAdapter.source", MentionsReceivingMessageSource.class);
    assertNotNull(ms);
    DirectMessageReceivingMessageSource dms = ac.getBean("dmAdapter.source", DirectMessageReceivingMessageSource.class);
    assertNotNull(dms);
    TimelineReceivingMessageSource tms = ac.getBean("updateAdapter.source", TimelineReceivingMessageSource.class);
    assertNotNull(tms);
    ac.close();
}
Also used : ConfigurableApplicationContext(org.springframework.context.ConfigurableApplicationContext) MentionsReceivingMessageSource(org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource) DirectMessageReceivingMessageSource(org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) TimelineReceivingMessageSource(org.springframework.integration.twitter.inbound.TimelineReceivingMessageSource) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ConfigurableApplicationContext (org.springframework.context.ConfigurableApplicationContext)2 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)2 DirectMessageReceivingMessageSource (org.springframework.integration.twitter.inbound.DirectMessageReceivingMessageSource)2 MentionsReceivingMessageSource (org.springframework.integration.twitter.inbound.MentionsReceivingMessageSource)2 TimelineReceivingMessageSource (org.springframework.integration.twitter.inbound.TimelineReceivingMessageSource)2 SourcePollingChannelAdapter (org.springframework.integration.endpoint.SourcePollingChannelAdapter)1