Skip to content

Commit

Permalink
Merge pull request spring-projects#60 from ghillert/INTSAMPLES-85
Browse files Browse the repository at this point in the history
INTSAMPLES-85 - Upgrade Twitter Sample Spring Integration version
  • Loading branch information
ghillert committed Oct 2, 2012
2 parents abe1010 + e70696f commit 23ed55d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 deletions.
17 changes: 11 additions & 6 deletions basic/twitter/pom.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId>
<artifactId>twitter</artifactId>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.integration.samples</groupId>
<artifactId>twitter</artifactId>
<version>2.1.0.BUILD-SNAPSHOT</version>
<name>Samples (Basic) - Twitter Demo</name>
<packaging>jar</packaging>

<prerequisites>
<maven>2.2.1</maven>
</prerequisites>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.0.RELEASE</spring.integration.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.integration.version>2.1.3.RELEASE</spring.integration.version>
<log4j.version>1.2.16</log4j.version>
<junit.version>4.10</junit.version>
</properties>
Expand All @@ -34,7 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>2.5.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
* @author Oleg Zhurakousky
*
*/
public class TwitterSearchSample {
public class TwitterSearchSampleTest {

@Test
public void runDemo() throws Exception{
new ClassPathXmlApplicationContext("META-INF/spring/integration/TwitterSearch-context.xml");
Thread.sleep(20000);

Thread.sleep(5000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,35 @@
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-twitter="http://www.springframework.org/schema/integration/twitter">

<context:property-placeholder location="classpath:oauth.properties"/>

<!-- While authentication is certainly support for executing Twitter searches,
authentication is not required. -->
<!--
<bean id="twitterTemplate"
class="org.springframework.social.twitter.api.impl.TwitterTemplate">
<constructor-arg value="${twitter.oauth.consumerKey}" />
<constructor-arg value="${twitter.oauth.consumerSecret}" />
<constructor-arg value="${twitter.oauth.accessToken}" />
<constructor-arg value="${twitter.oauth.accessTokenSecret}" />
</bean>

<int-twitter:search-inbound-channel-adapter id="searchAdapter" channel="sourceExtractor"
query="#springintegration" twitter-template="twitterTemplate">
<int:poller fixed-rate="3000" max-messages-per-poll="5" />
</int-twitter:search-inbound-channel-adapter>

<int-twitter:search-inbound-channel-adapter id="searchAdapter" channel="sourceExtractor"
query="#springintegration" twitter-template="twitterTemplate">
<int:poller fixed-rate="3000" max-messages-per-poll="5" />
</int-twitter:search-inbound-channel-adapter>
-->

<!-- Search Twitter without authentication -->
<int-twitter:search-inbound-channel-adapter id="searchAdapter" channel="sourceExtractor"
query="springintegration OR springframework OR #grails">
<int:poller fixed-rate="3000" max-messages-per-poll="5" />
</int-twitter:search-inbound-channel-adapter>

<int:transformer input-channel="sourceExtractor" output-channel="twitterOut" expression="payload.getText()"/>
<int:logging-channel-adapter id="twitterOut"/>

<int:logging-channel-adapter id="twitterOut" level="INFO"/>
</beans>
2 changes: 1 addition & 1 deletion basic/twitter/src/test/resources/log4j.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- Loggers -->
<logger name="org.springframework.integration">
<level value="warn" />
<level value="info" />
</logger>

<logger name="org.springframework.integration.samples">
Expand Down

0 comments on commit 23ed55d

Please sign in to comment.