camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1359200 - in /camel/branches/camel-2.10.x: ./ components/camel-twitter/src/main/java/org/apache/camel/component/twitter/ components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/ components/camel-twitter/src/main/...
Date Mon, 09 Jul 2012 14:57:59 GMT
Author: davsclaus
Date: Mon Jul  9 14:57:57 2012
New Revision: 1359200

URL: http://svn.apache.org/viewvc?rev=1359200&view=rev
Log:
CAMEL-5431: Added trends to camel-twitter. And more javadoc etc. Thanks to Brett for the patch.

Added:
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/trends/
      - copied from r1359197, camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/trends/
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/Twitter4JProducer.java
      - copied unchanged from r1359197, camel/trunk/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/Twitter4JProducer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DailyTrendDirectTest.java
      - copied unchanged from r1359197, camel/trunk/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DailyTrendDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DailyTrendPollingTest.java
      - copied unchanged from r1359197, camel/trunk/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DailyTrendPollingTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/WeeklyTrendDirectTest.java
      - copied unchanged from r1359197, camel/trunk/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/WeeklyTrendDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/WeeklyTrendPollingTest.java
      - copied unchanged from r1359197, camel/trunk/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/WeeklyTrendPollingTest.java
Removed:
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/GeoLocation.java
Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConstants.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/Twitter4JConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerDirect.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerEvent.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerPolling.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/FilterConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/SampleConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/ConsumerType.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/CamelTwitterTestSupport.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessageDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessagePollingTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLineDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLinePollingTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLineDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLinePollingTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchEventTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchPollingTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLineDirectTest.java
    camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLinePollingTest.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1359197

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jul  9 14:57:57 2012
@@ -1 +1 @@
-/camel/trunk:1-1358964,1359013
+/camel/trunk:1-1358964,1359013,1359197

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/Twitter4JFactory.java Mon Jul  9 14:57:57 2012
@@ -28,6 +28,8 @@ import org.apache.camel.component.twitte
 import org.apache.camel.component.twitter.consumer.timeline.PublicConsumer;
 import org.apache.camel.component.twitter.consumer.timeline.RetweetsConsumer;
 import org.apache.camel.component.twitter.consumer.timeline.UserConsumer;
+import org.apache.camel.component.twitter.consumer.trends.DailyTrendConsumer;
+import org.apache.camel.component.twitter.consumer.trends.WeeklyTrendConsumer;
 import org.apache.camel.component.twitter.data.ConsumerType;
 import org.apache.camel.component.twitter.data.StreamingType;
 import org.apache.camel.component.twitter.data.TimelineType;
@@ -41,28 +43,27 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Maps the endpoint URI to the respective Twitter4J consumer or producer.
- * 
+ * <p/>
  * URI STRUCTURE:
- * 
+ * <p/>
  * timeline/
- *              public
- *              home
- *              friends
- *              user (ALSO A PRODUCER)
- *              mentions
- *              retweetsofme
+ * public
+ * home
+ * friends
+ * user (ALSO A PRODUCER)
+ * mentions
+ * retweetsofme
  * user/
- *              search users (DIRECT ONLY)
- *              user suggestions (DIRECT ONLY)
+ * search users (DIRECT ONLY)
+ * user suggestions (DIRECT ONLY)
  * trends/
- *              daily
- *              weekly
+ * daily
+ * weekly
  * userlist
  * directmessage (ALSO A PRODUCER)
  * streaming/
- *              filter (POLLING ONLY)
- *              sample (POLLING ONLY)
- * 
+ * filter (POLLING ONLY)
+ * sample (POLLING ONLY)
  */
 public final class Twitter4JFactory {
 
@@ -123,22 +124,14 @@ public final class Twitter4JFactory {
                 if (uriSplit.length > 1) {
                     switch (TrendsType.fromUri(uriSplit[1])) {
                     case DAILY:
-                        // TODO
-                        break;
+                        return new DailyTrendConsumer(te);
                     case WEEKLY:
-                        // TODO
-                        break;
+                        return new WeeklyTrendConsumer(te);
                     default:
                         break;
                     }
                 }
                 break;
-            case USER:
-                // TODO
-                break;
-            case USERLIST:
-                // TODO
-                break;
             default:
                 break;
             }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterComponent.java Mon Jul  9 14:57:57 2012
@@ -27,23 +27,11 @@ import org.apache.camel.impl.DefaultComp
  */
 public class TwitterComponent extends DefaultComponent {
 
-    private String consumerKey;
-    private String consumerSecret;
-    private String accessToken;
-    private String accessTokenSecret;
-
-    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters)
-        throws Exception {
+    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
 
         TwitterConfiguration properties = new TwitterConfiguration();
 
-        // set options from component
-        properties.setConsumerKey(consumerKey);
-        properties.setConsumerSecret(consumerSecret);
-        properties.setAccessToken(accessToken);
-        properties.setAccessTokenSecret(accessTokenSecret);
-
-        // and then override from parameters
+        // Automatically sets all our properties.
         setProperties(properties, parameters);
 
         TwitterEndpoint endpoint;
@@ -60,36 +48,4 @@ public class TwitterComponent extends De
         }
         return endpoint;
     }
-
-    public String getAccessToken() {
-        return accessToken;
-    }
-
-    public void setAccessToken(String accessToken) {
-        this.accessToken = accessToken;
-    }
-
-    public String getAccessTokenSecret() {
-        return accessTokenSecret;
-    }
-
-    public void setAccessTokenSecret(String accessTokenSecret) {
-        this.accessTokenSecret = accessTokenSecret;
-    }
-
-    public String getConsumerKey() {
-        return consumerKey;
-    }
-
-    public void setConsumerKey(String consumerKey) {
-        this.consumerKey = consumerKey;
-    }
-
-    public String getConsumerSecret() {
-        return consumerSecret;
-    }
-
-    public void setConsumerSecret(String consumerSecret) {
-        this.consumerSecret = consumerSecret;
-    }
 }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java Mon Jul  9 14:57:57 2012
@@ -16,6 +16,10 @@
  */
 package org.apache.camel.component.twitter;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import twitter4j.Twitter;
 import twitter4j.TwitterFactory;
 import twitter4j.TwitterStream;
@@ -25,19 +29,57 @@ import twitter4j.conf.ConfigurationBuild
 
 public class TwitterConfiguration {
 
+    /**
+     * OAuth
+     */
     private String consumerKey;
     private String consumerSecret;
     private String accessToken;
     private String accessTokenSecret;
+
+    /**
+     * Defines the Twitter API endpoint.
+     */
+    private String type;
+
+    /**
+     * Polling delay.
+     */
+    private int delay = 60;
+
+    /**
+     * Username -- used for searching, etc.
+     */
     private String user;
+
+    /**
+     * Keywords used for search and filters.
+     */
     private String keywords;
-    private int delay = 60;
-    private String type;
+
+    /**
+     * Lon/Lat bounding boxes used for filtering.
+     */
     private String locations;
+
+    /**
+     * List of userIds used for searching, etc.
+     */
     private String userIds;
+
+    /**
+     * Filter out old tweets that have been previously polled.
+     */
     private boolean filterOld = true;
 
     /**
+     * Used for time-based endpoints (trends, etc.)
+     */
+    private String date;
+    private Date parsedDate;
+    private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+    /**
      * Singleton, on demand instances of Twitter4J's Twitter & TwitterStream.
      * This should not be created by an endpoint's doStart(), etc., since
      * instances of twitter and/or twitterStream can be supplied by the route
@@ -47,6 +89,9 @@ public class TwitterConfiguration {
     private Twitter twitter;
     private TwitterStream twitterStream;
 
+    /**
+     * Ensures required fields are available.
+     */
     public void checkComplete() {
         if (twitter == null && twitterStream == null
                 && (consumerKey.isEmpty() || consumerSecret.isEmpty() || accessToken.isEmpty() || accessTokenSecret.isEmpty())) {
@@ -54,6 +99,11 @@ public class TwitterConfiguration {
         }
     }
 
+    /**
+     * Builds a Twitter4J Configuration using the OAuth params.
+     *
+     * @return Configuration
+     */
     public Configuration getConfiguration() {
         ConfigurationBuilder confBuilder = new ConfigurationBuilder();
         confBuilder.setOAuthConsumerKey(consumerKey);
@@ -146,7 +196,7 @@ public class TwitterConfiguration {
     public boolean isFilterOld() {
         return filterOld;
     }
-    
+
     public void setFilterOld(boolean filterOld) {
         this.filterOld = filterOld;
     }
@@ -172,6 +222,23 @@ public class TwitterConfiguration {
     public void setTwitterStream(TwitterStream twitterStream) {
         this.twitterStream = twitterStream;
     }
+
+    public String getDate() {
+        return date;
+    }
+
+    public Date parseDate() {
+        return parsedDate;
+    }
+
+    public void setDate(String date) {
+        this.date = date;
+        try {
+            parsedDate = sdf.parse(date);
+        } catch (ParseException e) {
+            throw new IllegalArgumentException("date must be in yyyy-mm-dd format!");
+        }
+    }
 }
 
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConstants.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConstants.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConstants.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConstants.java Mon Jul  9 14:57:57 2012
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.twitter;
 
+/**
+ * Defines common constants
+ */
 public final class TwitterConstants {
 
     public static final String TWITTER_KEYWORDS = "CamelTwitterKeywords";

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpoint.java Mon Jul  9 14:57:57 2012
@@ -18,7 +18,6 @@ package org.apache.camel.component.twitt
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.component.twitter.data.EndpointType;
-import twitter4j.Twitter;
 
 public interface TwitterEndpoint extends Endpoint {
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java Mon Jul  9 14:57:57 2012
@@ -20,7 +20,6 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.component.twitter.consumer.Twitter4JConsumer;
-import org.apache.camel.component.twitter.consumer.TwitterConsumer;
 import org.apache.camel.component.twitter.consumer.TwitterConsumerPolling;
 import org.apache.camel.component.twitter.data.EndpointType;
 import org.apache.camel.impl.DefaultPollingEndpoint;
@@ -40,7 +39,7 @@ public class TwitterEndpointPolling exte
     @Override
     public Consumer createConsumer(Processor processor) throws Exception {
         Twitter4JConsumer twitter4jConsumer = Twitter4JFactory.getConsumer(this, getEndpointUri());
-        TwitterConsumer tc = new TwitterConsumerPolling(this, processor, twitter4jConsumer);
+        Consumer tc = new TwitterConsumerPolling(this, processor, twitter4jConsumer);
         configureConsumer(tc);
         return tc;
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/Twitter4JConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/Twitter4JConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/Twitter4JConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/Twitter4JConsumer.java Mon Jul  9 14:57:57 2012
@@ -19,22 +19,46 @@ package org.apache.camel.component.twitt
 import java.io.Serializable;
 import java.util.List;
 
+import org.apache.camel.component.twitter.TwitterEndpoint;
+
 import twitter4j.TwitterException;
 
 
 public abstract class Twitter4JConsumer {
-    
+
+    /**
+     * Instance of TwitterEndpoint.
+     */
+    protected TwitterEndpoint te;
+
+    /**
+     * The last tweet ID received.
+     */
     protected long lastId = 1;
-    
-    // Can't assume that the end of the list will be the most recent ID.
-    // The Twitter API sometimes returns them slightly out of order.
+
+    protected Twitter4JConsumer(TwitterEndpoint te) {
+        this.te = te;
+    }
+
+    /**
+     * Can't assume that the end of the list will be the most recent ID.
+     * The Twitter API sometimes returns them slightly out of order.
+     */
     protected void checkLastId(long newId) {
         if (newId > lastId) {
             lastId = newId;
         }
     }
 
+    /**
+     * Called by polling consumers during each poll.  It needs to be separate
+     * from directConsume() since, as an example, streaming API polling allows
+     * tweets to build up between polls.
+     */
     public abstract List<? extends Serializable> pollConsume() throws TwitterException;
 
+    /**
+     * Called by direct consumers.
+     */
     public abstract List<? extends Serializable> directConsume() throws TwitterException;
 }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerDirect.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerDirect.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerDirect.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerDirect.java Mon Jul  9 14:57:57 2012
@@ -26,9 +26,8 @@ import org.apache.camel.component.twitte
 
 /**
  * Camel DirectConsumer implementation.
- * 
  */
-public class TwitterConsumerDirect extends DirectConsumer implements TwitterConsumer {
+public class TwitterConsumerDirect extends DirectConsumer {
 
     private Twitter4JConsumer twitter4jConsumer;
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerEvent.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerEvent.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerEvent.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerEvent.java Mon Jul  9 14:57:57 2012
@@ -24,11 +24,11 @@ import org.apache.camel.component.twitte
 
 import twitter4j.Status;
 
-public class TwitterConsumerEvent extends DirectConsumer implements TwitterConsumer, TweeterStatusListener {
+public class TwitterConsumerEvent extends DirectConsumer implements TweeterStatusListener {
     private Twitter4JConsumer twitter4jConsumer;
 
     public TwitterConsumerEvent(TwitterEndpoint endpoint, Processor processor,
-                                 Twitter4JConsumer twitter4jConsumer) {
+                                Twitter4JConsumer twitter4jConsumer) {
         super(endpoint, processor);
 
         this.twitter4jConsumer = twitter4jConsumer;
@@ -38,7 +38,7 @@ public class TwitterConsumerEvent extend
     protected void doStart() throws Exception {
         super.doStart();
         if (twitter4jConsumer instanceof StreamingConsumer) {
-            ((StreamingConsumer)twitter4jConsumer).registerTweetListener(this);
+            ((StreamingConsumer) twitter4jConsumer).registerTweetListener(this);
         }
     }
 
@@ -46,7 +46,7 @@ public class TwitterConsumerEvent extend
     protected void doStop() throws Exception {
         super.doStop();
         if (twitter4jConsumer instanceof StreamingConsumer) {
-            ((StreamingConsumer)twitter4jConsumer).unregisterTweetListener(this);
+            ((StreamingConsumer) twitter4jConsumer).unregisterTweetListener(this);
         }
     }
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerPolling.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerPolling.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerPolling.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/TwitterConsumerPolling.java Mon Jul  9 14:57:57 2012
@@ -27,9 +27,8 @@ import org.apache.camel.impl.ScheduledPo
 
 /**
  * Provides a scheduled polling consumer
- * 
  */
-public class TwitterConsumerPolling extends ScheduledPollConsumer implements TwitterConsumer {
+public class TwitterConsumerPolling extends ScheduledPollConsumer {
 
     private Twitter4JConsumer twitter4jConsumer;
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/directmessage/DirectMessageConsumer.java Mon Jul  9 14:57:57 2012
@@ -30,10 +30,8 @@ import twitter4j.TwitterException;
  */
 public class DirectMessageConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public DirectMessageConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<DirectMessage> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/search/SearchConsumer.java Mon Jul  9 14:57:57 2012
@@ -30,15 +30,13 @@ import twitter4j.TwitterException;
 
 /**
  * Consumes search requests
- * 
  */
 public class SearchConsumer extends Twitter4JConsumer {
 
     private static final transient Logger LOG = LoggerFactory.getLogger(SearchConsumer.class);
-    TwitterEndpoint te;
 
     public SearchConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Tweet> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/FilterConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/FilterConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/FilterConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/FilterConsumer.java Mon Jul  9 14:57:57 2012
@@ -22,7 +22,6 @@ import twitter4j.FilterQuery;
 
 /**
  * Consumes the filter stream
- *
  */
 public class FilterConsumer extends StreamingConsumer {
 
@@ -49,7 +48,7 @@ public class FilterConsumer extends Stre
         if (keywords != null && keywords.length() > 0) {
             filterQuery.track(keywords.split(","));
         }
-        
+
         String userIds = te.getProperties().getUserIds();
         if (userIds != null) {
             String[] stringUserIds = userIds.split(",");
@@ -59,7 +58,7 @@ public class FilterConsumer extends Stre
             }
             filterQuery.follow(longUserIds);
         }
-        
+
         if (allLocationsString == null && keywords == null && userIds == null) {
             throw new IllegalArgumentException("At least one filter parameter is required");
         }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/SampleConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/SampleConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/SampleConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/SampleConsumer.java Mon Jul  9 14:57:57 2012
@@ -20,7 +20,6 @@ import org.apache.camel.component.twitte
 
 /**
  * Consumes the sample stream
- * 
  */
 public class SampleConsumer extends StreamingConsumer {
 

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/streaming/StreamingConsumer.java Mon Jul  9 14:57:57 2012
@@ -32,17 +32,15 @@ import twitter4j.TwitterStream;
 
 /**
  * Super class providing consuming capabilities for the streaming API.
- * 
  */
 public class StreamingConsumer extends Twitter4JConsumer implements StatusListener {
     protected final TwitterStream twitterStream;
-    TwitterEndpoint te;
     private final List<Status> receivedStatuses = new ArrayList<Status>();
     private volatile boolean clear;
     private TweeterStatusListener tweeterStatusListener;
 
     public StreamingConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
         twitterStream = te.getProperties().getTwitterStream();
         twitterStream.addListener(this);
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/HomeConsumer.java Mon Jul  9 14:57:57 2012
@@ -27,14 +27,11 @@ import twitter4j.TwitterException;
 
 /**
  * Consumes the user's home timeline.
- * 
  */
 public class HomeConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public HomeConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Status> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/MentionsConsumer.java Mon Jul  9 14:57:57 2012
@@ -30,10 +30,8 @@ import twitter4j.TwitterException;
  */
 public class MentionsConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public MentionsConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Status> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/PublicConsumer.java Mon Jul  9 14:57:57 2012
@@ -26,14 +26,11 @@ import twitter4j.TwitterException;
 
 /**
  * Consumes the public timeline
- * 
  */
 public class PublicConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public PublicConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Status> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/RetweetsConsumer.java Mon Jul  9 14:57:57 2012
@@ -27,14 +27,11 @@ import twitter4j.TwitterException;
 
 /**
  * Consumes a user's tweets that have been retweeted
- * 
  */
 public class RetweetsConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public RetweetsConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Status> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/consumer/timeline/UserConsumer.java Mon Jul  9 14:57:57 2012
@@ -30,10 +30,8 @@ import twitter4j.TwitterException;
  */
 public class UserConsumer extends Twitter4JConsumer {
 
-    TwitterEndpoint te;
-
     public UserConsumer(TwitterEndpoint te) {
-        this.te = te;
+        super(te);
     }
 
     public List<Status> pollConsume() throws TwitterException {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/ConsumerType.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/ConsumerType.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/ConsumerType.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/data/ConsumerType.java Mon Jul  9 14:57:57 2012
@@ -19,7 +19,7 @@ package org.apache.camel.component.twitt
 
 public enum ConsumerType {
 
-    TIMELINE, SEARCH, USER, TRENDS, USERLIST, DIRECTMESSAGE, STREAMING, UNKNOWN;
+    TIMELINE, SEARCH, TRENDS, DIRECTMESSAGE, STREAMING, UNKNOWN;
 
     public static ConsumerType fromUri(String uri) {
         for (ConsumerType consumerType : ConsumerType.values()) {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/DirectMessageProducer.java Mon Jul  9 14:57:57 2012
@@ -18,21 +18,15 @@ package org.apache.camel.component.twitt
 
 import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
 import org.apache.camel.component.twitter.TwitterEndpoint;
-import org.apache.camel.impl.DefaultProducer;
 
 /**
  * Produces text as a direct message.
- * 
  */
-public class DirectMessageProducer extends DefaultProducer implements Processor {
-
-    private TwitterEndpoint te;
+public class DirectMessageProducer extends Twitter4JProducer {
 
     public DirectMessageProducer(TwitterEndpoint te) {
         super(te);
-        this.te = te;
     }
 
     public void process(Exchange exchange) throws Exception {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/SearchProducer.java Mon Jul  9 14:57:57 2012
@@ -22,20 +22,18 @@ import org.apache.camel.CamelExchangeExc
 import org.apache.camel.Exchange;
 import org.apache.camel.component.twitter.TwitterConstants;
 import org.apache.camel.component.twitter.TwitterEndpoint;
-import org.apache.camel.impl.DefaultProducer;
+
 import twitter4j.Query;
 import twitter4j.QueryResult;
 import twitter4j.Tweet;
 import twitter4j.Twitter;
 
-public class SearchProducer extends DefaultProducer {
+public class SearchProducer extends Twitter4JProducer {
 
     private long lastId;
-    private TwitterEndpoint te;
 
     public SearchProducer(TwitterEndpoint te) {
         super(te);
-        this.te = te;
     }
 
     @Override

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/producer/UserProducer.java Mon Jul  9 14:57:57 2012
@@ -17,23 +17,20 @@
 package org.apache.camel.component.twitter.producer;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
 import org.apache.camel.component.twitter.TwitterEndpoint;
-import org.apache.camel.impl.DefaultProducer;
+
 import twitter4j.StatusUpdate;
 
 /**
  * Produces text as a status update.
  */
-public class UserProducer extends DefaultProducer implements Processor {
-
-    private TwitterEndpoint te;
+public class UserProducer extends Twitter4JProducer {
 
     public UserProducer(TwitterEndpoint te) {
         super(te);
-        this.te = te;
     }
 
+    @Override
     public void process(Exchange exchange) throws Exception {
         // update user's status
         Object in = exchange.getIn().getBody();

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/util/TwitterConverter.java Mon Jul  9 14:57:57 2012
@@ -22,11 +22,12 @@ import org.apache.camel.Converter;
 
 import twitter4j.DirectMessage;
 import twitter4j.Status;
+import twitter4j.Trend;
+import twitter4j.Trends;
 import twitter4j.Tweet;
 
 /**
  * Utility for converting between Twitter4J and camel-twitter data layers.
- * 
  */
 @Converter
 public final class TwitterConverter {
@@ -58,4 +59,25 @@ public final class TwitterConverter {
         s.append(dm.getText());
         return s.toString();
     }
+
+    @Converter
+    public static String toString(Trend trend) throws ParseException {
+        return trend.getName();
+    }
+
+    @Converter
+    public static String toString(Trends trends) throws ParseException {
+        StringBuilder s = new StringBuilder();
+        s.append("(" + trends.getTrendAt().toString() + ") ");
+        boolean first = true;
+        for (Trend trend : trends.getTrends()) {
+            if (first) {
+                first = false;
+            } else {
+                s.append(",");
+            }
+            s.append(toString(trend));
+        }
+        return s.toString();
+    }
 }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/CamelTwitterTestSupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/CamelTwitterTestSupport.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/CamelTwitterTestSupport.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/CamelTwitterTestSupport.java Mon Jul  9 14:57:57 2012
@@ -57,6 +57,6 @@ public class CamelTwitterTestSupport ext
 
     protected String getUriTokens() {
         return "consumerKey=" + consumerKey + "&consumerSecret=" + consumerSecret + "&accessToken="
-               + accessToken + "&accessTokenSecret=" + accessTokenSecret;
+                + accessToken + "&accessTokenSecret=" + accessTokenSecret;
     }
 }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessageDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessageDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessageDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessageDirectTest.java Mon Jul  9 14:57:57 2012
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
  */
 public class DirectMessageDirectTest extends CamelTwitterTestSupport {
     private static final transient Logger LOG = LoggerFactory.getLogger(DirectMessageDirectTest.class);
-    
+
 
     @Test
     public void testReadDirectMessage() throws Exception {
@@ -49,7 +49,7 @@ public class DirectMessageDirectTest ext
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://directmessage?type=direct&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessagePollingTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessagePollingTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessagePollingTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/DirectMessagePollingTest.java Mon Jul  9 14:57:57 2012
@@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory;
  */
 public class DirectMessagePollingTest extends CamelTwitterTestSupport {
     private static final transient Logger LOG = LoggerFactory.getLogger(DirectMessagePollingTest.class);
-    
 
     @Test
     public void testReadDirectMessage() throws Exception {

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLineDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLineDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLineDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLineDirectTest.java Mon Jul  9 14:57:57 2012
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
  */
 public class HomeTimeLineDirectTest extends CamelTwitterTestSupport {
     private static final transient Logger LOG = LoggerFactory.getLogger(HomeTimeLineDirectTest.class);
-    
+
 
     @Test
     public void testReadHomeTimeLine() throws Exception {
@@ -49,7 +49,7 @@ public class HomeTimeLineDirectTest exte
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/home?type=direct&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLinePollingTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLinePollingTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLinePollingTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/HomeTimeLinePollingTest.java Mon Jul  9 14:57:57 2012
@@ -43,12 +43,12 @@ public class HomeTimeLinePollingTest ext
             }
         }
     }
-   
+
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/home?type=polling&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLineDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLineDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLineDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLineDirectTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class PublicTimeLineDirectTest ex
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/public?type=direct&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLinePollingTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLinePollingTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLinePollingTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/PublicTimeLinePollingTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class PublicTimeLinePollingTest e
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/public?type=polling&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchByExchangeDirectTest.java Mon Jul  9 14:57:57 2012
@@ -83,25 +83,26 @@ public class SearchByExchangeDirectTest 
         int total = mock.getReceivedCounter();
         templateDouble.sendBodyAndHeader(null, TwitterConstants.TWITTER_KEYWORDS, "java");
 
-        Assert.assertEquals(total, mock.getReceivedCounter());
+        // due race condition
+        Assert.assertTrue(mock.getReceivedCounter() >= total);
     }
 
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
                 from("direct:start")
-                    .toF("twitter://search?%s&keywords=java", getUriTokens())
-                    .split().body()
+                        .toF("twitter://search?%s&keywords=java", getUriTokens())
+                        .split().body()
                         .to("mock:result");
 
                 from("direct:header")
-                    .toF("twitter://search?%s", getUriTokens())
-                    .split().body()
+                        .toF("twitter://search?%s", getUriTokens())
+                        .split().body()
                         .to("mock:result");
 
                 from("direct:double")
-                    .toF("twitter://search?filterOld=false&%s", getUriTokens())
-                    .split().body()
+                        .toF("twitter://search?filterOld=false&%s", getUriTokens())
+                        .split().body()
                         .to("mock:result");
             }
         };

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchDirectTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class SearchDirectTest extends Ca
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://search?type=direct&keywords=java&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchEventTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchEventTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchEventTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchEventTest.java Mon Jul  9 14:57:57 2012
@@ -41,9 +41,9 @@ public class SearchEventTest extends Cam
     @Test
     public void testSearchTimeline() throws Exception {
         resultEndpoint.expectedMinimumMessageCount(1);
-        Status status = (Status)Proxy.newProxyInstance(getClass().getClassLoader(),
-                                                              new Class[] {Status.class},
-                                                              new TwitterHandler()); 
+        Status status = (Status) Proxy.newProxyInstance(getClass().getClassLoader(),
+                new Class[]{Status.class},
+                new TwitterHandler());
 
         listener.onStatus(status);
         //"#cameltest tweet");
@@ -54,16 +54,16 @@ public class SearchEventTest extends Cam
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://streaming/filter?type=event&twitterStream=#twitterStream&keywords=#cameltest")
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }
 
     @Override
     protected JndiRegistry createRegistry() throws Exception {
-        twitterStream = (TwitterStream)Proxy.newProxyInstance(getClass().getClassLoader(),
-                                               new Class[] {TwitterStream.class},
-                                               new TwitterHandler()); 
+        twitterStream = (TwitterStream) Proxy.newProxyInstance(getClass().getClassLoader(),
+                new Class[]{TwitterStream.class},
+                new TwitterHandler());
         JndiRegistry registry = super.createRegistry();
         registry.bind("twitterStream", twitterStream);
         return registry;
@@ -73,15 +73,15 @@ public class SearchEventTest extends Cam
         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
             //mock some methods
             if ("addListener".equals(method.getName())) {
-                listener = (StatusListener)args[0];
+                listener = (StatusListener) args[0];
             } else if ("toString".equals(method.getName())) {
                 return this.toString();
             } else if ("getText".equals(method.getName())) {
                 return "#cameltest tweet";
             } else if ("getUser".equals(method.getName())) {
                 return Proxy.newProxyInstance(getClass().getClassLoader(),
-                                              new Class[] {twitter4j.User.class},
-                                              new TwitterHandler());
+                        new Class[]{twitter4j.User.class},
+                        new TwitterHandler());
             }
             return null;
         }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchPollingTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchPollingTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchPollingTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/SearchPollingTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class SearchPollingTest extends C
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://search?type=polling&keywords=java&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UriConfigurationTest.java Mon Jul  9 14:57:57 2012
@@ -24,9 +24,9 @@ import org.junit.Test;
 
 public class UriConfigurationTest extends Assert {
     private CamelContext context = new DefaultCamelContext();
-    
+
     private CamelTwitterTestSupport support = new CamelTwitterTestSupport();
-    
+
     @Test
     public void testBasicAuthentication() throws Exception {
         Endpoint endpoint = context.getEndpoint("twitter:todo/todo?" + support.getUriTokens());

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLineDirectTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLineDirectTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLineDirectTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLineDirectTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class UserTimeLineDirectTest exte
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/user?type=direct&user=brettemeyer&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }

Modified: camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLinePollingTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLinePollingTest.java?rev=1359200&r1=1359199&r2=1359200&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLinePollingTest.java (original)
+++ camel/branches/camel-2.10.x/components/camel-twitter/src/test/java/org/apache/camel/component/twitter/UserTimeLinePollingTest.java Mon Jul  9 14:57:57 2012
@@ -48,7 +48,7 @@ public class UserTimeLinePollingTest ext
         return new RouteBuilder() {
             public void configure() {
                 from("twitter://timeline/user?type=polling&user=brettemeyer&" + getUriTokens())
-                    .transform(body().convertToString()).to("mock:result");
+                        .transform(body().convertToString()).to("mock:result");
             }
         };
     }



Mime
View raw message